Skip to content

Interface: PlotView ​

Defined in: packages/plot/src/index.ts:54

The view of a chart drawn by plotRenderer. Every field is optional.

Properties ​

PropertyModifierTypeDescription
brush?readonlyfalse | "x" | "xy"Brush direction for binned dimensions. Default x (1-D) or xy (grid). false turns it off.
color?readonlystringFill for selected bins.
colors?readonlyReadonly<Record<string, string>>Colors by key: the series of a stackY chart (keys without one use Plot's categorical scheme), or the selected bars of a category chart.
compare?readonlybooleanDraw the unfiltered distribution as a dashed outline, scaled to the current total, so the shape of a selection compares with the shape of everything. Works with rectY, barX and barY.
format?readonly(value) => stringNumber format for labels and the default tooltip.
height?readonlynumberDefault 200 for 1-D charts, 300 for grids; barX grows with the category count.
labels?readonlybooleanValue labels at the end of barX bars.
layout?readonlynumbermap only: the layout to start with. Default 0.
layouts?readonlyreadonly MapLayout[]map only: ways to place the dots, shown as buttons above the map when there is more than one. Switching animates every dot to its new place. Default: one layout with dots at cell centers.
mark?readonlyPlotMarkMark to draw. Defaults: rectY for binned dimensions, barX for categories, rect for grids (cell when a grid axis is categorical). stackY draws a grid of binned x by categorical y as stacked bars, one color per y key, brushable along x; streamY draws the same grid as a smooth streamgraph centered on the axis. shareX draws a category dimension as one bar split into its parts. bump draws a grid of categorical x by categorical y as a bump chart: one line per x key, ranked within each y key (y keys run left to right). With colors, lines without a color stay grey until something is selected. map draws a binned grid, such as lngLat(), as dots sized by value on an equirectangular map; see layouts.
mutedColor?readonlystringFill for bins outside this chart's own filter.
omit?readonlyreadonly string[]Category keys not to draw, such as the "Other" bin of top().
plot?readonlyPlotOptionsExtra Plot options, merged last.
radius?readonlynumbermap only: radius in pixels of the dot with the largest unfiltered value. Default 12.
reverse?readonlybooleanRun a binned x axis right to left, e.g. for "millions of years ago".
scheme?readonlystringColor scheme for grids. Default blues.
select?readonlyfalse | "single" | "multi"Click selection for categories. Default multi. false turns it off.
series?readonlyreadonly string[]Stacking order for stackY, bottom first. Default: the dimension's key order.
sort?readonly"key" | "value" | "baseline" | "-value" | "-baseline"Category order: dimension order (key, the default), by the current value, or by the unfiltered baseline (-baseline keeps bars in place while filters change).
title?readonlystringTitle drawn above the chart.
tooltip?readonlyfalse | ((d, bin) => string)Hover tooltip. Return text with one line per "\n"; the first line is bold. Gets the bin under the pointer and, for stackY, every series in that bin. false turns it off.
underlay?readonlyreadonly Markish[]Static marks drawn under the data, such as shaded eras. view.plot.marks draw on top.
width?readonlynumberWidth in pixels. Defaults to the container's width, and follows it.
xLabel?readonlystring | nullx axis label. null hides it.
yLabel?readonlystring | nully axis label. null hides it.

Released under the MIT License.