Skip to main content

Marks

Allows users to visualise data through graphical elements.

🔗 Explore Marks: Use Cases

Parameters

1. Area

Function Signature

app.mosaic(
vg.marks.area(
x, x1, x2,
y, y1, y2,
z,
src, src_filter
)
)

app.mosaic(
vg.marks.areaX(
x, x1, x2,
y, y1, y2,
z,
src, src_filter
)
)

app.mosaic(
vg.marks.areaY(
x, x1, x2,
y, y1, y2,
z,
src, src_filter
)
)

ParametersDescription
x1 (ChannelValueSpec)The required primary (starting, often left) horizontal position channel, representing the area’s baseline, typically bound to the x scale.
x2 (ChannelValueSpec)The optional secondary (ending, often right) horizontal position channel, representing the area’s topline, typically bound to the x scale.
y1 (ChannelValueSpec)The required primary (starting, often bottom) vertical position channel, representing the area’s baseline, typically bound to the y scale.
y2 (ChannelValueSpec)The optional secondary (ending, often top) vertical position channel, representing the area’s topline, typically bound to the y scale.
z (ChannelValue)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.
x (ChannelValueSpec)The horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].
y (ChannelValueSpec)The vertical position channel, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …].
mark (Literal["area"])Defines the type of mark as an "area".
mark (Literal["areaX"])Defines the type of mark as a vertically-oriented area where the baseline and topline share y values.
mark (Literal["areaY"])Defines the type of mark as a horizontally-oriented area where the baseline and topline share x values.
src (Union[Relation, PlotDataInline])The source of the data to be plotted.
src_filter (Optional[Parameter])An optional filter to apply to the data source before plotting.
interval (Optional[str])If specified, bins the x or y values accordingly and allows zeroes for empty bins instead of interpolating across gaps.

2. Arrow

Function Signature

app.mosaic(
vg.marks.arrow(
bend, headAngle, headLength, inset,
insetEnd, insetStart, sweep,
x, x1, x2, y, y1, y2,
src, src_filter
)
)

ParametersDescription
x (ChannelValueSpec)Horizontal position, typically bound to the x scale; sets defaults for x1 and x2.
y (ChannelValueSpec)Vertical position, typically bound to the y scale; sets defaults for y1 and y2.
x1 (ChannelValueSpec)Starting horizontal position; sets a default for x2.
y1 (ChannelValueSpec)Starting vertical position; sets a default for y2.
x2 (ChannelValueSpec)Ending horizontal position; sets a default for x1.
y2 (ChannelValueSpec)Ending vertical position; sets a default for y1.
bend (Union[int, float, bool, Parameter])The angle between the arrow's control points, within ±90°. Positive creates a clockwise curve, negative a counterclockwise curve, and 0 a straight line.
headAngle (Union[int, float, Parameter])The arrowhead pointiness in degrees, defaults to 60°.
headLength (Union[int, float, Parameter])The size of the arrowhead relative to strokeWidth.
inset (Union[int, float, Parameter])Shorthand to set the same value for insetStart and insetEnd.
insetStart (Union[int, float, Parameter])Starting inset in pixels, defaults to 0.
insetEnd (Union[int, float, Parameter])Ending inset in pixels, defaults to 0.
sweep (Union[int, float, Literal["+x", "-x", "+y", "-y"], Parameter])Sweep direction, controls how the bend angle behaves relative to the arrow's endpoints.

3. Axis


Function Signature

app.mosaic(
vg.marks.axisX(
ainterval, label, labelAnchor,
labelArrow, labelOffset,
textStroke, textStrokeOpacity, textStrokeWidth,
tickFormat, tickPadding, tickRotate, tickSize,
tickSpacing, ticks
)
)

app.mosaic(
vg.marks.axisFx(
interval, label, labelAnchor,
labelArrow, labelOffset,
textStroke, textStrokeOpacity, textStrokeWidth,
tickFormat, tickPadding, tickRotate, tickSize,
tickSpacing, ticks, mark
)
)

app.mosaic(
vg.marks.axisY(
interval, label, labelAnchor,
labelArrow, labelOffset,
textStroke, textStrokeOpacity, textStrokeWidth,
tickFormat, tickPadding, tickRotate, tickSize,
tickSpacing, ticks
)
)

app.mosaic(
vg.marks.axisFy(
interval, label, labelAnchor,
labelArrow, labelOffset,
textStroke, textStrokeOpacity, textStrokeWidth,
tickFormat, tickPadding, tickRotate, tickSize,
tickSpacing, ticks, mark
)
)

app.mosaic(
vg.marks.gridX(
anchor, color, opacity
)
)

app.mosaic(
vg.marks.gridFx(
anchor, color, opacity, mark
)
)

app.mosaic(
vg.marks.gridY(
anchor, color, opacity
)
)

app.mosaic(
vg.marks.gridFy(
anchor, color, opacity, mark
)
)
ParametersDescription
interval (Union[Interval, Parameter])Ensures uniform intervals for data, like integers or time-based intervals.
ticks (Union[int, float, Interval, Sequence[Any], Parameter])Approximate number of axis ticks, or specific values for ticks.
tickSpacing (Union[int, float, Parameter])Desired spacing between adjacent ticks, defaults to 80px for x and 35px for y.
tickSize (Union[int, float, Parameter])Length of axis tick marks in pixels, defaults to 6.
tickPadding (Union[int, float, Parameter])Distance between tick marks and labels, typically 3 pixels.
tickFormat (Union[str, None, Parameter])Format for tick labels, using D3 format strings for numbers or dates.
tickRotate (Union[int, float, Parameter])Rotation angle of tick labels, in degrees. Defaults to 0°.
label (Union[str, None, Parameter])Text label for the axis or legend.
labelAnchor (Union[Literal["top", "right", "bottom", "left", "center"], Parameter])Position of axis label relative to the plot’s frame.
labelOffset (Union[int, float, Parameter])Offset for axis label position in pixels.
labelArrow (Union[Literal["auto", "up", "right", "down", "left", "none"], bool, None, Parameter])Directional arrow for scale label, auto applies based on ordinal scale.
anchor (Union[Literal["top", "right", "bottom", "left"], Parameter])Side of the frame for the axis or grid placement, e.g., left or right for vertical axes.
color (Union[ChannelValueSpec, Parameter])Affects the stroke of tick vectors and fill of labels. Defaults to currentColor.
opacity (ChannelValueSpec)Affects the stroke opacity of tick vectors and fill opacity of labels. Defaults to 1 for axes and 0.1 for grids.
textStroke (Union[ChannelValueSpec, Parameter])Tick text stroke color, useful for adding outlines to text.
textStrokeOpacity (ChannelValueSpec)Opacity for tick text stroke, defaults to 1.
textStrokeWidth (ChannelValueSpec)Width of tick text stroke, defaults to 4.

4. Bar


Function Signature

app.mosaic(
vg.marks.barX(
interval, x, x1, x2, y,
mark, src, src_filter
)
)

app.mosaic(
vg.marks.barY(
interval, y, y1, y2, x,
mark, src, src_filter
)
)
ParametersDescription
interval (Union[Interval, Parameter])Converts a continuous value into an interval (e.g., x for barX, y for barY). Disables implicit stacking.
x (ChannelValueIntervalSpec)Horizontal position or length/width for barX. Implicit stackX transform applied if neither x1, x2, nor interval is specified.
x1 (ChannelValueSpec)Primary starting horizontal position, disables implicit stackX transform.
x2 (ChannelValueSpec)Secondary ending horizontal position, disables implicit stackX transform.
y (ChannelValueSpec)Vertical position of the bar, typically ordinal, defaults to spanning the vertical frame if not specified.
y1 (ChannelValueSpec)Primary starting vertical position, disables implicit stackY transform.
y2 (ChannelValueSpec)Secondary ending vertical position, disables implicit stackY transform.
x (ChannelValueSpec)Optional horizontal position of the bar, typically ordinal, spans the frame if not specified.
y (ChannelValueIntervalSpec)Vertical position or height for barY. Implicit stackY transform applied if neither y1, y2, nor interval is specified.

5. Cell


Function Signature

app.mosaic(
vg.marks.cell(
x, y, mark, src, src_filter
)
)

app.mosaic(
vg.marks.cellX(
x, y, mark, src, src_filter
)
)

app.mosaic(
vg.marks.cellY(
x, y, mark, src, src_filter
)
)
ParametersDescription
x (ChannelValueSpec)Horizontal position of the cell; typically ordinal. Spans the frame if not specified, must be a band scale if provided. Use barX or rect for quantitative values.
y (ChannelValueSpec)Vertical position of the cell; typically ordinal. Spans the frame if not specified, must be a band scale if provided. Use barY or rect for quantitative values.
src (Union[Relation, PlotDataInline])The data source for the plot.
src_filter (Optional[Parameter])Optional filter for the data source.

6. Contour

Function Signature

app.mosaic(
vg.marks.contour(
thresholds, mark, src, src_filter
)
)

ParametersDescription
thresholds (Union[int, float, Sequence[Union[int, float]], Parameter])Specifies the number of contour thresholds or a sequence of threshold values; defaults to 10.
src (Union[Relation, PlotDataInline])The data source for the contour plot.
src_filter (Optional[Parameter])Optional filter for the data source.

7. Delaunay

Function Signature

app.mosaic(
vg.marks.delaunay_link(
x, y, z, mark, src, src_filter
)
)

app.mosaic(
vg.marks.delaunay_mesh(
x, y, z, mark, src, src_filter
)
)

app.mosaic(
vg.marks.hull(
x, y, z, mark, src, src_filter
)
)

app.mosaic(
vg.marks.voronoi(
x, y, z, mark, src, src_filter
)
)

app.mosaic(
vg.marks.voronoi_mesh(
x, y, z, mark, src, src_filter
)
)
ParametersDescription
x (ChannelValueSpec)The horizontal position channel, typically bound to the x scale.
y (ChannelValueSpec)The vertical position channel, typically bound to the y scale.
z (ChannelValue)An optional ordinal channel for grouping to produce multiple (possibly overlapping) triangulations.
src (Union[Relation, PlotDataInline])The data source for the Delaunay marks.
src_filter (Optional[Parameter])Optional filter for the data source.

8. Dense Line

Function Signature

app.mosaic(
vg.marks.denseLine(
normalize, z, mark, src, src_filter
)
)
ParametersDescription
normalize (Union[bool, Parameter])Flag to perform approximate arc length normalization of line segments to prevent artifacts due to over-counting steep lines. Defaults to true.
z (ChannelValue)A channel for grouping data into series to be drawn as separate lines.
src (Union[Relation, PlotDataInline])The data source for the DenseLine mark.
src_filter (Optional[Parameter])Optional filter for the data source.

9. Density

Function Signature

app.mosaic(
vg.marks.densityX(
bandwidth, bins, interval, type, x, y, z,
src, src_filter
)
)

app.mosaic(
vg.marks.densityY(
bandwidth, bins, interval, type, x, y, z
)
)
ParametersDescription
type (Union[Literal["dot", "circle", "hexagon", "cell", "text"], Parameter])The basic mark type to use to render 2D density values. Defaults to a dot mark; cell and text marks are also supported.
normalize (Union[bool, Parameter])Flag to perform approximate arc length normalization of line segments to prevent artifacts due to over-counting steep lines. Defaults to true.
z (ChannelValue)A channel for grouping data into series to be drawn as separate lines or areas.
x (ChannelValueSpec)The horizontal position channel, typically bound to the x scale.
y (ChannelValueSpec)The vertical position channel, typically bound to the y scale.
bandwidth (Union[int, float, Parameter])The kernel density bandwidth for smoothing, in pixels. Defaults to 20.
bins (Union[int, float, Parameter])The number of bins over which to discretize the data prior to smoothing. Defaults to 1024.
interval (Union[Interval, Parameter])An interval to transform y or x values to the middle of the interval (for example, day or a number).
src (Union[Relation, PlotDataInline])The data source for the density mark.
src_filter (Optional[Parameter])Optional filter for the data source.

10. Dot

  • This includes parameters for DotOptions, DotXOptions, DotYOptions, DotOptionsNoSymbol, and relevant functions like dot, dotX, dotY, circle, and hexagon.

Function Signature

app.mosaic(
vg.marks.dot(
frameAnchor, interval, r, rotate,
symbol, x, y, src, src_filter
)
)

app.mosaic(
vg.marks.dotX(
frameAnchor, interval, r, rotate,
symbol, x, y, src, src_filter
)
)

app.mosaic(
vg.marks.dotY(
frameAnchor, interval, r, rotate,
symbol, x, y, src, src_filter
)
)

app.mosaic(
vg.marks.circle(
frameAnchor, interval, r,
rotate, src, src_filter
)
)

app.mosaic(
vg.marks.hexagon(
frameAnchor, interval, r,
rotate, src, src_filter
)
)
ParametersDescription
r (Union[ChannelValueSpec, int, float, Parameter])The radius of dots; either a channel or constant. Defaults to 4.5 pixels with symbol channel, otherwise 3 pixels.
rotate (Union[ChannelValue, int, float, Parameter])The rotation angle of dots in degrees clockwise; defaults to 0°, pointing up.
frameAnchor (Union[FrameAnchor, Parameter])Specifies defaults for x and y based on the plot’s frame.
symbol (Union[ChannelValueSpec, SymbolType, Parameter])The categorical symbol; either a channel or constant, defaults to circle for dot and hexagon for hexagon marks.
z (ChannelValue)An optional ordinal channel for grouping data into series.
x (ChannelValueSpec)The horizontal position channel specifying the dot’s center, typically bound to the x scale.
y (ChannelValueSpec)The vertical position of the dot’s center, typically bound to the y scale.
interval (Union[Interval, Parameter])An interval (such as day or a number), to transform x or y values to the middle of the interval.
src (Union[Relation, PlotDataInline])The data source for the mark.
src_filter (Optional[Parameter])Optional filter for the data source.

11. Error Bar

Function Signature

app.mosaic(
vg.marks.errorbarX(
ci, x, y, z,
src, src_filter
)
)

app.mosaic(
vg.marks.errorbarY(
ci, x, y, z,
src, src_filter
)
)
ParametersDescription
ci (Union[int, float, Parameter])The confidence interval in (0, 1); defaults to 0.95.
z (ChannelValue)An optional ordinal channel for grouping data, producing an independent error bar for each group. If not specified, it defaults to stroke if a channel.
x (ChannelValueSpec)The dependent variable horizontal position channel, typically bound to the x scale. (For ErrorBarX)
y (ChannelValueSpec)The independent variable vertical position channel, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …]. (For ErrorBarX)
x (ChannelValueSpec)The independent variable horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …]. (For ErrorBarY)
y (ChannelValueSpec)The dependent variable vertical position channel, typically bound to the y scale. (For ErrorBarY)
src (Union[Relation, PlotDataInline])The data source for the mark.
src_filter (Optional[Parameter])Optional filter for the data source.
kwargs (Unpack[ErrorBarXOptions])Additional parameters for the errorbarX mark.
kwargs (Unpack[ErrorBarYOptions])Additional parameters for the errorbarY mark.
  • ErrorBarOptions : Base class which provides the ci and z params.
  • ErrorBarXOptions and ErrorBarYOptions : Provides the x and y params.

12. Frame

Function Signature

app.mosaic(
vg.marks.frame(anchor)
)
ParametersDescription
anchor (Union[Literal["top", "right", "bottom", "left"], None, Parameter])If null (default), the rectangular outline of the frame is drawn; otherwise the frame is drawn as a line only on the given side, and the rx, ry, fill, and fillOpacity options are ignored.
kwargs (Unpack[FrameOptions])Additional parameters for the frame mark.

13. Geo

Function Signature

app.mosaic(
vg.marks.geo(
geometry, r,
src, src_filter, **kwargs
)
)

app.mosaic(
vg.marks.sphere(**kwargs)
)

app.mosaic(
vg.marks.graticule(**kwargs)
)
ParametersDescription
geometry (ChannelValue)A required channel for the geometry to render; defaults to identity, assuming data is a GeoJSON object or an iterable of GeoJSON objects.
r (Union[ChannelValueSpec, Parameter])The size of Point and MultiPoint geometries, defaulting to a constant 3 pixels. If r is a number, it is interpreted as a constant radius in pixels; otherwise it is interpreted as a channel.
kwargs (Unpack[GeoOptions])Additional parameters for the geo mark.
  • Sphere and Graticule are also available as functions of GeoOptions.

14. Hexbin

Function Signature

app.mosaic(
vg.marks.hexbin(
binWidth, type_, z,
src, src_filter
)
)
ParametersDescription
type_ (Union[Literal["dot", "circle", "text"], Parameter])The basic mark type to use for hex-binned values. Defaults to a hexagon mark; dot and text marks are also supported.
binWidth (Union[int, float, Parameter])The distance between centers of neighboring hexagons, in pixels; defaults to 20. If also using a hexgrid mark, use matching binWidth values.
z (ChannelValue)How to subdivide bins. If not specified, defaults to the fill channel, if any, or the stroke channel, if any. If null, bins will not be subdivided.
kwargs (Unpack[HexbinOptions])Additional parameters for the hexbin mark.

15. HexGrid

Function Signature

app.mosaic(
vg.marks.hexgrid(binWidth)
)
ParametersDescription
binWidth (Union[int, float, Parameter])The distance between centers of neighboring hexagons, in pixels; defaults to 20. Should match the binWidth of the hexbin mark.
kwargs (Unpack[HexgridOptions])Additional parameters for the hexgrid mark.

16. Image

Function Signature

app.mosaic(
vg.marks.image(
crossOrigin, frameAnchor, height, imageRendering,
preserveAspectRatio, r, rotate, src, width, x, y,
data_src, data_filter
)
)
ParametersDescription
x (ChannelValueSpec)The horizontal position channel specifying the image’s center; typically bound to the x scale.
y (ChannelValueSpec)The vertical position channel specifying the image’s center; typically bound to the y scale.
width (Union[ChannelValue, Parameter])The image width in pixels. Also sets the default height; if neither are set, defaults to 16. Images with a non-positive width are not drawn.
height (Union[ChannelValue, Parameter])The image height in pixels. Also sets the default height; if neither are set, defaults to 16. Images with a non-positive height are not drawn.
r (Union[ChannelValue, Parameter])The image clip radius, for circular images. If null, images are not clipped. Also defaults height and width to twice its value.
rotate (Union[ChannelValue, Parameter])The rotation angle, in degrees clockwise. When a number, it is interpreted as a constant; otherwise it is interpreted as a channel.
src (Union[ChannelValue, Parameter])The required image URL (or relative path). If a string starts with a dot, slash, or URL protocol, it is assumed to be a constant.
preserveAspectRatio (Union[str, Parameter])The image aspect ratio; defaults to xMidYMid meet. Use xMidYMid slice to crop the image instead of scaling.
crossOrigin (Union[str, Parameter])The cross-origin behavior.
frameAnchor (Union[FrameAnchor, Parameter])The frame anchor specifies defaults for x and y based on the plot’s frame.
imageRendering (Union[str, Parameter])The image-rendering attribute; defaults to auto (bilinear). Set to pixelated to disable bilinear interpolation for a sharper image.

17. Line

  • It follows for LineOptions, LineXOptions, and LineYOptions.

Function Signature

app.mosaic(
vg.marks.line(
x, y, z,
src, src_filter
)
)

app.mosaic(
vg.marks.lineX(
x, y, z,
src, src_filter
)
)

app.mosaic(
vg.marks.lineY(
x, y, z,
src, src_filter
)
)
ParametersDescription
x (ChannelValueSpec)The required horizontal position channel, typically bound to the x scale.
y (ChannelValueSpec)The required vertical position channel, typically bound to the y scale.
z (ChannelValue)An optional ordinal channel for grouping data into series to be drawn as separate lines. If not specified, defaults to fill if a channel, or stroke.
y (ChannelValueSpec)For LineXOptions: The vertical position channel, typically bound to the y scale; defaults to the zero-based index of the data [0, 1, 2, …].
x (ChannelValueSpec)For LineYOptions: The horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].

Function Signature

app.mosaic(
vg.marks.link(
curve, x, x1, x2, y, y1, y2,
src, src_filter
)
)
ParametersDescription
x (ChannelValueSpec)The horizontal position, for vertical links; typically bound to the x scale; shorthand for setting defaults for both x1 and x2.
y (ChannelValueSpec)The vertical position, for horizontal links; typically bound to the y scale; shorthand for setting defaults for both y1 and y2.
x1 (ChannelValueSpec)The starting horizontal position; typically bound to the x scale; also sets a default for x2.
x2 (ChannelValueSpec)The ending horizontal position; typically bound to the x scale; also sets a default for x1.
y1 (ChannelValueSpec)The starting vertical position; typically bound to the y scale; also sets a default for y2.
y2 (ChannelValueSpec)The ending vertical position; typically bound to the y scale; also sets a default for y1.
curve (Union[Curve, Literal["auto"], Parameter])The curve (interpolation) method for connecting adjacent points. Only certain curves are recommended: linear, step, step-after, step-before, bump-x, or bump-y.

19. Raster

Function Signature

app.mosaic(
vg.marks.raster(
bandwidth, fill, fillOpacity, height, imageRendering,
interpolate, pad, pixelSize, width, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.heatmap(
bandwidth, fill, fillOpacity, height, imageRendering,
interpolate, pad, pixelSize, width, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.raster_tile(
bandwidth, fill, fillOpacity, height, imageRendering,
interpolate, origin, pad, pixelSize, width, x, y,
src, src_filter
)
)
ParametersDescription
x (ChannelValueSpec)The horizontal position channel, typically bound to the x scale. Domain values are binned into a grid with width horizontal bins.
y (ChannelValueSpec)The vertical position channel, typically bound to the y scale. Domain values are binned into a grid with height vertical bins.
width (Union[int, float, Parameter])The width (number of columns) of the grid, in actual pixels.
height (Union[int, float, Parameter])The height (number of rows) of the grid, in actual pixels.
pixelSize (Union[int, float, Parameter])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 (Union[int, float, Parameter])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 (Union[int, float, Parameter])The kernel density bandwidth for smoothing, in pixels.
interpolate (Union[GridInterpolate, None, Parameter])The spatial interpolation method; one of: none (default), linear, nearest, barycentric, random-walk.
imageRendering (Union[str, Parameter])The image-rendering attribute; defaults to auto (bilinear). Can be set to pixelated for sharper images (not supported in WebKit).
fill (Union[ChannelValueSpec, Parameter])The fill, typically bound to the color scale. Can be constant or channel-based. Use the special value "density" to map computed density values to pixel colors.
fillOpacity (Union[ChannelValueSpec, Parameter])The opacity, typically bound to the opacity scale. Can be constant or channel-based. Use "density" to map computed density values to opacity.
origin (Union[Tuple[Union[int, float], Union[int, float]], Parameter])The origin for raster tiles.

20. Rect

  • It follows for RectOptions, RectXOptions, and RectYOptions.

Function Signature

app.mosaic(
vg.marks.rect(
interval, rx, ry, x, x1, x2,
y, y1, y2, src, src_filter
)
)

app.mosaic(
vg.marks.rectX(
interval, rx, ry, x, x1, x2,
y, y1, y2, src, src_filter
)
)

app.mosaic(
vg.marks.rectY(
interval, rx, ry, x, x1, x2,
y, y1, y2, src, src_filter
)
)
ParameterDescription
rx (Union[int, float, str, Parameter])The rounded corner x-radius in pixels or as a percentage of the rect width. Defaults to ry if present, otherwise draws square corners.
ry (Union[int, float, str, Parameter])The rounded corner y-radius in pixels or as a percentage of the rect height. Defaults to rx if present, otherwise draws square corners.
x (ChannelValueIntervalSpec)The horizontal position (or length/width) channel, typically bound to the x scale. Derives x1 and x2 when using intervals.
x1 (ChannelValueSpec)The primary (starting) horizontal position channel, typically bound to the x scale. Disables the implicit stackX transform.
x2 (ChannelValueSpec)The secondary (ending) horizontal position channel, typically bound to the x scale. Disables the implicit stackX transform.
y (ChannelValueIntervalSpec)The vertical position (or length/height) channel, typically bound to the y scale. Derives y1 and y2 when using intervals.
y1 (ChannelValueSpec)The primary (starting) vertical position channel, typically bound to the y scale. Disables the implicit stackY transform.
y2 (ChannelValueSpec)The secondary (ending) vertical position channel, typically bound to the y scale. Disables the implicit stackY transform.
interval (Union[Interval, Parameter])Defines how to convert continuous values into intervals (for example, x1/x2 or y1/y2) based on time or number intervals. Disables the implicit stack transform.
width (Union[int, float, Parameter])The width of the grid, in actual pixels.
height (Union[int, float, Parameter])The height of the grid, in actual pixels.

21. Regression

  • It follows for RegressionOptions and RegressionYOptions.

Function Signature

app.mosaic(
vg.marks.regressionY(
ci, precision, x, y, z,
src, src_filter
)
)
ParameterDescription
ci (Union[int, float, Parameter])The confidence interval in (0, 1), or 0 to hide bands; defaults to 0.95.
precision (Union[int, float, Parameter])The distance in pixels between samples of the confidence band; defaults to 4.
z (ChannelValue)An optional ordinal channel for grouping data into (possibly stacked) series, producing an independent regression for each group. If not specified, it defaults to fill if a channel, or stroke if a channel.
x (ChannelValueSpec)The independent variable horizontal position channel, typically bound to the x scale; defaults to the zero-based index of the data [0, 1, 2, …].
y (ChannelValueSpec)The dependent variable vertical position channel, typically bound to the y scale; defaults to identity, assuming that data = [y₀, y₁, y₂, …].

22. Rule

Function Signature

app.mosaic(
vg.marks.ruleX(
inset, insetBottom, insetTop, interval,
x, x1, x2, y, y1, y2, src, src_filter
)
)

app.mosaic(
vg.marks.ruleY(
inset, insetLeft, insetRight, interval,
x, x1, x2, y, y1, y2, src, src_filter
)
)
ParameterDescription
interval (Union[Interval, Parameter])How to convert a continuous value (y for ruleX, or x for ruleY) into an interval (y1 and y2 for ruleX, or x1 and x2 for ruleY); one of: a named time interval such as day (for date intervals), or a number (for number intervals), defining intervals at integer multiples of n.
x (ChannelValueSpec)The horizontal position of the tick; an optional channel bound to the x scale. If not specified, the rule will be horizontally centered in the plot’s frame.
y (ChannelValueIntervalSpec)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 (ChannelValueSpec)The primary (starting, often bottom) vertical position of the tick; a channel bound to the y scale. If y represents ordinal values, use a tickX mark instead.
y2 (ChannelValueSpec)The secondary (ending, often top) vertical position of the tick; a channel bound to the y scale. If y represents ordinal values, use a tickX mark instead.
inset (Union[int, float, Parameter])Shorthand to set the same default for all insets. A positive inset reduces effective area, while a negative inset increases it.
insetTop (Union[int, float, Parameter])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).
insetBottom (Union[int, float, Parameter])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).
  • RuleOptions : Base class which provides the interval param.
  • RuleXOptions and RuleYOptions : Provides the x and y params.
  • RuleX and RuleY : Functions to create rule marks and inherits from those params.

23. Text

Function Signature

app.mosaic(
vg.marks.text(
frameAnchor, lineAnchor, rotate, text, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.textX(
frameAnchor, interval, lineAnchor, rotate, text, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.textY(
frameAnchor, interval, lineAnchor, rotate, text, x, y,
src, src_filter
)
)
ParameterDescription
text (ChannelValue)The text contents channel, possibly with line breaks (\n, \r\n, or \r). If not specified, defaults to the zero-based index [0, 1, 2, …].
frameAnchor (Union[FrameAnchor, Parameter])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, or the middle of the frame.
lineAnchor (Union[Literal["top", "middle", "bottom"], Parameter])The line anchor controls how text is aligned (typically vertically) relative to its anchor point; one of top, bottom, or middle.
rotate (Union[ChannelValue, Parameter])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.
x (ChannelValueSpec)The horizontal position channel specifying the text’s anchor point, typically bound to the x scale.
y (ChannelValueSpec)The vertical position channel specifying the text’s anchor point, typically bound to the y scale.
z (ChannelValue)An optional ordinal channel for grouping data into series.
interval (Union[Interval, Parameter])An interval (such as day or a number), to transform y or x values to the middle of the interval.

24. Tick

Function Signature

app.mosaic(
vg.marks.tickX(
inset, insetBottom, insetTop,
x, y, src, src_filter
)
)

app.mosaic(
vg.marks.tickY(
inset, insetLeft, insetRight,
x, y, src, src_filter
)
)
ParameterDescription
x (ChannelValueSpec)The required horizontal position of the tick; a channel typically bound to the x scale.
y (ChannelValueSpec)The optional vertical position of the tick; an ordinal channel typically bound to the y scale. If not specified, the tick spans the vertical extent of the frame.
inset (Union[int, float, Parameter])Shorthand to set the same default for all insets. A positive inset reduces effective area, while a negative inset increases it.
insetTop (Union[int, float, Parameter])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).
insetBottom (Union[int, float, Parameter])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).
insetRight (Union[int, float, Parameter])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).
insetLeft (Union[int, float, Parameter])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).

25. Vector

Function Signature

app.mosaic(
vg.marks.vector(
anchor, frameAnchor, length, r, rotate, shape, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.vectorX(
anchor, frameAnchor, length, r, rotate, shape, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.vectorY(
anchor, frameAnchor, length, r, rotate, shape, x, y,
src, src_filter
)
)

app.mosaic(
vg.marks.spike(
anchor, frameAnchor, length, r, rotate, shape, x, y,
src, src_filter
)
)
ParameterDescription
x (ChannelValueSpec)The horizontal position of the vector’s anchor point; an optional channel bound to the x scale. Default depends on the frameAnchor.
y (ChannelValueSpec)The vertical position of the vector’s anchor point; an optional channel bound to the y scale. Default depends on the frameAnchor.
r (Union[int, float, Parameter])The vector shape’s radius, such as half the width of the arrow’s head or the spike’s base; a constant number in pixels. Defaults to 3.5 pixels.
length (ChannelValueSpec)The vector’s length; either an optional channel bound to the length scale or a constant number in pixels. Defaults to 12 pixels.
rotate (ChannelValue)The vector’s orientation (rotation angle); either a constant number in degrees clockwise, or an optional channel (with no associated scale). Defaults to 0 degrees with the vector pointing up.
shape (Union[VectorShape, Parameter])The shape of the vector; a constant. Defaults to arrow.
anchor (Union[Literal["start", "middle", "end"], Parameter])The vector’s position along its orientation relative to its anchor point; a constant. Assuming a default rotate angle of 0°.
frameAnchor (Union[FrameAnchor, Parameter])The vector’s frame anchor, to default x and y relative to the frame; a constant representing one of the frame corners or sides, or middle (default). Has no effect if both x and y are specified.