Point
Edit this page{
"data": ... ,
"mark": "point",
"encoding": ... ,
...
}
point
mark represents each data point with a symbol. Point marks are commonly used in visualizations like scatterplots.
Documentation Overview
Point Mark Properties
// Single View Specification
{
...
"mark": {
"type": "point",
...
},
"encoding": ... ,
...
}
A point mark definition can contain any standard mark properties and the following special properties:
Property | Type | Description |
---|---|---|
shape | String | String | ExprRef |
Shape of the point marks. Supported values include: - plotting shapes: Default value: |
size | Number | ExprRef |
Default size for marks. - For Default value: - |
Examples
Dot Plot
Mapping a field to either only x
or only y
of point
marks creates a dot plot.
Scatter Plot
Mapping fields to both the x
and y
channels creates a scatter plot.
By default, point
marks only have borders and are transparent inside. You can create a filled point by setting filled
to true
.
Bubble Plot
By mapping a third field to the size
channel in the scatter plot, we can create a bubble plot instead.
Scatter Plot with Color and/or Shape
Fields can also be encoded in the scatter plot using the color
or shape
channels. For example, this specification encodes the field Origin
with both color
and shape
.
Wind Vector Map
We can also use point mark with angle encoding to create a wind vector map.
Geo Point
By mapping geographic coordinate data to longitude
and latitude
channels of a corresponding projection, we can visualize geographic points. The example below shows major airports in the US.
Point Config
// Top-level View Specification
{
...
"config": {
"point": ...,
...
}
}
The point
property of the top-level config
object sets the default properties for all point marks. If mark property encoding channels are specified for marks, these config values will be overridden.
The point config can contain any point mark properties (except type
, style
, and clip
).