Skip to main content

Module chart

Module chart 

Source
Expand description

Round 1 (docs/round-1-contract.md §3, Chart): the numbers every painter must agree on — the value extent per kind and the “nice” axis ticks (Heckbert’s nice numbers), the series colour order and the donut hole. Pure; geometry (bars, arcs) stays each painter’s. Mirrors src/chart.ts.

Structs§

ChartSeries
One series as the painter reads it off the Chart props.
Extent
Ticks

Constants§

DONUT_HOLE
The donut’s hole as a share of its radius (pie = 0).
WINDOW_THRESHOLD
Rows past which Table and List window their children (layout.json).

Functions§

chart_extent
The value range the y axis spans: min defaults to 0 (lower when a value is negative), max to the largest value — the largest category SUM for stackedBar; sparkline spans its own min..max.
nice_ticks
Axis ticks over [min, max]: a nice step (1, 2 or 5 × 10^n) giving about target ticks, the range widened to whole steps, every tick rounded to the step’s decimals.
series_color
The colour token of series (or slice) index: its tone’s colour when set, else $color.chart1..8 in order, wrapping.