Interface: PlotView
Defined in: packages/plot/src/index.ts:54
The view of a chart drawn by plotRenderer. Every field is optional.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
brush? | readonly | false | "x" | "xy" | Brush direction for binned dimensions. Default x (1-D) or xy (grid). false turns it off. |
color? | readonly | string | Fill for selected bins. |
colors? | readonly | Readonly<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? | readonly | boolean | Draw 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) => string | Number format for labels and the default tooltip. |
height? | readonly | number | Default 200 for 1-D charts, 300 for grids; barX grows with the category count. |
labels? | readonly | boolean | Value labels at the end of barX bars. |
layout? | readonly | number | map only: the layout to start with. Default 0. |
layouts? | readonly | readonly 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? | readonly | PlotMark | Mark 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? | readonly | string | Fill for bins outside this chart's own filter. |
omit? | readonly | readonly string[] | Category keys not to draw, such as the "Other" bin of top(). |
plot? | readonly | PlotOptions | Extra Plot options, merged last. |
radius? | readonly | number | map only: radius in pixels of the dot with the largest unfiltered value. Default 12. |
reverse? | readonly | boolean | Run a binned x axis right to left, e.g. for "millions of years ago". |
scheme? | readonly | string | Color scheme for grids. Default blues. |
select? | readonly | false | "single" | "multi" | Click selection for categories. Default multi. false turns it off. |
series? | readonly | readonly 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? | readonly | string | Title drawn above the chart. |
tooltip? | readonly | false | ((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? | readonly | readonly Markish[] | Static marks drawn under the data, such as shaded eras. view.plot.marks draw on top. |
width? | readonly | number | Width in pixels. Defaults to the container's width, and follows it. |
xLabel? | readonly | string | null | x axis label. null hides it. |
yLabel? | readonly | string | null | y axis label. null hides it. |