Skip to main content

Module chart_modal

Module chart_modal 

Source
Expand description

Chart view state: the chart’s spec and the panel that edits it.

The spec is a set of shelves, named as Vega-Lite names them so a later version can save it: mark (the Type shelf), encoding.x.field with its timeUnit, encoding.y.field with its aggregate, and encoding.color.field. Every chart type shows the same shelves; a shelf a type does not use is dimmed, never hidden (ChartModal::shelf). Options that are not part of what is charted (bins, ranges, the grid, the sample size) sit beside the spec.

The panel is one form of the shared focus model (crate::app::form); column and value rows are edited through the one shared Picker.

Structs§

ChartColumns
The view’s columns a chart can take, by role.
ChartModal
Chart view state: the spec, the options, and the panel’s focus.
ChartSpec
What is charted.
ColorCounts
The values of the Color column, most rows first, as the chart’s last count found them: what the value picker lists.
ColorEncoding
Encoding
RowsDraft
A change to the Rows row not yet read: ←/→ or a typed size waits for Enter, or for focus to leave the row, so the chart reads once rather than per key.
XEncoding
YEncoding

Enums§

Aggregate
What a Y value is, per X (and color): the column as it is, or an aggregate of the rows that share it.
ChartFocus
One row of the panel: a shelf, the line under it, or an option.
Cumulative
A running total of the aggregated Y, along X.
Mark
The Type shelf: what marks the chart draws.
PickerFor
What the open Picker edits.
ShelfUse
Whether a shelf takes part in the chart on screen.
TimeUnit
How a temporal X is bucketed before Y is aggregated.

Constants§

CHART_ROW_LIMIT_MAX
The largest sample size (Polars slice takes u32).
COLOR_MAX
Series a color splits a chart into, at most: one per palette color (chart_1 to chart_10). A terminal of fewer colors draws fewer: ChartModal::series_max.
HEATMAP_DEFAULT_BINS
Default heatmap bin count (applies to both axes).
HEATMAP_MAX_BINS
HEATMAP_MIN_BINS
HISTOGRAM_DEFAULT_BINS
Default histogram bin count.
HISTOGRAM_MAX_BINS
HISTOGRAM_MIN_BINS
KDE_BANDWIDTH_MAX
KDE_BANDWIDTH_MIN
KDE bandwidth multiplier bounds and step.
KDE_BANDWIDTH_STEP
NONE_ITEM
The item a Picker offers for “nothing”: no Color, no category on a box plot.
QUANTILES
The percentiles the quantile steps through.
QUANTILE_DEFAULT
The percentile a quantile starts at.
Y_SERIES_MAX
Most Y columns a line or scatter chart draws at once.