inspect_viz.mark
Basic
dot
A dot mark that draws circles, or other symbols, as in a scatterplot.
def dot(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
rotate: Channel | Param | Symbol | None = None,
symbol: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
Horizontal position channel specifying the dot’s center.
y
ChannelSpec | Param-
The vertical position channel specifying the dot’s center.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
r
ChannelSpec | float | Param | None-
The radius of dots; either a channel or constant. When a number, it is interpreted as a constant radius in pixels. Otherwise it is interpreted as a channel, typically bound to the r channel, which defaults to the sqrt type for proportional symbols. The radius defaults to 4.5 pixels when using the symbol channel, and otherwise 3 pixels. Dots with a nonpositive radius are not drawn.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
rotate
Channel | float | Param | None-
The rotation angle of dots in degrees clockwise; either a channel or a constant. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 0°, pointing up.
symbol
ChannelSpec | Param | Symbol | None-
Categorical column to bind symbols to or CSS color string.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
dot_x
A horizontal dot mark that draws circles, or other symbols.
Like dot, except that y defaults to the identity function, assuming that data = [y₀, y₁, y₂, …].
If an interval is specified, such as day, y is transformed to the middle of the interval.
def dot_x(
data: Data,| Param,
x: ChannelSpec | None = None,
y: ChannelIntervalSpec | Param | None = None,
z: Channel | float | Param | None = None,
r: ChannelSpec | None = None,
interval: Interval | None = None,
filter_by: Selection | float | Param | None = None,
rotate: Channel | Param | Symbol | None = None,
symbol: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel specifying the dot’s center.
y
ChannelIntervalSpec | None-
The vertical position of the dot’s center,typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
r
ChannelSpec | float | Param | None-
The radius of dots; either a channel or constant. When a number, it is interpreted as a constant radius in pixels. Otherwise it is interpreted as a channel, typically bound to the r channel, which defaults to the sqrt type for proportional symbols. The radius defaults to 4.5 pixels when using the symbol channel, and otherwise 3 pixels. Dots with a nonpositive radius are not drawn.
interval
Interval | None-
An interval (such as day or a number), to transform y values to the middle of the interval.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
rotate
Channel | float | Param | None-
The rotation angle of dots in degrees clockwise; either a channel or a constant. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 0°, pointing up.
symbol
ChannelSpec | Param | Symbol | None-
Categorical column to bind symbols to or CSS color string.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
dot_y
A vertical dot mark that draws circles, or other symbols.
Like dot, except that x defaults to the identity function, assuming that data = [x₀, x₁, x₂, …].
If an interval is specified, such as day, x is transformed to the middle of the interval.
def dot_y(
data: Data,| Param,
y: ChannelSpec | None = None,
x: ChannelIntervalSpec | Param | None = None,
z: Channel | float | Param | None = None,
r: ChannelSpec | None = None,
interval: Interval | None = None,
filter_by: Selection | float | Param | None = None,
rotate: Channel | Param | Symbol | None = None,
symbol: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position channel specifying the dot’s center.
x
ChannelIntervalSpec | None-
The horizontal position of the dot’s center, typically bound to the x scale.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
r
ChannelSpec | float | Param | None-
The radius of dots; either a channel or constant. When a number, it is interpreted as a constant radius in pixels. Otherwise it is interpreted as a channel, typically bound to the r channel, which defaults to the sqrt type for proportional symbols. The radius defaults to 4.5 pixels when using the symbol channel, and otherwise 3 pixels. Dots with a nonpositive radius are not drawn.
interval
Interval | None-
An interval (such as day or a number), to transform x values to the middle of the interval.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
rotate
Channel | float | Param | None-
The rotation angle of dots in degrees clockwise; either a channel or a constant. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 0°, pointing up.
symbol
ChannelSpec | Param | Symbol | None-
Categorical column to bind symbols to or CSS color string.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
circle
A circle mark that draws circles as in a scatterplot.
Like dot, but with the symbol fixed to be a circle.
def circle(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: ChannelSpec | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
Horizontal position channel specifying the circle’s center.
y
ChannelSpec | Param-
The vertical position channel specifying the circle’s center.
z
ChannelSpec | Param | None-
An optional ordinal channel for grouping data into series.
r
ChannelSpec | float | Param | None-
The radius of circles; either a channel or constant. When a number, it is interpreted as a constant radius in pixels. Otherwise it is interpreted as a channel, typically bound to the r channel, which defaults to the sqrt type for proportional symbols. The radius defaults to 3 pixels. Circles with a nonpositive radius are not drawn.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
rotate
ChannelSpec | float | Param | None-
The rotation angle of circles in degrees clockwise; either a channel or a constant. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 0°, pointing up.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
hexagon
A hexagon mark that draws hexagons as in a scatterplot.
Like dot, but with the symbol fixed to be a hexagon.
def hexagon(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: ChannelSpec | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
Horizontal position channel specifying the hexagon’s center.
y
ChannelSpec | Param-
The vertical position channel specifying the hexagon’s center.
z
ChannelSpec | Param | None-
An optional ordinal channel for grouping data into series.
r
ChannelSpec | float | Param | None-
The radius of hexagons; either a channel or constant. When a number, it is interpreted as a constant radius in pixels. Otherwise it is interpreted as a channel, typically bound to the r channel, which defaults to the sqrt type for proportional symbols. The radius defaults to 4.5 pixels. Hexagons with a nonpositive radius are not drawn.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
rotate
ChannelSpec | float | Param | None-
The rotation angle of hexagons in degrees clockwise; either a channel or a constant. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 0°, pointing up.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
line
A line mark that connects control points.
Points along the line are connected in input order. If there are multiple series via the z, fill, or stroke channel, series are drawn in input order such that the last series is drawn on top.
def line(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The required horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param-
The required vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve (interpolation) method for connecting adjacent points.
tension
float | Param | None-
The tension option for bundle, cardinal and Catmull-Rom splines.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
line_x
A horizontal line mark that connects control points.
Like line, except that y defaults to the zero-based index of the data [0, 1, 2, …].
def line_x(
data: Data,| Param,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The required horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve (interpolation) method for connecting adjacent points.
tension
float | Param | None-
The tension option for bundle, cardinal and Catmull-Rom splines.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
line_y
A vertical line mark that connects control points.
Like line, except that x defaults to the zero-based index of the data [0, 1, 2, …].
def line_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
x: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The required vertical position channel, typically bound to the y scale.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve (interpolation) method for connecting adjacent points.
tension
float | Param | None-
The tension option for bundle, cardinal and Catmull-Rom splines.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
area
An area mark defined by a baseline (x1, y1) and a topline (x2, y2).
The x1 and y1 channels specify the area’s baseline; the x2 and y2 channels specify the area’s topline. Both the baseline and topline are typically bound to the same scales as their respective dimensions.
If x2 is not specified, it defaults to x1. If y2 is not specified, it defaults to y1. Typically either x2 or y2 is unspecified, creating either a horizontal or vertical area.
def area(
data: Data,| Param,
x1: ChannelSpec | Param,
y1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
| Param | None = None,
curve: Curve **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x1
ChannelSpec | Param-
The required primary (starting, often left) horizontal position channel, representing the area’s baseline, typically bound to the x scale.
y1
ChannelSpec | Param-
The required primary (starting, often bottom) vertical position channel, representing the area’s baseline, typically bound to the y scale.
x2
ChannelSpec | Param | None-
The optional secondary (ending, often right) horizontal position channel, representing the area’s topline, typically bound to the x scale; if not specified, x1 is used.
y2
ChannelSpec | Param | None-
The optional secondary (ending, often top) vertical position channel, representing the area’s topline, typically bound to the y scale; if not specified, y1 is used.
z
Channel | Param | None-
An optional ordinal channel for grouping data into (possibly stacked) series to be drawn as separate areas; defaults to fill if a channel, or stroke if a channel.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks, say to produce a streamgraph; defaults to null for a zero baseline (y = 0 for stackY, and x = 0 for stackX). If the wiggle offset is used, the default order changes to inside-out.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of:
- null (default) for input order
- a named stack order method such as inside-out or sum
- a field name, for natural order of the corresponding values
- a function of data, for natural order of the corresponding values
- an array of explicit z values in the desired order
If the wiggle offset is used, as for a streamgraph, the default changes to inside-out.
curve
Curve | Param | None-
The curve (interpolation) method for connecting adjacent points.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
area_x
A horizontal area mark.
The x channel specifies the area’s length (or width); it is typically bound to the x scale. The y channel specifies the area’s vertical position; it is typically bound to the y scale and defaults to the zero-based index of the data [0, 1, 2, …].
If neither x1 nor x2 is specified, an implicit stackX transform is applied and x defaults to the identity function, assuming that data = [x₀, x₁, x₂, …]. Otherwise, if only one of x1 or x2 is specified, the other defaults to x, which defaults to zero.
def area_x(
data: Data,| Param,
x: ChannelSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
| Param | None = None,
curve: Curve **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position (or length) channel, typically bound to the x scale. If neither x1 nor x2 is specified, an implicit stackX transform is applied and x defaults to the identity function, assuming that data = [x₀, x₁, x₂, …]. Otherwise, if only one of x1 or x2 is specified, the other defaults to x, which defaults to zero.
x1
ChannelSpec | Param | None-
The required primary (starting, often left) horizontal position channel, representing the area’s baseline, typically bound to the x scale. For areaX, setting this option disables the implicit stackX transform.
x2
ChannelSpec | Param | None-
The optional secondary (ending, often right) horizontal position channel, representing the area’s topline, typically bound to the x scale; if not specified, x1 is used. For areaX, setting this option disables the implicit stackX transform.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into (possibly stacked) series to be drawn as separate areas; defaults to fill if a channel, or stroke if a channel.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks, say to produce a streamgraph; defaults to null for a zero baseline (y = 0 for stackY, and x = 0 for stackX). If the wiggle offset is used, the default order changes to inside-out.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of:
- null (default) for input order
- a named stack order method such as inside-out or sum
- a field name, for natural order of the corresponding values
- a function of data, for natural order of the corresponding values
- an array of explicit z values in the desired order
If the wiggle offset is used, as for a streamgraph, the default changes to inside-out.
curve
Curve | Param | None-
The curve (interpolation) method for connecting adjacent points.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
area_y
A vertical area mark.
The y channel specifies the area’s height (or length); it is typically bound to the y scale. The x channel specifies the area’s horizontal position; it is typically bound to the x scale and defaults to the zero-based index of the data [0, 1, 2, …].
If neither y1 nor y2 is specified, an implicit stackY transform is applied and y defaults to the identity function, assuming that data = [y₀, y₁, y₂, …]. Otherwise, if only one of y1 or y2 is specified, the other defaults to y, which defaults to zero.
def area_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
x: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
| Param | None = None,
curve: Curve **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position (or length) channel, typically bound to the y scale. If neither y1 nor y2 is specified, an implicit stackY transform is applied and y defaults to the identity function, assuming that data = [y₀, y₁, y₂, …]. Otherwise, if only one of y1 or y2 is specified, the other defaults to y, which defaults to zero.
y1
ChannelSpec | Param | None-
The required primary (starting, often bottom) vertical position channel, representing the area’s baseline, typically bound to the y scale. For areaY, setting this option disables the implicit stackY transform.
y2
ChannelSpec | Param | None-
The optional secondary (ending, often top) vertical position channel, representing the area’s topline, typically bound to the y scale; if not specified, y1 is used. For areaY, setting this option disables the implicit stackY transform.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into (possibly stacked) series to be drawn as separate areas; defaults to fill if a channel, or stroke if a channel.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks, say to produce a streamgraph; defaults to null for a zero baseline (y = 0 for stackY, and x = 0 for stackX). If the wiggle offset is used, the default order changes to inside-out.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of:
- null (default) for input order
- a named stack order method such as inside-out or sum
- a field name, for natural order of the corresponding values
- a function of data, for natural order of the corresponding values
- an array of explicit z values in the desired order
If the wiggle offset is used, as for a streamgraph, the default changes to inside-out.
curve
Curve | Param | None-
The curve (interpolation) method for connecting adjacent points.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
bar_x
A horizontal bar mark.
The required x values should be quantitative or temporal, and the optional y values should be ordinal.
If neither x1 nor x2 nor interval is specified, an implicit stackX transform is applied and x defaults to the identity function, assuming that data = [x₀, x₁, x₂, …]. Otherwise if an interval is specified, then x1 and x2 are derived from x, representing the lower and upper bound of the containing interval, respectively. Otherwise, if only one of x1 or x2 is specified, the other defaults to x, which defaults to zero.
The optional y ordinal channel specifies the vertical position; it is typically bound to the y scale, which must be a band scale. If the y channel is not specified, the bar will span the vertical extent of the plot’s frame.
If y is quantitative, use the rectX mark instead. If x is ordinal, use the cell mark instead.”
def bar_x(
data: Data,| Param,
x: ChannelIntervalSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y: ChannelIntervalSpec | None = None,
interval: Interval | None = None,
filter_by: Selection "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
| Param | None = None,
z: Channel float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: str | float | Param | None = None,
rx: str | float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelIntervalSpec | Param-
The horizontal position (or length/width) channel, typically bound to the x scale. If neither x1 nor x2 nor interval is specified, an implicit stackX transform is applied and x defaults to the identity function, assuming that data = [x₀, x₁, x₂, …]. Otherwise if an interval is specified, then x1 and x2 are derived from x, representing the lower and upper bound of the containing interval, respectively. Otherwise, if only one of x1 or x2 is specified, the other defaults to x, which defaults to zero.
x1
ChannelSpec | Param | None-
The required primary (starting, often left) horizontal position channel, typically bound to the x scale. Setting this option disables the implicit stackX transform. If x represents ordinal values, use a cell mark instead.
x2
ChannelSpec | Param | None-
The required secondary (ending, often right) horizontal position channel, typically bound to the x scale. Setting this option disables the implicit stackX transform. If x represents ordinal values, use a cell mark instead.
y
ChannelIntervalSpec | Param | None-
The optional vertical position of the bar; a ordinal channel typically bound to the y scale. If not specified, the bar spans the vertical extent of the frame; otherwise the y scale must be a band scale. If y represents quantitative or temporal values, use a rectX mark instead.
interval
Interval | None-
How to convert a continuous value (x for barX, or y for barY) into an interval (x1 and x2 for barX, or y1 and y2 for barY); one of:
- a named time interval such as day (for date intervals)
- a number (for number intervals), defining intervals at integer multiples of n
Setting this option disables the implicit stack transform (stackX for barX, or stackY for barY).
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks, say to produce a streamgraph; defaults to null for a zero baseline (y = 0 for stackY, and x = 0 for stackX). If the wiggle offset is used, the default order changes to inside-out.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of:
- null (default) for input order
- a named stack order method such as inside-out or sum
- a field name, for natural order of the corresponding values
- a function of data, for natural order of the corresponding values
- an array of explicit z values in the desired order
If the wiggle offset is used, as for a streamgraph, the default changes to inside-out.
z
Channel | Param | None-
The z channel defines the series of each value in the stack. Used when the order is sum, appearance, inside-out, or an explicit array of z values.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels. A positive value insets towards the bottom edge (reducing effective area), while a negative value insets away from the bottom edge (increasing it).
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels. A positive value insets towards the left edge (reducing effective area), while a negative value insets away from the left edge (increasing it).
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels. A positive value insets towards the top edge (reducing effective area), while a negative value insets away from the top edge (increasing it).
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels. A positive value insets towards the right edge (reducing effective area), while a negative value insets away from the right edge (increasing it).
rx
str | float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the rect width. If rx is not specified, it defaults to ry if present, and otherwise draws square corners.
ry
str | float | Param | None-
The rounded corner [y-radius][], either in pixels or as a percentage of the rect height. If ry is not specified, it defaults to rx if present, and otherwise draws square corners.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
bar_y
A vertical bar mark.
The required y values should be quantitative or temporal, and the optional x values should be ordinal.
If neither y1 nor y2 nor interval is specified, an implicit stackY transform is applied and y defaults to the identity function, assuming that data = [y₀, y₁, y₂, …]. Otherwise if an interval is specified, then y1 and y2 are derived from y, representing the lower and upper bound of the containing interval, respectively. Otherwise, if only one of y1 or y2 is specified, the other defaults to y, which defaults to zero.
The optional x ordinal channel specifies the horizontal position; it is typically bound to the x scale, which must be a band scale. If the x channel is not specified, the bar will span the horizontal extent of the plot’s frame.
If x is quantitative, use the rectY mark instead. If y is ordinal, use the cell mark instead.
def bar_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
x: ChannelSpec | None = None,
interval: Interval | None = None,
filter_by: Selection "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
| Param | None = None,
z: Channel float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: str | float | Param | None = None,
rx: str | float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position (or length/height) channel, typically bound to the y scale. If neither y1 nor y2 nor interval is specified, an implicit stackY transform is applied and y defaults to the identity function, assuming that data = [y₀, y₁, y₂, …]. Otherwise if an interval is specified, then y1 and y2 are derived from y, representing the lower and upper bound of the containing interval, respectively. Otherwise, if only one of y1 or y2 is specified, the other defaults to y, which defaults to zero.
y1
ChannelSpec | Param | None-
The required primary (starting, often bottom) vertical position channel, typically bound to the y scale. Setting this option disables the implicit stackY transform. If y represents ordinal values, use a cell mark instead.
y2
ChannelSpec | Param | None-
The required secondary (ending, often top) vertical position channel, typically bound to the y scale. Setting this option disables the implicit stackY transform. If y represents ordinal values, use a cell mark instead.
x
ChannelSpec | Param | None-
The optional horizontal position of the bar; a ordinal channel typically bound to the x scale. If not specified, the bar spans the horizontal extent of the frame; otherwise the x scale must be a band scale. If x represents quantitative or temporal values, use a rectY mark instead.
interval
Interval | None-
How to convert a continuous value (x for barX, or y for barY) into an interval (x1 and x2 for barX, or y1 and y2 for barY); one of:
- a named time interval such as day (for date intervals)
- a number (for number intervals), defining intervals at integer multiples of n
Setting this option disables the implicit stack transform (stackX for barX, or stackY for barY).
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks, say to produce a streamgraph; defaults to null for a zero baseline (y = 0 for stackY, and x = 0 for stackX). If the wiggle offset is used, the default order changes to inside-out.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of:
- null (default) for input order
- a named stack order method such as inside-out or sum
- a field name, for natural order of the corresponding values
- a function of data, for natural order of the corresponding values
- an array of explicit z values in the desired order
If the wiggle offset is used, as for a streamgraph, the default changes to inside-out.
z
Channel | Param | None-
The z channel defines the series of each value in the stack. Used when the order is sum, appearance, inside-out, or an explicit array of z values.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels. A positive value insets towards the bottom edge (reducing effective area), while a negative value insets away from the bottom edge (increasing it).
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels. A positive value insets towards the left edge (reducing effective area), while a negative value insets away from the left edge (increasing it).
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels. A positive value insets towards the top edge (reducing effective area), while a negative value insets away from the top edge (increasing it).
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels. A positive value insets towards the right edge (reducing effective area), while a negative value insets away from the right edge (increasing it).
rx
str | float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the rect width. If rx is not specified, it defaults to ry if present, and otherwise draws square corners.
ry
str | float | Param | None-
The rounded corner [y-radius][], either in pixels or as a percentage of the rect height. If ry is not specified, it defaults to rx if present, and otherwise draws square corners.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
heatmap
Create a heatmap mark for density visualization with optimized defaults.
The heatmap mark is essentially a raster mark with different default options optimized for density visualization. It bins spatial data into a raster grid and applies kernel density smoothing to create smooth density surfaces from point data.
def heatmap(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
width: float | Param | None = None,
height: float | Param | None = None,
pixel_size: float | Param | None = None,
pad: | Param | None = None,
interpolate: Interpolate float | Param | None = None,
bandwidth: str | Param | None = None,
image_rendering: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
width
float | Param | None-
The width (number of columns) of the grid, in actual pixels.
height
float | Param | None-
The height (number of rows) of the grid, in actual pixels.
pixel_size
float | Param | None-
The effective screen size of a raster pixel, used to determine the height and width of the raster from the frame’s dimensions; defaults to 1.
pad
float | Param | None-
The bin padding, one of 1 (default) to include extra padding for the final bin, or 0 to make the bins flush with the maximum domain value.
interpolate
Interpolate | Param | None-
The spatial interpolation method; one of: - none - do not perform interpolation (the default) - linear - apply proportional linear interpolation across adjacent bins - nearest - assign each pixel to the closest sample’s value (Voronoi diagram) - barycentric - apply barycentric interpolation over the Delaunay triangulation - random-walk - apply a random walk from each pixel
bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels; defaults to 20.
image_rendering
str | Param | None-
The image-rendering attribute; defaults to auto (bilinear). May be set to pixelated to disable bilinear interpolation for a sharper image.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
Statistical
density
Create a 2D density mark that shows smoothed point cloud densities.
The density mark bins the data, counts the number of records that fall into each bin, and smooths the resulting counts, then plots the smoothed distribution, by default using a circular dot mark. The density mark calculates density values that can be mapped to encoding channels such as fill or r using the special field name “density”.
def density(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection type: Literal["dot", "circle", "hexagon", "cell", "text"] | Param | None = None,
float | Param | None = None,
width: float | Param | None = None,
height: float | Param | None = None,
pixel_size: float | Param | None = None,
pad: float | Param | None = None,
bandwidth: | Param | None = None,
interpolate: Interpolate | Param | None = None,
symbol: Symbol | float | Param | None = None,
r: ChannelSpec | float | Param | None = None,
rotate: Channel | Param | None = None,
frame_anchor: FrameAnchor | None = None,
styles: TextStyles **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
A selection to filter the data.
type
Literal['dot', 'circle', 'hexagon', 'cell', 'text'] | Param | None-
The base mark type to use for rendering; defaults to “dot”.
width
float | Param | None-
The number of horizontal bins for density calculation.
height
float | Param | None-
The number of vertical bins for density calculation.
pixel_size
float | Param | None-
The size of each pixel for the grid, in data units.
pad
float | Param | None-
The bin padding, one of 1 (default) to include extra padding for the final bin, or 0 to make the bins flush with the maximum domain value.
bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
interpolate
Interpolate | Param | None-
The spatial interpolation method; one of: - none - do not perform interpolation (the default) - linear - apply proportional linear interpolation across adjacent bins - nearest - assign each pixel to the closest sample’s value (Voronoi diagram) - barycentric - apply barycentric interpolation over the Delaunay triangulation - random-walk - apply a random walk from each pixel
symbol
Symbol | Param | None-
The symbol type for dots; defaults to “circle”.
r
ChannelSpec | float | Param | None-
The radius channel, typically bound to the radius scale.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
styles
TextStyles | None-
Text styles to apply.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
density_x
A densityX mark that visualizes smoothed point cloud densities along the x dimension.
The mark bins the data, counts the number of records that fall into each bin, smooths the resulting counts, and then plots the smoothed distribution, by default using an areaX mark.
Set the type property to use a different base mark type.
def density_x(
data: Data,| Param | None = None,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection type: Literal["areaX", "lineX", "dotX", "textX"] | Param | None = None,
bool | Param | None = None,
stack: float | Param | None = None,
bandwidth: float | Param | None = None,
bins: bool | Literal["max", "sum", "none"] | Param | None = None,
normalize: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
A selection to filter the data.
type
Literal['areaX', 'lineX', 'dotX', 'textX'] | Param | None-
The basic mark type to use to render 1D density values. Defaults to an areaX mark; lineX, dotX, and textX marks are also supported.
stack
bool | Param | None-
Flag indicating if densities should be stacked. Defaults to
False
. bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
bins
float | Param | None-
The number of bins over which to discretize the data prior to smoothing. Defaults to 1024.
normalize
bool | Literal['max', 'sum', 'none'] | Param | None-
Normalization method for density estimates. If
False
or'none'
(the default), the density estimates are smoothed weighted counts. IfTrue
or'sum'
, density estimates are divided by the sum of the total point mass. If'max'
, estimates are divided by the maximum smoothed value. **options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
density_y
A densityY mark that visualizes smoothed point cloud densities along the y dimension.
The mark bins the data, counts the number of records that fall into each bin, smooths the resulting counts, and then plots the smoothed distribution, by default using an areaY mark.
Set the type property to use a different base mark type.
def density_y(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection type: Literal["areaY", "lineY", "dotY", "circle", "hexagon", "textY"]
| Param
| None = None,
bool | Param | None = None,
stack: float | Param | None = None,
bandwidth: float | Param | None = None,
bins: bool | Literal["max", "sum", "none"] | Param | None = None,
normalize: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
A selection to filter the data.
type
Literal['areaY', 'lineY', 'dotY', 'circle', 'hexagon', 'textY'] | Param | None-
The basic mark type to use to render 1D density values. Defaults to an areaY mark; lineY, dotY, circle, hexagon, and textY marks are also supported.
stack
bool | Param | None-
Flag indicating if densities should be stacked. Defaults to
False
. bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
bins
float | Param | None-
The number of bins over which to discretize the data prior to smoothing. Defaults to 1024.
normalize
bool | Literal['max', 'sum', 'none'] | Param | None-
Normalization method for density estimates. If
False
or'none'
(the default), the density estimates are smoothed weighted counts. IfTrue
or'sum'
, density estimates are divided by the sum of the total point mass. If'max'
, estimates are divided by the maximum smoothed value. **options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
contour
Create a contour mark that draws contour lines of equal value.
The contour mark creates isolines showing contours of equal value. It bins the given data into a 2D grid, computes density estimates, and draws contour lines at specified threshold levels. The contour mark is useful for visualizing the density or distribution of 2D point data.
def contour(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | None = None,
filter_by: Selection float | list[float] | Param | None = None,
thresholds: float | Param | None = None,
bandwidth: float | Param | None = None,
width: float | Param | None = None,
height: float | Param | None = None,
pixel_size: float | Param | None = None,
pad: | Param | None = None,
interpolate: Interpolate **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
thresholds
float | list[float] | Param | None-
The number of contour thresholds to subdivide the domain into discrete level sets; defaults to 10. Can be a count or an array of threshold values.
bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
width
float | Param | None-
The width (number of columns) of the grid, in actual pixels.
height
float | Param | None-
The height (number of rows) of the grid, in actual pixels.
pixel_size
float | Param | None-
The effective screen size of a raster pixel, used to determine the height and width of the raster from the frame’s dimensions; defaults to 1.
pad
float | Param | None-
The bin padding, one of 1 (default) to include extra padding for the final bin, or 0 to make the bins flush with the maximum domain value.
interpolate
Interpolate | Param | None-
The spatial interpolation method; one of: - none - do not perform interpolation (the default) - linear - apply proportional linear interpolation across adjacent bins - nearest - assign each pixel to the closest sample’s value (Voronoi diagram) - barycentric - apply barycentric interpolation over the Delaunay triangulation - random-walk - apply a random walk from each pixel
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
regression_y
A vertical regression mark.
The regressionY mark draws a regression line with optional confidence bands showing the relationship between variables. The x variable is the independent variable and y is the dependent variable.
def regression_y(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection float | Param | None = None,
ci: float | Param | None = None,
precision: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The independent variable horizontal position channel (defaults to zero-based index).
y
ChannelSpec | Param | None-
The dependent variable vertical position channel (defaults to identity function).
z
Channel | Param | None-
An optional ordinal channel for grouping data into series, producing independent regressions for each group.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
ci
float | Param | None-
The confidence interval in (0, 1), or 0 to hide bands; defaults to 0.95.
precision
float | Param | None-
The distance in pixels between samples of the confidence band; defaults to 4.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
error_bar_x
A horizontal error bar mark.
The errorBarX mark draws horizontal error bars showing confidence intervals or uncertainty around data points. The error bars extend horizontally from the central value.
def error_bar_x(
data: Data,| Param,
x: ChannelSpec | Param | None = None,
y: ChannelSpec float | Param | None = None,
ci: | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The dependent variable horizontal position channel (required).
y
ChannelSpec | Param | None-
The independent variable vertical position channel (optional).
ci
float | Param | None-
The confidence interval in (0, 1); defaults to 0.95.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
The marker symbol to use at all positions along the error bar.
marker_start
Marker | bool | Param | None-
The marker symbol to use at the start of the error bar.
marker_mid
Marker | bool | Param | None-
The marker symbol to use at the middle of the error bar.
marker_end
Marker | bool | Param | None-
The marker symbol to use at the end of the error bar.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
error_bar_y
A vertical error bar mark.
The errorBarY mark draws vertical error bars showing confidence intervals or uncertainty around data points. The error bars extend vertically from the central value.
def error_bar_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
x: ChannelSpec float | Param | None = None,
ci: | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The dependent variable vertical position channel (required).
x
ChannelSpec | Param | None-
The independent variable horizontal position channel (optional).
ci
float | Param | None-
The confidence interval in (0, 1); defaults to 0.95.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
The marker symbol to use at all positions along the error bar.
marker_start
Marker | bool | Param | None-
The marker symbol to use at the start of the error bar.
marker_mid
Marker | bool | Param | None-
The marker symbol to use at the middle of the error bar.
marker_end
Marker | bool | Param | None-
The marker symbol to use at the end of the error bar.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
Grid
cell
A cell mark that draws axis-aligned rectangles for categorical data.
Cells are typically used to create heatmaps and other grid-based visualizations where both x and y represent categorical or ordinal data.
def cell(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
filter_by
Selection | None-
A selection to filter the data.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the cell width.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the cell height.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
cell_x
A cellX mark that draws axis-aligned rectangles with ordinal positioning.
The x values should be ordinal (categories), and the optional y values should also be ordinal.
def cell_x(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
filter_by
Selection | None-
A selection to filter the data.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the cell width.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the cell height.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
cell_y
A cellY mark that draws axis-aligned rectangles with ordinal positioning.
The y values should be ordinal (categories), and the optional x values should also be ordinal.
def cell_y(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
filter_by
Selection | None-
A selection to filter the data.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the cell width.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the cell height.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
grid_x
A horizontal grid mark.
The gridX mark draws horizontal grid lines across the plot area. It is primarily used for adding visual reference lines along the x-axis.
def grid_x(
| Param | None = None,
x: ChannelSpec | None = None,
y: ChannelIntervalSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | None = None,
interval: Interval str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: **options: Unpack[MarkOptions],
-> Mark )
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelIntervalSpec | None-
Shorthand for specifying both the primary and secondary vertical position of the tick as the bounds of the containing interval; can only be used in conjunction with the interval option.
y1
ChannelSpec | Param | None-
The primary (starting, often bottom) vertical position of the grid line.
y2
ChannelSpec | Param | None-
The secondary (ending, often top) vertical position of the grid line.
interval
Interval | None-
How to convert a continuous value into an interval.
anchor
str | Param | None-
The side of the frame on which to place the grid (top or bottom).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
**options
Unpack[MarkOptions]-
Additional MarkOptions (including stroke, stroke_width, stroke_opacity, stroke_dasharray).
grid_y
A vertical grid mark.
The gridY mark draws vertical grid lines across the plot area. It is primarily used for adding visual reference lines along the y-axis.
def grid_y(
| Param | None = None,
y: ChannelSpec | None = None,
x: ChannelIntervalSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | None = None,
interval: Interval str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: float | Param | None = None,
inset_left: float | Param | None = None,
inset_right: **options: Unpack[MarkOptions],
-> Mark )
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
x
ChannelIntervalSpec | None-
Shorthand for specifying both the primary and secondary horizontal position of the tick as the bounds of the containing interval; can only be used in conjunction with the interval option.
x1
ChannelSpec | Param | None-
The primary (starting, often left) horizontal position of the grid line.
x2
ChannelSpec | Param | None-
The secondary (ending, often right) horizontal position of the grid line.
interval
Interval | None-
How to convert a continuous value into an interval.
anchor
str | Param | None-
The side of the frame on which to place the grid (left or right).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
**options
Unpack[MarkOptions]-
Additional MarkOptions (including stroke, stroke_width, stroke_opacity, stroke_dasharray).
grid_fx
A horizontal facet grid mark.
The gridFx mark draws horizontal grid lines for faceted plots. It is primarily used for adding visual reference lines along the fx-axis in faceted visualizations.
def grid_fx(
| Param | None = None,
x: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | None = None,
interval: Interval str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: **options: Unpack[MarkOptions],
-> Mark )
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y1
ChannelSpec | Param | None-
The primary (starting, often bottom) vertical position of the grid line.
y2
ChannelSpec | Param | None-
The secondary (ending, often top) vertical position of the grid line.
interval
Interval | None-
How to convert a continuous value into an interval.
anchor
str | Param | None-
The side of the frame on which to place the grid (top or bottom).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
**options
Unpack[MarkOptions]-
Additional MarkOptions (including stroke, stroke_width, stroke_opacity, stroke_dasharray).
grid_fy
A vertical facet grid mark.
The gridFy mark draws vertical grid lines for faceted plots. It is primarily used for adding visual reference lines along the fy-axis in faceted visualizations.
def grid_fy(
| Param | None = None,
y: ChannelSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | None = None,
interval: Interval str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: float | Param | None = None,
inset_left: float | Param | None = None,
inset_right: **options: Unpack[MarkOptions],
-> Mark )
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
x1
ChannelSpec | Param | None-
The primary (starting, often left) horizontal position of the grid line.
x2
ChannelSpec | Param | None-
The secondary (ending, often right) horizontal position of the grid line.
interval
Interval | None-
How to convert a continuous value into an interval.
anchor
str | Param | None-
The side of the frame on which to place the grid (left or right).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
**options
Unpack[MarkOptions]-
Additional MarkOptions (including stroke, stroke_width, stroke_opacity, stroke_dasharray).
hexbin
Create a hexbin mark for hexagonal binning of point data.
The hexbin mark bins two-dimensional point data into hexagonal bins and displays aggregated values for each bin. This is useful for visualizing density patterns in large datasets and for creating hexagonal heatmaps.
The mark creates a hexagonal grid and counts or aggregates data points within each hexagon, then renders the results using the specified mark type.
def hexbin(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection float | Param | None = None,
bin_width: type: Literal["hexagon", "dot", "text"] | Param | None = None,
| float | Param | None = None,
r: ChannelSpec | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor | None = None,
styles: TextStyles **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale. Specifies the data to be binned horizontally.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale. Specifies the data to be binned vertically.
z
Channel | Param | None-
How to subdivide bins. Defaults to the fill channel, if any, or the stroke channel, if any. If null, bins will not be subdivided.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
bin_width
float | Param | None-
The distance between centers of neighboring hexagons, in pixels; defaults to 20.
type
Literal['hexagon', 'dot', 'text'] | Param | None-
The basic mark type to use for hex-binned values. Defaults to a hexagon mark; dot and text marks are also supported.
r
ChannelSpec | float | Param | None-
The radius of dots or hexagons; either a channel or constant.
rotate
ChannelSpec | float | Param | None-
The rotation angle in degrees clockwise.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
styles
TextStyles | None-
Text styles to apply when using text mark type.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
hexgrid
Create a hexgrid mark that displays a hexagonal grid overlay.
The hexgrid mark creates a hexagonal grid pattern, typically used as a background or reference grid for hexbin visualizations. This is a decoration mark that shows the underlying hexagonal structure without requiring data.
The hexgrid mark is designed to complement hexbin marks by showing the grid structure. It’s a stroke-only mark where fill is not supported.
def hexgrid(
float | Param | None = None,
bin_width: **options: Unpack[MarkOptions],
-> Mark )
bin_width
float | Param | None-
The distance between centers of neighboring hexagons, in pixels; defaults to 20. Should match the bin_width of any corresponding hexbin mark for proper alignment.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions. Note that this is a stroke-only mark, so fill options will not be effective.
waffle_x
A waffleX mark that creates horizontal waffle charts.
Waffle charts are a form of unit chart where data is represented as a grid of small squares or rectangles, useful for showing part-to-whole relationships and making proportions more tangible.
def waffle_x(
data: Data,| Param,
x: ChannelIntervalSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y: ChannelIntervalSpec | Param | None = None,
z: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
multiple: float | Param | None = None,
unit: float | Param | None = None,
gap: round: bool | Param | None = None,
| None = None,
interval: Interval "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelIntervalSpec | Param-
The horizontal position channel, typically bound to the x scale.
x1
ChannelSpec | Param | None-
The starting horizontal position channel, typically bound to the x scale.
x2
ChannelSpec | Param | None-
The ending horizontal position channel, typically bound to the x scale.
y
ChannelIntervalSpec | Param | None-
The vertical position channel, typically bound to the y scale.
z
ChannelSpec | Param | None-
The z channel defines the series of each value in the stack.
filter_by
Selection | None-
A selection to filter the data.
multiple
float | Param | None-
The number of units per tile; defaults to 1.
unit
float | Param | None-
The size of each unit in the waffle; defaults to 1.
gap
float | Param | None-
The gap between waffle units; defaults to 1.
round
bool | Param | None-
Whether to round values to the nearest unit; defaults to false.
interval
Interval | None-
How to convert a continuous value into an interval.
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
waffle_y
A waffleY mark that creates vertical waffle charts.
Waffle charts are a form of unit chart where data is represented as a grid of small squares or rectangles, useful for showing part-to-whole relationships and making proportions more tangible.
def waffle_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
x: ChannelSpec | Param | None = None,
z: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
multiple: float | Param | None = None,
unit: float | Param | None = None,
gap: round: bool | Param | None = None,
| None = None,
interval: Interval "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
y1
ChannelSpec | Param | None-
The starting vertical position channel, typically bound to the y scale.
y2
ChannelSpec | Param | None-
The ending vertical position channel, typically bound to the y scale.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
z
ChannelSpec | Param | None-
The z channel defines the series of each value in the stack.
filter_by
Selection | None-
A selection to filter the data.
multiple
float | Param | None-
The number of units per tile; defaults to 1.
unit
float | Param | None-
The size of each unit in the waffle; defaults to 1.
gap
float | Param | None-
The gap between waffle units; defaults to 1.
round
bool | Param | None-
Whether to round values to the nearest unit; defaults to false.
interval
Interval | None-
How to convert a continuous value into an interval.
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
Specialized
raster
Create a raster mark for spatial samples with optional interpolation and smoothing.
The raster mark bins spatial data into a raster grid and optionally applies spatial interpolation and kernel density smoothing. The raster mark is useful for visualizing continuous spatial phenomena from discrete sample points.
def raster(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | None = None,
filter_by: Selection float | Param | None = None,
width: float | Param | None = None,
height: float | Param | None = None,
pixel_size: float | Param | None = None,
pad: | Param | None = None,
interpolate: Interpolate float | Param | None = None,
bandwidth: str | Param | None = None,
image_rendering: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
width
float | Param | None-
The width (number of columns) of the grid, in actual pixels.
height
float | Param | None-
The height (number of rows) of the grid, in actual pixels.
pixel_size
float | Param | None-
The effective screen size of a raster pixel, used to determine the height and width of the raster from the frame’s dimensions; defaults to 1.
pad
float | Param | None-
The bin padding, one of 1 (default) to include extra padding for the final bin, or 0 to make the bins flush with the maximum domain value.
interpolate
Interpolate | Param | None-
The spatial interpolation method; one of: - none - do not perform interpolation (the default) - linear - apply proportional linear interpolation across adjacent bins - nearest - assign each pixel to the closest sample’s value (Voronoi diagram) - barycentric - apply barycentric interpolation over the Delaunay triangulation - random-walk - apply a random walk from each pixel
bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
image_rendering
str | Param | None-
The image-rendering attribute; defaults to auto (bilinear). May be set to pixelated to disable bilinear interpolation for a sharper image.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
raster_tile
Create an experimental raster tile mark with tiling and prefetching for scalable rasters.
The rasterTile mark is an experimental version of the raster mark that supports tiling and prefetching for better performance with large datasets. It provides scalable raster visualization with efficient memory usage.
def raster_tile(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | None = None,
filter_by: Selection list[float] | Param | None = None,
origin: float | Param | None = None,
width: float | Param | None = None,
height: float | Param | None = None,
pixel_size: float | Param | None = None,
pad: | Param | None = None,
interpolate: Interpolate float | Param | None = None,
bandwidth: str | Param | None = None,
image_rendering: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
origin
list[float] | Param | None-
The coordinates of the tile origin in the x and y data domains; defaults to [0, 0].
width
float | Param | None-
The width (number of columns) of the grid, in actual pixels.
height
float | Param | None-
The height (number of rows) of the grid, in actual pixels.
pixel_size
float | Param | None-
The effective screen size of a raster pixel, used to determine the height and width of the raster from the frame’s dimensions; defaults to 1.
pad
float | Param | None-
The bin padding, one of 1 (default) to include extra padding for the final bin, or 0 to make the bins flush with the maximum domain value.
interpolate
Interpolate | Param | None-
The spatial interpolation method; one of: - none - do not perform interpolation (the default) - linear - apply proportional linear interpolation across adjacent bins - nearest - assign each pixel to the closest sample’s value (Voronoi diagram) - barycentric - apply barycentric interpolation over the Delaunay triangulation - random-walk - apply a random walk from each pixel
bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
image_rendering
str | Param | None-
The image-rendering attribute; defaults to auto (bilinear). May be set to pixelated to disable bilinear interpolation for a sharper image.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
vector
A vector mark that draws arrows or other directional shapes.
Vectors are typically used to represent direction and magnitude in data, such as wind vectors, force fields, or gradients.
def vector(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
length: ChannelSpec | float | Param | None = None,
rotate: Channel "arrow", "spike"] | Param | None = None,
shape: Literal["start", "middle", "end"] | Param | None = None,
anchor: Literal[| Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
r
ChannelSpec | float | Param | None-
The radius or magnitude channel; either a constant or a channel.
filter_by
Selection | None-
A selection to filter the data.
length
ChannelSpec | float | Param | None-
The length of the vector; either a constant or a channel.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; either a constant or a channel.
shape
Literal['arrow', 'spike'] | Param | None-
The shape of the vector; one of “arrow” or “spike”.
anchor
Literal['start', 'middle', 'end'] | Param | None-
The anchor position; one of “start”, “middle”, or “end”.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
vector_x
A vectorX mark that draws horizontal directional vectors.
VectorX marks are oriented primarily along the x-axis and are useful for showing horizontal flow or direction.
def vector_x(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
length: ChannelSpec | float | Param | None = None,
rotate: Channel "arrow", "spike"] | Param | None = None,
shape: Literal["start", "middle", "end"] | Param | None = None,
anchor: Literal[| Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
r
ChannelSpec | float | Param | None-
The radius or magnitude channel; either a constant or a channel.
filter_by
Selection | None-
A selection to filter the data.
length
ChannelSpec | float | Param | None-
The length of the vector; either a constant or a channel.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; either a constant or a channel.
shape
Literal['arrow', 'spike'] | Param | None-
The shape of the vector; one of “arrow” or “spike”.
anchor
Literal['start', 'middle', 'end'] | Param | None-
The anchor position; one of “start”, “middle”, or “end”.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
vector_y
A vectorY mark that draws vertical directional vectors.
VectorY marks are oriented primarily along the y-axis and are useful for showing vertical flow or direction.
def vector_y(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
length: ChannelSpec | float | Param | None = None,
rotate: Channel "arrow", "spike"] | Param | None = None,
shape: Literal["start", "middle", "end"] | Param | None = None,
anchor: Literal[| Param | None = None,
frame_anchor: FrameAnchor **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
r
ChannelSpec | float | Param | None-
The radius or magnitude channel; either a constant or a channel.
filter_by
Selection | None-
A selection to filter the data.
length
ChannelSpec | float | Param | None-
The length of the vector; either a constant or a channel.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; either a constant or a channel.
shape
Literal['arrow', 'spike'] | Param | None-
The shape of the vector; one of “arrow” or “spike”.
anchor
Literal['start', 'middle', 'end'] | Param | None-
The anchor position; one of “start”, “middle”, or “end”.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
spike
A spike mark that draws spike-shaped directional indicators.
Spikes are a specialized type of vector that typically appear as thin lines or needles, useful for showing precise directional data or impulses.
def spike(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | float | Param | None = None,
r: ChannelSpec | float | Param | None = None,
length: ChannelSpec | float | Param | None = None,
rotate: Channel "arrow", "spike"] | Param | None = None,
shape: Literal["start", "middle", "end"] | Param | None = None,
anchor: Literal[| Param | None = None,
frame_anchor: FrameAnchor | None = None,
filter_by: Selection **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
r
ChannelSpec | float | Param | None-
The radius or magnitude channel; either a constant or a channel.
length
ChannelSpec | float | Param | None-
The length of the spike; either a constant or a channel.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; either a constant or a channel.
shape
Literal['arrow', 'spike'] | Param | None-
The shape of the spike; one of “arrow” or “spike”.
anchor
Literal['start', 'middle', 'end'] | Param | None-
The anchor position; one of “start”, “middle”, or “end”.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
filter_by
Selection | None-
A selection to filter the data.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
arrow
An arrow mark.
The arrow mark draws arrows between two points, with customizable arrowheads and curved paths. It is useful for indicating direction, flow, or relationships between data points.
def arrow(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y2: ChannelSpec | None = None,
filter_by: Selection float | bool | Param | None = None,
bend: float | Param | None = None,
head_angle: float | Param | None = None,
head_length: float | Param | None = None,
inset: float | Param | None = None,
inset_start: float | Param | None = None,
inset_end: float | Param | None = None,
sweep: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, shorthand for both x1 and x2.
y
ChannelSpec | Param | None-
The vertical position channel, shorthand for both y1 and y2.
x1
ChannelSpec | Param | None-
The starting horizontal position of the arrow.
y1
ChannelSpec | Param | None-
The starting vertical position of the arrow.
x2
ChannelSpec | Param | None-
The ending horizontal position of the arrow.
y2
ChannelSpec | Param | None-
The ending vertical position of the arrow.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
bend
float | bool | Param | None-
The angle between straight line and outgoing tangent (±90°, use True for 22.5°).
head_angle
float | Param | None-
How pointy the arrowhead is in degrees (0°-180°, defaults to 60°).
head_length
float | Param | None-
Size of arrowhead relative to stroke width.
inset
float | Param | None-
Shorthand for both inset_start and inset_end.
inset_start
float | Param | None-
Starting inset in pixels (defaults to 0).
inset_end
float | Param | None-
Ending inset in pixels (defaults to 0).
sweep
float | Param | None-
Sweep order (1=clockwise, -1=anticlockwise, 0=no bend).
**options
Unpack[MarkOptions]-
Additional MarkOptions.
link
Create a link mark that draws line segments between pairs of points.
The link mark connects pairs of points with line segments. It supports both simple positioning using x and y (which serve as shorthand for x1/x2 and y1/y2), and explicit positioning using x1/y1 and x2/y2 coordinates for full control over link endpoints.
For vertical links, specify x (or x1 and x2) for the horizontal position and y1 and y2 for the vertical endpoints. For horizontal links, specify y (or y1 and y2) for the vertical position and x1 and x2 for the horizontal endpoints.
def link(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y2: ChannelSpec | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position for vertical links; shorthand for x1 and x2.
y
ChannelSpec | Param | None-
The vertical position for horizontal links; shorthand for y1 and y2.
x1
ChannelSpec | Param | None-
The starting horizontal position; also sets default for x2.
y1
ChannelSpec | Param | None-
The starting vertical position; also sets default for y2.
x2
ChannelSpec | Param | None-
The ending horizontal position; also sets default for x1.
y2
ChannelSpec | Param | None-
The ending vertical position; also sets default for y1.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve interpolation method for connecting adjacent points. Recommended for links: linear, step, step-after, step-before, bump-x, bump-y.
tension
float | Param | None-
The tension option only has an effect on bundle, cardinal and Catmull–Rom splines.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
delaunay_link
Create a Delaunay link mark that draws links for each edge of the Delaunay triangulation.
The delaunayLink mark computes the Delaunay triangulation of the data and draws a line segment for each edge of the triangulation. This is useful for visualizing spatial relationships and adjacencies in scattered point data.
def delaunay_link(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping to produce multiple (possibly overlapping) triangulations.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve interpolation method; defaults to linear.
tension
float | Param | None-
The tension option only has an effect on bundle, cardinal and Catmull–Rom splines.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
delaunay_mesh
Create a Delaunay mesh mark that draws a mesh of the Delaunay triangulation.
The delaunayMesh mark computes the Delaunay triangulation of the data and draws filled triangular polygons for each triangle in the triangulation. This creates a continuous mesh surface useful for spatial interpolation and surface visualization.
def delaunay_mesh(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping to produce multiple (possibly overlapping) triangulations.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve interpolation method; defaults to linear.
tension
float | Param | None-
The tension option only has an effect on bundle, cardinal and Catmull–Rom splines.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
voronoi
Create a Voronoi mark that draws polygons for each cell of the Voronoi tessellation.
The voronoi mark computes the Voronoi tessellation (also known as Thiessen polygons) of the data points and draws filled polygons for each cell. Each cell contains all points that are closer to the cell’s generator point than to any other generator.
def voronoi(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping to produce multiple tessellations.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve interpolation method; defaults to linear.
tension
float | Param | None-
The tension option only has an effect on bundle, cardinal and Catmull–Rom splines.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
voronoi_mesh
Create a Voronoi mesh mark that draws a mesh for the cell boundaries of the Voronoi tessellation.
The voronoiMesh mark computes the Voronoi tessellation of the data points and draws line segments for the boundaries between cells. This creates a mesh of cell edges useful for visualizing the spatial partitioning without filled polygons.
def voronoi_mesh(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping to produce multiple tessellations.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve interpolation method; defaults to linear.
tension
float | Param | None-
The tension option only has an effect on bundle, cardinal and Catmull–Rom splines.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
hull
Create a hull mark that draws a convex hull around points.
The hull mark computes the convex hull of the data points and draws a polygon representing the smallest convex shape that contains all the points. This is useful for showing the overall extent or boundary of a point cloud.
def hull(
data: Data,| Param,
x: ChannelSpec | Param,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker | Param | None = None,
curve: Curve float | Param | None = None,
tension: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping to produce multiple hulls; defaults to fill or stroke channel if not specified.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
marker
Marker | bool | Param | None-
Shorthand to set the same default for marker_start, marker_mid, and marker_end.
marker_start
Marker | bool | Param | None-
The marker for the starting point of a line segment.
marker_mid
Marker | bool | Param | None-
The marker for any middle (interior) points of a line segment.
marker_end
Marker | bool | Param | None-
The marker for the ending point of a line segment.
curve
Curve | Param | None-
The curve interpolation method; defaults to linear.
tension
float | Param | None-
The tension option only has an effect on bundle, cardinal and Catmull–Rom splines.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
dense_line
Create a dense line mark that plots line densities rather than point densities.
The denseLine mark forms a binned raster grid and “draws” straight lines into it, creating a density visualization of line segments rather than individual points. This is useful for visualizing the density of linear features, trajectories, or paths in spatial data.
The mark bins the data into a 2D grid and renders density values as a raster image. Unlike traditional line marks that use curve interpolation, dense lines operate on a pixel grid to accumulate line density information.
def dense_line(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection float | Param | None = None,
bandwidth: bool | Param | None = None,
normalize: | Param | None = None,
interpolate: Interpolate float | Param | None = None,
width: float | Param | None = None,
height: float | Param | None = None,
pixel_size: float | Param | None = None,
pad: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
z
Channel | Param | None-
An ordinal channel for grouping data into series to be drawn as separate lines.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
bandwidth
float | Param | None-
The kernel density bandwidth for smoothing, in pixels.
normalize
bool | Param | None-
Flag to perform approximate arc length normalization of line segments to prevent artifacts due to overcounting steep lines; defaults to True.
interpolate
Interpolate | Param | None-
The spatial interpolation method; one of: - none - do not perform interpolation (the default) - linear - apply proportional linear interpolation across adjacent bins - nearest - assign each pixel to the closest sample’s value (Voronoi diagram) - barycentric - apply barycentric interpolation over the Delaunay triangulation - random-walk - apply a random walk from each pixel
width
float | Param | None-
The width (number of columns) of the grid, in actual pixels.
height
float | Param | None-
The height (number of rows) of the grid, in actual pixels.
pixel_size
float | Param | None-
The effective screen size of a raster pixel, used to determine the height and width of the raster from the frame’s dimensions; defaults to 1.
pad
float | Param | None-
The bin padding, one of 1 (default) to include extra padding for the final bin, or 0 to make the bins flush with the maximum domain value.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions. Note that fill and fillOpacity can use the special value “density” to map computed density values to visual properties.
Decoration
frame
Create a frame mark that draws a rectangular outline around the plot area.
The frame mark draws a rectangular border around the plot’s frame area. By default, it draws a complete rectangular outline, but when an anchor is specified, it draws only a line on the given side (ignoring rx, ry, fill, and fillOpacity).
The frame mark is commonly used for visual separation of facets, providing backgrounds for plot areas, or creating borders around visualizations.
def frame(
"top", "right", "bottom", "left"] | Param | None = None,
anchor: Literal[float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: str | float | Param | None = None,
rx: str | float | Param | None = None,
ry: **options: Unpack[MarkOptions],
-> Mark )
anchor
Literal['top', 'right', 'bottom', 'left'] | Param | None-
Controls how the frame is drawn. If null (default), draws a complete rectangular outline. If specified, draws a line only on the given side (top, right, bottom, or left), ignoring rx, ry, fill, and fillOpacity.
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels. A positive value insets towards the bottom edge (reducing effective area), while a negative value insets away from the bottom edge (increasing it).
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels. A positive value insets towards the left edge (reducing effective area), while a negative value insets away from the left edge (increasing it).
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels. A positive value insets towards the top edge (reducing effective area), while a negative value insets away from the top edge (increasing it).
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels. A positive value insets towards the right edge (reducing effective area), while a negative value insets away from the right edge (increasing it).
rx
str | float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the frame width. If rx is not specified, it defaults to ry if present, and otherwise draws square corners.
ry
str | float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the frame height. If ry is not specified, it defaults to rx if present, and otherwise draws square corners.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
axis_x
A horizontal axis mark.
The axisX mark draws a horizontal axis at the bottom or top of the plot (or both). It is primarily used for displaying scales and reference lines along the x-axis.
def axis_x(
| Param | None = None,
x: ChannelSpec | None = None,
interval: Interval | Param | None = None,
text: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor str | Param | None = None,
line_anchor: | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
text_stroke: ChannelSpec | float | Param | None = None,
text_stroke_opacity: ChannelSpec | float | Param | None = None,
text_stroke_width: ChannelSpec | None = None,
styles: TextStyles str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: float | Param | None = None,
tick_size: float | Param | None = None,
tick_padding: str | Param | None = None,
tick_format: float | Param | None = None,
tick_rotate: str | Param | None = None,
label: float | Param | None = None,
label_offset: str | Param | None = None,
label_anchor: str | bool | Param | None = None,
label_arrow: **options: Unpack[MarkOptions],
-> Mark )
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
interval
Interval | None-
How to convert a continuous value into an interval.
text
ChannelSpec | Param | None-
The text channel for tick labels.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame.
line_anchor
str | Param | None-
The line anchor controls how text is aligned relative to its anchor point.
rotate
ChannelSpec | float | Param | None-
The rotation angle of the axis in degrees clockwise.
text_stroke
ChannelSpec | Param | None-
The stroke color for text labels.
text_stroke_opacity
ChannelSpec | float | Param | None-
The stroke opacity for text labels.
text_stroke_width
ChannelSpec | float | Param | None-
The stroke width for text labels.
styles
TextStyles | None-
TextStyles to apply to axis text.
anchor
str | Param | None-
The side of the frame on which to place the axis (top or bottom).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
tick_size
float | Param | None-
The length of tick marks in pixels.
tick_padding
float | Param | None-
The distance between the tick mark and its label in pixels.
tick_format
str | Param | None-
A d3-format string for formatting tick labels.
tick_rotate
float | Param | None-
The rotation angle of tick labels in degrees clockwise.
label
str | Param | None-
The axis label text.
label_offset
float | Param | None-
The distance between the axis and its label in pixels.
label_anchor
str | Param | None-
The label anchor position.
label_arrow
str | bool | Param | None-
Whether to show an arrow on the axis label.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
axis_y
A vertical axis mark.
The axisY mark draws a vertical axis at the left or right of the plot (or both). It is primarily used for displaying scales and reference lines along the y-axis.
def axis_y(
| Param | None = None,
y: ChannelSpec | None = None,
interval: Interval | Param | None = None,
text: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor str | Param | None = None,
line_anchor: | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
text_stroke: ChannelSpec | float | Param | None = None,
text_stroke_opacity: ChannelSpec | float | Param | None = None,
text_stroke_width: ChannelSpec | None = None,
styles: TextStyles str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: float | Param | None = None,
tick_size: float | Param | None = None,
tick_padding: str | Param | None = None,
tick_format: float | Param | None = None,
tick_rotate: str | Param | None = None,
label: float | Param | None = None,
label_offset: str | Param | None = None,
label_anchor: str | bool | Param | None = None,
label_arrow: **options: Unpack[MarkOptions],
-> Mark )
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
interval
Interval | None-
How to convert a continuous value into an interval.
text
ChannelSpec | Param | None-
The text channel for tick labels.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame.
line_anchor
str | Param | None-
The line anchor controls how text is aligned relative to its anchor point.
rotate
ChannelSpec | float | Param | None-
The rotation angle of the axis in degrees clockwise.
text_stroke
ChannelSpec | Param | None-
The stroke color for text labels.
text_stroke_opacity
ChannelSpec | float | Param | None-
The stroke opacity for text labels.
text_stroke_width
ChannelSpec | float | Param | None-
The stroke width for text labels.
styles
TextStyles | None-
TextStyles to apply to axis text.
anchor
str | Param | None-
The side of the frame on which to place the axis (left or right).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
tick_size
float | Param | None-
The length of tick marks in pixels.
tick_padding
float | Param | None-
The distance between the tick mark and its label in pixels.
tick_format
str | Param | None-
A d3-format string for formatting tick labels.
tick_rotate
float | Param | None-
The rotation angle of tick labels in degrees clockwise.
label
str | Param | None-
The axis label text.
label_offset
float | Param | None-
The distance between the axis and its label in pixels.
label_anchor
str | Param | None-
The label anchor position.
label_arrow
str | bool | Param | None-
Whether to show an arrow on the axis label.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
axis_fx
A horizontal facet axis mark.
The axisFx mark draws a horizontal axis for faceted plots. It is primarily used for displaying scales and reference lines along the fx-axis in faceted visualizations.
def axis_fx(
| Param | None = None,
x: ChannelSpec | None = None,
interval: Interval | Param | None = None,
text: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor str | Param | None = None,
line_anchor: | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
text_stroke: ChannelSpec | float | Param | None = None,
text_stroke_opacity: ChannelSpec | float | Param | None = None,
text_stroke_width: ChannelSpec | None = None,
styles: TextStyles str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: float | Param | None = None,
tick_size: float | Param | None = None,
tick_padding: str | Param | None = None,
tick_format: float | Param | None = None,
tick_rotate: str | Param | None = None,
label: float | Param | None = None,
label_offset: str | Param | None = None,
label_anchor: str | bool | Param | None = None,
label_arrow: **options: Unpack[MarkOptions],
-> Mark )
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
interval
Interval | None-
How to convert a continuous value into an interval.
text
ChannelSpec | Param | None-
The text channel for tick labels.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame.
line_anchor
str | Param | None-
The line anchor controls how text is aligned relative to its anchor point.
rotate
ChannelSpec | float | Param | None-
The rotation angle of the axis in degrees clockwise.
text_stroke
ChannelSpec | Param | None-
The stroke color for text labels.
text_stroke_opacity
ChannelSpec | float | Param | None-
The stroke opacity for text labels.
text_stroke_width
ChannelSpec | float | Param | None-
The stroke width for text labels.
styles
TextStyles | None-
TextStyles to apply to axis text.
anchor
str | Param | None-
The side of the frame on which to place the axis (top or bottom).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
tick_size
float | Param | None-
The length of tick marks in pixels.
tick_padding
float | Param | None-
The distance between the tick mark and its label in pixels.
tick_format
str | Param | None-
A d3-format string for formatting tick labels.
tick_rotate
float | Param | None-
The rotation angle of tick labels in degrees clockwise.
label
str | Param | None-
The axis label text.
label_offset
float | Param | None-
The distance between the axis and its label in pixels.
label_anchor
str | Param | None-
The label anchor position.
label_arrow
str | bool | Param | None-
Whether to show an arrow on the axis label.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
axis_fy
A vertical facet axis mark.
The axisFy mark draws a vertical axis for faceted plots. It is primarily used for displaying scales and reference lines along the fy-axis in faceted visualizations.
def axis_fy(
| Param | None = None,
y: ChannelSpec | None = None,
interval: Interval | Param | None = None,
text: ChannelSpec | Param | None = None,
frame_anchor: FrameAnchor str | Param | None = None,
line_anchor: | float | Param | None = None,
rotate: ChannelSpec | Param | None = None,
text_stroke: ChannelSpec | float | Param | None = None,
text_stroke_opacity: ChannelSpec | float | Param | None = None,
text_stroke_width: ChannelSpec | None = None,
styles: TextStyles str | Param | None = None,
anchor: | str | Param | None = None,
color: ChannelSpec int | Sequence[Any] | Param | None = None,
ticks: float | Param | None = None,
tick_spacing: float | Param | None = None,
tick_size: float | Param | None = None,
tick_padding: str | Param | None = None,
tick_format: float | Param | None = None,
tick_rotate: str | Param | None = None,
label: float | Param | None = None,
label_offset: str | Param | None = None,
label_anchor: str | bool | Param | None = None,
label_arrow: **options: Unpack[MarkOptions],
-> Mark )
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
interval
Interval | None-
How to convert a continuous value into an interval.
text
ChannelSpec | Param | None-
The text channel for tick labels.
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y based on the plot’s frame.
line_anchor
str | Param | None-
The line anchor controls how text is aligned relative to its anchor point.
rotate
ChannelSpec | float | Param | None-
The rotation angle of the axis in degrees clockwise.
text_stroke
ChannelSpec | Param | None-
The stroke color for text labels.
text_stroke_opacity
ChannelSpec | float | Param | None-
The stroke opacity for text labels.
text_stroke_width
ChannelSpec | float | Param | None-
The stroke width for text labels.
styles
TextStyles | None-
TextStyles to apply to axis text.
anchor
str | Param | None-
The side of the frame on which to place the axis (left or right).
color
ChannelSpec | str | Param | None-
Shorthand for setting both fill and stroke color.
ticks
int | Sequence[Any] | Param | None-
The desired number of ticks, or an array of tick values, or null to disable ticks.
tick_spacing
float | Param | None-
The desired spacing between ticks in pixels.
tick_size
float | Param | None-
The length of tick marks in pixels.
tick_padding
float | Param | None-
The distance between the tick mark and its label in pixels.
tick_format
str | Param | None-
A d3-format string for formatting tick labels.
tick_rotate
float | Param | None-
The rotation angle of tick labels in degrees clockwise.
label
str | Param | None-
The axis label text.
label_offset
float | Param | None-
The distance between the axis and its label in pixels.
label_anchor
str | Param | None-
The label anchor position.
label_arrow
str | bool | Param | None-
Whether to show an arrow on the axis label.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
rule_x
A ruleX mark that draws horizontal rule lines.
RuleX marks are horizontal lines that span the full extent of the plot area, typically used for reference lines, grid lines, or highlighting specific values.
def rule_x(
data: Data,| Param,
x: ChannelSpec | Param | None = None,
y: ChannelIntervalSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | None = None,
filter_by: Selection | None = None,
interval: Interval | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker float | Param | None = None,
inset: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelIntervalSpec | Param | None-
The vertical position channel, typically bound to the y scale.
y1
ChannelSpec | Param | None-
The primary (starting, often bottom) vertical position of the tick; a channel bound to the y scale.
y2
ChannelSpec | Param | None-
The secondary (ending, often top) vertical position of the tick; a channel bound to the y scale.
filter_by
Selection | None-
A selection to filter the data.
interval
Interval | None-
How to convert a continuous value into an interval.
marker
Marker | bool | Param | None-
The marker symbol to use at all positions along the rule.
marker_start
Marker | bool | Param | None-
The marker symbol to use at the start of the rule.
marker_mid
Marker | bool | Param | None-
The marker symbol to use at the middle of the rule.
marker_end
Marker | bool | Param | None-
The marker symbol to use at the end of the rule.
inset
float | Param | None-
Set top and bottom insets.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
rule_y
A ruleY mark that draws vertical rule lines.
RuleY marks are vertical lines that span the full extent of the plot area, typically used for reference lines, grid lines, or highlighting specific values.
def rule_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
x: ChannelIntervalSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | None = None,
filter_by: Selection | None = None,
interval: Interval | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker float | Param | None = None,
inset: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
x
ChannelIntervalSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
x1
ChannelSpec | Param | None-
The primary (starting, often left) horizontal position of the tick; a channel bound to the x scale.
x2
ChannelSpec | Param | None-
The secondary (ending, often right) horizontal position of the tick; a channel bound to the x scale.
filter_by
Selection | None-
A selection to filter the data.
interval
Interval | None-
How to convert a continuous value into an interval.
marker
Marker | bool | Param | None-
The marker symbol to use at all positions along the rule.
marker_start
Marker | bool | Param | None-
The marker symbol to use at the start of the rule.
marker_mid
Marker | bool | Param | None-
The marker symbol to use at the middle of the rule.
marker_end
Marker | bool | Param | None-
The marker symbol to use at the end of the rule.
inset
float | Param | None-
Set left and right insets.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
tick_x
A tickX mark that draws horizontal tick marks.
TickX marks are horizontal lines typically used for marking positions along the x-axis or creating horizontal reference lines.
def tick_x(
data: Data,| Param,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_bottom: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
filter_by
Selection | None-
A selection to filter the data.
marker
Marker | bool | Param | None-
The marker symbol to use at all positions along the tick.
marker_start
Marker | bool | Param | None-
The marker symbol to use at the start of the tick.
marker_mid
Marker | bool | Param | None-
The marker symbol to use at the middle of the tick.
marker_end
Marker | bool | Param | None-
The marker symbol to use at the end of the tick.
inset
float | Param | None-
Shorthand to set the same default for top and bottom insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
tick_y
A tickY mark that draws vertical tick marks.
TickY marks are vertical lines typically used for marking positions along the y-axis or creating vertical reference lines.
def tick_y(
data: Data,| Param,
y: ChannelSpec | Param | None = None,
x: ChannelSpec | None = None,
filter_by: Selection | bool | Param | None = None,
marker: Marker | bool | Param | None = None,
marker_start: Marker | bool | Param | None = None,
marker_mid: Marker | bool | Param | None = None,
marker_end: Marker float | Param | None = None,
inset: float | Param | None = None,
inset_left: float | Param | None = None,
inset_right: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position channel, typically bound to the y scale.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
filter_by
Selection | None-
A selection to filter the data.
marker
Marker | bool | Param | None-
The marker symbol to use at all positions along the tick.
marker_start
Marker | bool | Param | None-
The marker symbol to use at the start of the tick.
marker_mid
Marker | bool | Param | None-
The marker symbol to use at the middle of the tick.
marker_end
Marker | bool | Param | None-
The marker symbol to use at the end of the tick.
inset
float | Param | None-
Shorthand to set the same default for left and right insets.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
rect
A rect mark that draws axis-aligned rectangles.
Both x and y should be quantitative or temporal; rect does not perform grouping, so use rectX or rectY for ordinal data.
def rect(
data: Data,| Param | None = None,
x: ChannelIntervalSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y: ChannelIntervalSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | None = None,
interval: Interval float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
**options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelIntervalSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
x1
ChannelSpec | Param | None-
The starting horizontal position channel, typically bound to the x scale.
x2
ChannelSpec | Param | None-
The ending horizontal position channel, typically bound to the x scale.
y
ChannelIntervalSpec | Param | None-
The vertical position channel, typically bound to the y scale.
y1
ChannelSpec | Param | None-
The starting vertical position channel, typically bound to the y scale.
y2
ChannelSpec | Param | None-
The ending vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
The z channel defines the series of each value in the stack
filter_by
Selection | None-
A selection to filter the data.
interval
Interval | None-
How to convert a continuous value into an interval; one of: - a named time interval such as day (for date intervals) - a number (for number intervals), defining intervals at integer multiples of n
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the rect width.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the rect height.
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of: - null (default) for input order - a named stack order method such as inside-out or sum - a field name, for natural order of the corresponding values - a function of data, for natural order of the corresponding values - an array of explicit z values in the desired order.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
rect_x
A rectX mark that draws axis-aligned rectangles.
The x values should be quantitative or temporal, and the optional y values should be ordinal.
def rect_x(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y: ChannelIntervalSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | None = None,
interval: Interval float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
**options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
x1
ChannelSpec | Param | None-
The starting horizontal position channel, typically bound to the x scale.
x2
ChannelSpec | Param | None-
The ending horizontal position channel, typically bound to the x scale.
y
ChannelIntervalSpec | Param | None-
The vertical position channel, typically bound to the y scale.
y1
ChannelSpec | Param | None-
The starting vertical position channel, typically bound to the y scale.
y2
ChannelSpec | Param | None-
The ending vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
The z channel defines the series of each value in the stack.
filter_by
Selection | None-
A selection to filter the data.
interval
Interval | None-
How to convert a continuous value into an interval; one of: - a named time interval such as day (for date intervals) - a number (for number intervals), defining intervals at integer multiples of n
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the rect width.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the rect height.
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of: - null (default) for input order - a named stack order method such as inside-out or sum - a field name, for natural order of the corresponding values - a function of data, for natural order of the corresponding values - an array of explicit z values in the desired order
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
rect_y
A rectY mark that draws axis-aligned rectangles.
The y values should be quantitative or temporal, and the optional x values should be ordinal.
def rect_y(
data: Data,| Param | None = None,
x: ChannelIntervalSpec | Param | None = None,
x1: ChannelSpec | Param | None = None,
x2: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
y1: ChannelSpec | Param | None = None,
y2: ChannelSpec | Param | None = None,
z: Channel | None = None,
filter_by: Selection | None = None,
interval: Interval float | Param | None = None,
inset: float | Param | None = None,
inset_top: float | Param | None = None,
inset_right: float | Param | None = None,
inset_bottom: float | Param | None = None,
inset_left: float | Param | None = None,
rx: float | Param | None = None,
ry: "center", "normalize", "wiggle"] | Param | None = None,
offset: Literal["value", "x", "y", "z", "sum", "appearance", "inside-out"]
order: Literal[| str
| Sequence[float | bool]
| Param
| None = None,
**options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelIntervalSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
x1
ChannelSpec | Param | None-
The starting horizontal position channel, typically bound to the x scale.
x2
ChannelSpec | Param | None-
The ending horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
y1
ChannelSpec | Param | None-
The starting vertical position channel, typically bound to the y scale.
y2
ChannelSpec | Param | None-
The ending vertical position channel, typically bound to the y scale.
z
Channel | Param | None-
The z channel defines the series of each value in the stack.
filter_by
Selection | None-
A selection to filter the data.
interval
Interval | None-
How to convert a continuous value into an interval; one of: - a named time interval such as day (for date intervals) - a number (for number intervals), defining intervals at integer multiples of n
inset
float | Param | None-
Shorthand to set the same default for all four insets.
inset_top
float | Param | None-
Insets the top edge by the specified number of pixels.
inset_right
float | Param | None-
Insets the right edge by the specified number of pixels.
inset_bottom
float | Param | None-
Insets the bottom edge by the specified number of pixels.
inset_left
float | Param | None-
Insets the left edge by the specified number of pixels.
rx
float | Param | None-
The rounded corner x-radius, either in pixels or as a percentage of the rect width.
ry
float | Param | None-
The rounded corner y-radius, either in pixels or as a percentage of the rect height.
offset
Literal['center', 'normalize', 'wiggle'] | Param | None-
After stacking, an optional offset can be applied to translate and scale stacks.
order
Literal['value', 'x', 'y', 'z', 'sum', 'appearance', 'inside-out'] | str | Sequence[float | bool] | Param | None-
The order in which stacks are layered; one of: - null (default) for input order - a named stack order method such as inside-out or sum - a field name, for natural order of the corresponding values - a function of data, for natural order of the corresponding values - an array of explicit z values in the desired order
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
text
A text mark that displays textual labels.
def text(
| None,
data: Data | Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | Param | None = None,
z: Channel | Param | None = None,
text: Channel | None = None,
filter_by: Selection | Param | None = None,
frame_anchor: FrameAnchor | Param | None = None,
line_anchor: LineAnchor | float | Param | None = None,
rotate: Channel | None = None,
styles: TextStyles **options: Unpack[MarkOptions],
-> Mark )
data
Data | None-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel specifying the text’s anchor point, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel specifying the text’s anchor point, typically bound to the y scale.
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
text
Channel | Param | None-
The text contents channel, possibly with line breaks (, , or . If not specified, defaults to the zero-based index [0, 1, 2, …].
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y, along with textAnchor and lineAnchor, based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
line_anchor
LineAnchor | Param | None-
The line anchor controls how text is aligned (typically vertically) relative to its anchor point; it is one of top, bottom, or middle. If the frame anchor is top, top-left, or top-right, the default line anchor is top; if the frame anchor is bottom, bottom-right, or bottom-left, the default is bottom; otherwise it is middle.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; a constant or a channel; defaults to 0°. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel.
styles
TextStyles | None-
TextStyles to apply.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
text_x
A horizontal text mark that displays textual labels.
Like text, except that y defaults to the zero-based index of the data [0, 1, 2, …].
If an interval is specified, such as day, y is transformed to the middle of the interval.
def text_x(
| None,
data: Data | Param,
x: ChannelSpec | Param | None = None,
y: ChannelIntervalSpec | Param | None = None,
z: Channel | Param | None = None,
text: Channel | Param | None = None,
interval: Interval | None = None,
filter_by: Selection | Param | None = None,
frame_anchor: FrameAnchor | Param | None = None,
line_anchor: LineAnchor | float | Param | None = None,
rotate: Channel | None = None,
styles: TextStyles **options: Unpack[MarkOptions],
-> Mark )
data
Data | None-
The data source for the mark.
x
ChannelSpec | Param-
The horizontal position channel specifying the text’s anchor point, typically bound to the x scale.
y
ChannelIntervalSpec | Param | None-
The vertical position channel specifying the text’s anchor point, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
text
Channel | Param | None-
The text contents channel, possibly with line breaks (, , or . If not specified, defaults to the zero-based index [0, 1, 2, …].
interval
Interval | Param | None-
An interval (such as day or a number), to transform y values to the middle of the interval.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y, along with textAnchor and lineAnchor, based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
line_anchor
LineAnchor | Param | None-
The line anchor controls how text is aligned (typically vertically) relative to its anchor point; it is one of top, bottom, or middle. If the frame anchor is top, top-left, or top-right, the default line anchor is top; if the frame anchor is bottom, bottom-right, or bottom-left, the default is bottom; otherwise it is middle.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; a constant or a channel; defaults to 0°. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel.
styles
TextStyles | None-
TextStyles to apply.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
text_y
A vertical text mark that displays textual labels.
Like text, except that x defaults to the zero-based index of the data [0, 1, 2, …].
If an interval is specified, such as day, x is transformed to the middle of the interval.
def text_y(
| None,
data: Data | Param,
y: ChannelSpec | Param | None = None,
x: ChannelIntervalSpec | Param | None = None,
z: Channel | Param | None = None,
text: Channel | Param | None = None,
interval: Interval | None = None,
filter_by: Selection | Param | None = None,
frame_anchor: FrameAnchor | Param | None = None,
line_anchor: LineAnchor | float | Param | None = None,
rotate: Channel | None = None,
styles: TextStyles **options: Unpack[MarkOptions],
-> Mark )
data
Data | None-
The data source for the mark.
y
ChannelSpec | Param-
The vertical position channel specifying the text’s anchor point, typically bound to the y scale.
x
ChannelIntervalSpec | Param | None-
The horizontal position channel specifying the text’s anchor point, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].
z
Channel | Param | None-
An optional ordinal channel for grouping data into series.
text
Channel | Param | None-
The text contents channel, possibly with line breaks (, , or . If not specified, defaults to the zero-based index [0, 1, 2, …].
interval
Interval | Param | None-
An interval (such as day or a number), to transform x values to the middle of the interval.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
frame_anchor
FrameAnchor | Param | None-
The frame anchor specifies defaults for x and y, along with textAnchor and lineAnchor, based on the plot’s frame; it may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
line_anchor
LineAnchor | Param | None-
The line anchor controls how text is aligned (typically vertically) relative to its anchor point; it is one of top, bottom, or middle. If the frame anchor is top, top-left, or top-right, the default line anchor is top; if the frame anchor is bottom, bottom-right, or bottom-left, the default is bottom; otherwise it is middle.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise; a constant or a channel; defaults to 0°. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel.
styles
TextStyles | None-
TextStyles to apply.
**options
Unpack[MarkOptions]-
Additional MarkOptions.
image
Create an image mark for displaying images in visualizations.
The image mark displays raster images (PNG, JPEG, etc.) at specified positions and sizes. Images can be positioned using x/y coordinates, sized with width/height, and styled with various options including aspect ratio preservation and rendering modes.
This mark is useful for: - Adding logos, icons, or other imagery to visualizations - Creating image-based scatter plots or dashboards - Displaying photographs or other raster content within plots
def image(
data: Data,| Param | None = None,
x: ChannelSpec | Param | None = None,
y: ChannelSpec | None = None,
filter_by: Selection | float | Param | None = None,
width: Channel | float | Param | None = None,
height: Channel | float | Param | None = None,
r: Channel | float | Param | None = None,
rotate: Channel | str | Param | None = None,
src: Channel str | Param | None = None,
preserve_aspect_ratio: str | Param | None = None,
cross_origin: | Param | None = None,
frame_anchor: FrameAnchor str | Param | None = None,
image_rendering: **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
x
ChannelSpec | Param | None-
The horizontal position channel, typically bound to the x scale.
y
ChannelSpec | Param | None-
The vertical position channel, typically bound to the y scale.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
width
Channel | float | Param | None-
The image width in pixels. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 16 if neither width nor height are set.
height
Channel | float | Param | None-
The image height in pixels. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel. Defaults to 16 if neither width nor height are set.
r
Channel | float | Param | None-
The image clip radius for circular images. If null (default), images are not clipped; when a number, it is interpreted as a constant in pixels; otherwise it is interpreted as a channel.
rotate
Channel | float | Param | None-
The rotation angle in degrees clockwise.
src
Channel | str | Param | None-
The required image URL (or relative path). If a string that starts with a dot, slash, or URL protocol it is assumed to be a constant; otherwise it is interpreted as a channel.
preserve_aspect_ratio
str | Param | None-
The image aspect ratio; defaults to “xMidYMid meet”. To crop the image instead of scaling it to fit, use “xMidYMid slice”.
cross_origin
str | Param | None-
The cross-origin behavior for loading images from external domains.
frame_anchor
FrameAnchor | Param | None-
The frame anchor position for legend placement.
image_rendering
str | Param | None-
The image-rendering attribute; defaults to “auto” (bilinear). May be set to “pixelated” to disable bilinear interpolation for a sharper image.
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions.
Geographic
geo
Create a geo mark for rendering geographic data.
The geo mark renders geographic data, typically GeoJSON objects, with support for map projections and geographic styling. It’s designed for displaying geographic features like countries, states, cities, or any spatial geometry.
def geo(
data: Data,| Param | None = None,
geometry: Channel | float | Param | None = None,
r: ChannelSpec | None = None,
filter_by: Selection **options: Unpack[MarkOptions],
-> Mark )
data
Data-
The data source for the mark.
geometry
Channel | Param | None-
A channel for the geometry to render; defaults to identity, assuming data is a GeoJSON object or iterable of GeoJSON objects. Supports various geographic data types and transformations.
r
ChannelSpec | float | Param | None-
The radius channel for point geometries, typically bound to the radius scale.
filter_by
Selection | None-
Selection to filter by (defaults to data source selection).
**options
Unpack[MarkOptions]-
Additional mark options from MarkOptions. Note that clip can be set to “sphere” for projection-aware clipping when using spherical projections.
graticule
Create a graticule mark that renders a global coordinate grid.
The graticule mark renders a 10° global graticule (coordinate grid) showing lines of longitude and latitude. This provides a reference grid for geographic visualizations and helps users understand the projection and scale.
This mark is particularly useful for: - Adding coordinate reference lines to world maps - Showing distortion in map projections - Providing spatial reference for geographic data
def graticule(
**options: Unpack[MarkOptions],
-> Mark )
**options
Unpack[MarkOptions]-
Options from MarkOptions. Note that this mark is designed for use with spherical projections only.
sphere
Create a sphere mark that renders the outline of the projection sphere.
The sphere mark renders the outline of the sphere on the projection’s plane. This is typically used with spherical projections to show the boundary of the projected world. The sphere mark automatically generates the appropriate geometry for the current projection.
This mark is particularly useful for: - Adding a border around world maps with spherical projections - Showing the extent of the projection - Creating a background for geographic visualizations
def sphere(
**options: Unpack[MarkOptions],
-> Mark )
**options
Unpack[MarkOptions]-
Options from MarkOptions. Note that this mark is designed for use with spherical projections only.
Types
Mark
Plot mark (create marks using mark functions, e.g. dot(), bar_x(), etc.).
class Mark(Component)
MarkOptions
Shared options for all marks.
class MarkOptions(TypedDict, total=False)
Attributes
filter
Channel-
Applies a transform to filter the mark’s index according to the given channel values; only truthy values are retained.
select
Literal['first', 'last', 'maxX', 'maxY', 'minX', 'minY', 'nearest', 'nearestX', 'nearestY']-
Applies a filter transform after data is loaded to highlight selected values only. For example,
first
andlast
select the first or last values of series only (using the z channel to separate series). Meanwhile,nearestX
andnearestY
select the point nearest to the pointer along the x or y channel dimension. Unlike Mosaic selections, a mark level select is internal to the mark only, and does not populate a param or selection value to be shared across clients. reverse
bool | Param-
Applies a transform to reverse the order of the mark’s index, say for reverse input order.
sort
SortOrder-
Sort order for a plot mark’s index.
fx
Channel-
The horizontal facet position channel, for mark-level faceting, bound to the fx scale
fy
Channel-
The vertical facet position channel, for mark-level faceting, bound to the fy scale.
facet
Literal['auto', 'include', 'exclude', 'super'] | bool | None | Param-
Whether to enable or disable faceting.
- auto (default) - automatically determine if this mark should be faceted
- include (or
True
) - draw the subset of the mark’s data in the current facet - exclude - draw the subset of the mark’s data not in the current facet
- super - draw this mark in a single frame that covers all facets
- null (or
False
) - repeat this mark’s data across all facets (i.e., no faceting)
When a mark uses super faceting, it is not allowed to use position scales (x, y, fx, or fy); super faceting is intended for decorations, such as labels and legends.
When top-level faceting is used, the default auto setting is equivalent to include when the mark data is strictly equal to the top-level facet data; otherwise it is equivalent to null. When the include or exclude facet mode is chosen, the mark data must be parallel to the top-level facet data: the data must have the same length and order. If the data are not parallel, then the wrong data may be shown in each facet. The default auto therefore requires strict equality for safety, and using the facet data as mark data is recommended when using the exclude facet mode.
When mark-level faceting is used, the default auto setting is equivalent to include: the mark will be faceted if either the fx or fy channel option (or both) is specified. The null or false option will disable faceting, while exclude draws the subset of the mark’s data not in the current facet.
facet_anchor
Literal['top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'top-empty', 'right-empty', 'bottom-empty', 'left-empty', 'empty'] | None | Param-
How to place the mark with respect to facets.
None
(default for most marks) - display the mark in each non-empty facet- top, right, bottom, or left - display the mark only in facets on the given side
- top-empty, right-empty, bottom-empty, or left-empty (default for axis marks) - display the mark only in facets that have empty space on the given side: either the margin, or an empty facet
- empty - display the mark in empty facets only
margin
float | Param-
Shorthand to set the same default for all four mark margins.
margin_top
float | Param-
The mark’s top margin.
margin_right
float | Param-
The mark’s right margin.
margin_bottom
float | Param-
The mark’s bottom margin.
margin_left
float | Param-
The mark’s left margin.
aria_description
str | Param-
ARIA description (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-description).
aria_hidden
str | Param-
ARIA hidden (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden).
aria_label
Channel-
ARIA label (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label/).
pointer_events
str | Param-
Pointer events (https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events).
title
Channel-
The title; a channel specifying accessible, short textual descriptions as strings (possibly with newlines). If the
tip
option is specified, the title will be displayed with an interactive tooltip instead of using the SVG title element. tip
Union[bool, TipPointer, TipOptions, Param]-
Whether to generate a tooltip for this mark, and any tip options.
channels
dict[str, str]-
Additional named channels, for example to include in a tooltip.
Consists of (channel name, data field name) key-value pairs.
clip
Literal['frame', 'sphere'] | bool | None | Param-
How to clip the mark.
- frame or
True
- clip to the plot’s frame (inner area) - sphere - clip to the projected sphere (e.g., front hemisphere)
None
orFalse
- do not clip
The sphere clip option requires a geographic projection.
- frame or
dx
float | Param-
The horizontal offset in pixels; a constant option. On low-density screens, an additional 0.5px offset may be applied for crisp edges.
dy
float | Param-
The vertical offset in pixels; a constant option. On low-density screens, an additional 0.5px offset may be applied for crisp edges.
fill
ChannelSpec | Param-
A constant CSS color string, or a channel typically bound to the color scale. If all channel values are valid CSS colors, by default the channel will not be bound to the color scale, interpreting the colors literally.
fill_opacity
ChannelSpec | Param-
A constant number between 0 and 1, or a channel typically bound to the opacity scale. If all channel values are numbers in [0, 1], by default the channel will not be bound to the opacity scale, interpreting the opacities literally.
stroke
ChannelSpec | Param-
A constant CSS color string, or a channel typically bound to the color scale. If all channel values are valid CSS colors, by default the channel will not be bound to the color scale, interpreting the colors literally.
stroke_dasharray
str | float | Param-
A constant number indicating the length in pixels of alternating dashes and gaps, or a constant string of numbers separated by spaces or commas (e.g., 10 2 for dashes of 10 pixels separated by gaps of 2 pixels), or none (the default) for no dashing.
stroke_dashoffset
str | float | Param-
A constant indicating the offset in pixels of the first dash along the stroke; defaults to zero.
stroke_linecap
str | Param-
A constant specifying how to cap stroked paths, such as butt, round, or square (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap).
stroke_linejoin
str | Param-
A constant specifying how to join stroked paths, such as bevel, miter, miter-clip, or round (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin)
stroke_miterlimit
float | Param-
A constant number specifying how to limit the length of miter joins on stroked paths.
stroke_opacity
ChannelSpec-
A constant between 0 and 1, or a channel typically bound to the opacity scale. If all channel values are numbers in [0, 1], by default the channel will not be bound to the opacity scale, interpreting the opacities literally.
stroke_width
ChannelSpec-
A constant number in pixels, or a channel.
opacity
ChannelSpec-
A constant between 0 and 1, or a channel typically bound to the opacity scale. If all channel values are numbers in [0, 1], by default the channel will not be bound to the opacity scale, interpreting the opacities literally. For faster rendering, prefer the stroke_opacity or fill_opacity option.
mix_blend_mode
str | Param-
A constant string specifying how to blend content such as multiply (https://developer.mozilla.org/en-US/docs/Web/CSS/filter).
image_filter
str | Param-
A constant string used to adjust the rendering of images, such as blur(5px) (https://developer.mozilla.org/en-US/docs/Web/CSS/filter).
paint_order
str | Param-
A constant string specifying the order in which the * fill, stroke, and any markers are drawn; defaults to normal, which draws the fill, then stroke, then markers; defaults to stroke for the text mark to create a “halo” around text to improve legibility.
shape_rendering
str | Param-
A constant string such as crispEdges (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).
href
Channel-
a channel specifying URLs for clickable links. May be used in conjunction with the target option to open links in another window.
target
str | Param-
A constant string specifying the target window (_e.g. *_blank*) for clickable links; used in conjunction with the href option (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/target).
Channel
Data channel for visualization.
= (
Channel: TypeAlias str | Transform | Sequence[int | float | bool] | int | float | bool | None
)
ChannelSpec
Data channel spec for visualization.
= Channel | ChannelWithScale ChannelSpec: TypeAlias
ChannelIntervalSpec
In some contexts, when specifying a mark channel’s value, you can provide a {value, interval} object to specify an associated interval.
= ChannelSpec | ChannelWithInterval ChannelIntervalSpec: TypeAlias
ChannelWithInterval
Channel with associated interval.
class ChannelWithInterval(TypedDict)
ChannelWithScale
Channel with label and scale to override the scale that would normally be associated with the channel.
class ChannelWithScale(TypedDict)
ChannelName
Known channel names.
= Literal[
ChannelName: TypeAlias "ariaLabel",
"fill",
"fillOpacity",
"fontSize",
"fx",
"fy",
"geometry",
"height",
"href",
"length",
"opacity",
"path",
"r",
"rotate",
"src",
"stroke",
"strokeOpacity",
"strokeWidth",
"symbol",
"text",
"title",
"weight",
"width",
"x",
"x1",
"x2",
"y",
"y1",
"y2",
"z",
]
TipOptions
Options for the tip mark.
class TipOptions(MarkOptions, TextStyles, total=False)
Attributes
pointer
TipPointer-
The pointer mode for the tip (x, y, or xy)
x
ChannelSpec-
The horizontal position channel specifying the tip’s anchor, typically bound to the x scale.
x1
ChannelSpec-
The starting horizontal position channel specifying the tip’s anchor, typically bound to the x scale.
x2
ChannelSpec-
The ending horizontal position channel specifying the tip’s anchor, typically bound to the x scale.
y
ChannelSpec-
The vertical position channel specifying the tip’s anchor, typically bound to the y scale.
y1
ChannelSpec-
The starting vertical position channel specifying the tip’s anchor, typically bound to the y scale.
y2
ChannelSpec-
The ending vertical position channel specifying the tip’s anchor, typically bound to the y scale.
frame_anchor
FrameAnchor | Param-
The frame anchor specifies defaults for x and y based on the plot’s frame.
It may be one of the four sides (top, right, bottom, left), one of the four corners (top-left, top-right, bottom-right, bottom-left), or the middle of the frame.
anchor
FrameAnchor | Param-
The tip anchor specifies how to orient the tip box relative to its anchor position.
The tip anchor refers to the part of the tip box that is attached to the anchor point. For example, the top-left anchor places the top-left corner of tip box near the anchor position, hence placing the tip box below and to the right of the anchor position.
preferred_anchor
FrameAnchor | Param-
If an explicit tip anchor is not specified, an anchor is chosen automatically such that the tip fits within the plot’s frame. If the preferred anchor fits, it is chosen.
format
dict[ChannelName, bool | str | Param]-
How channel values are formatted for display.
If a format is a string, it is interpreted as a (UTC) time format for temporal channels, and otherwise a number format.
path_filter
str | Param-
The image filter for the tip’s box; defaults to a drop shadow.
pointer_size
float | Param-
The size of the tip’s pointer in pixels; defaults to 12.
text_padding
float | Param-
The padding around the text in pixels; defaults to 8.
TipPointer
The pointer mode for the tip; corresponds to pointerX, pointerY, and pointer.
= Literal["x", "y", "xy"] TipPointer: TypeAlias
Curve
The curve (interpolation) method for connecting adjacent points.
= Literal[
Curve: TypeAlias "basis",
"basis-closed",
"basis-open",
"bundle",
"bump-x",
"bump-y",
"cardinal",
"cardinal-closed",
"cardinal-open",
"catmull-rom",
"catmull-rom-closed",
"catmull-rom-open",
"linear",
"linear-closed",
"monotone-x",
"monotone-y",
"natural",
"step",
"step-after",
"step-before",
]
Symbol
Symbol type for dot or density plot.
= Literal[
Symbol: TypeAlias "asterisk",
"circle",
"cross",
"diamond",
"diamond2",
"hexagon",
"plus",
"square",
"square2",
"star",
"times",
"triangle",
"triangle2",
"wye",
]
Marker
Symbols used as plot markers.
= Literal[
Marker: TypeAlias "arrow",
"arrow-reverse",
"dot",
"circle",
"circle-fill",
"circle-stroke",
"tick",
"tick-x",
"tick-y",
]
Interpolate
The spatial interpolation method.
- none - do not perform interpolation (the default)
- linear - apply proportional linear interpolation across adjacent bins
- nearest - assign each pixel to the closest sample’s value (Voronoi diagram)
- barycentric - apply barycentric interpolation over the Delaunay triangulation
- random-walk - apply a random walk from each pixel
= Literal[
Interpolate: TypeAlias "none", "linear", "nearest", "barycentric", "random-walk"
]
FrameAnchor
Defaults for x and y based on the plot’s frame.
= Literal[
FrameAnchor: TypeAlias "middle",
"top-left",
"top",
"top-right",
"right",
"bottom-right",
"bottom",
"bottom-left",
"left",
]
LineAnchor
The line anchor controls how text is aligned (typically vertically) relative to its anchor point.
= Literal["top", "bottom", "middle"] LineAnchor
TextOverflow
How to truncate (or wrap) lines of text longer than the given line_width; one of:
- null (default) preserve overflowing characters (and wrap if needed);
- clip or clip-end remove characters from the end;
- clip-start remove characters from the start;
- ellipsis or ellipsis-end replace characters from the end with an ellipsis (…);
- ellipsis-start replace characters from the start with an ellipsis (…);
- ellipsis-middle replace characters from the middle with an ellipsis (…).
If no title was specified, if text requires truncation, a title containing the non-truncated text will be implicitly added.
= Literal[
TextOverflow: TypeAlias "clip",
"ellipsis",
"clip-start",
"clip-end",
"ellipsis-start",
"ellipsis-middle",
"ellipsis-end",
]
TextStyles
Text styling options.
class TextStyles(TypedDict, total=False)
Attributes
text_anchor
Literal['start', 'middle', 'end'] | Param-
The text anchor controls how text is aligned (typically horizontally) relative to its anchor point; it is one of start, end, or middle. If the frame anchor is left, top-left, or bottom-left, the default text anchor is start; if the frame anchor is right, top-right, or bottom-right, the default is end; otherwise it is middle.
line_height
float | Param-
The line height in ems; defaults to 1. The line height affects the (typically vertical) separation between adjacent baselines of text, as well as the separation between the text and its anchor point.
line_width
float | Param-
The line width in ems (e.g., 10 for about 20 characters); defaults to infinity, disabling wrapping and clipping. If text_overflow is null, lines will be wrapped at the specified length. If a line is split at a soft hyphen (), a hyphen (-) will be displayed at the end of the line. If text_overflow is not null, lines will be clipped according to the given strategy.
text_overflow
TextOverflow | Param-
Text overflow behavior.
monospace
bool | Param-
If
True
, changes the default font_family to monospace, and uses simplified monospaced text metrics calculations. font_family
str | Param-
The font-family; a constant; defaults to the plot’s font family, which is typically system-ui
font_size
Channel | float | Param-
The font size in pixels; either a constant or a channel; defaults to the plot’s font size, which is typically 10. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel.
font_variant
str | Param-
The font variant; a constant; if the text channel contains numbers or dates, defaults to tabular-nums to facilitate comparing numbers; otherwise defaults to the plot’s font style, which is typically normal.
font_weight
float | Param-
The font weight; a constant; defaults to the plot’s font weight, which is typically normal.