Skip to main content

Cheat sheet

One-screen reference for the whole @pond-ts/charts surface — the data each layer takes, what it can do, and the container/axis knobs. For the narrative, follow the links; this page is the scan.

Draw layers — data contract

What each layer reads, the adapter that shapes it, its theme slot, and its one sharp edge.

LayerSeries / inputKey columnsAdapterTheme slotSharp edge
LineChartTimeSeries | ValueSeriesone numeric columnfromTimeSeries / fromValueSeriestheme.linecurve smooths the drawing, not the data — denoise with smooth().
AreaChartTimeSeries | ValueSeriesone column, fill from baselinefromTimeSeries / fromValueSeriestheme.areaGaps couple fill+outline; fill must be CSS hex.
BandChartTimeSeries | ValueSeriestwo columns lower + upperbandFromTimeSeries / …ValueSeriestheme.bandAlways breaks on a gap (no gaps prop, by design).
ScatterChartTimeSeries | ValueSeriescolumn (y) + optional radius/color colsfromTimeSeries / fromValueSeriestheme.scatterData-driven radius/colour are column+range only; ramp stops hex.
BarChartTimeSeries/ValueSeries/Map xor bins xor categoriescolumn xor columns[]barsFrom* / stacksFrom* / categoryStacktheme.barOne-of series/bins/categories & column xor columns — else throws.
BoxPlotTimeSeries | ValueSerieslower+upper req; q1/q3/median optboxFromTimeSeries / …ValueSeriestheme.boxDoesn't compute quantiles; q1/q3 both-or-neither throws.
CandlestickTimeSeries onlyopen/high/low/closeohlcFromTimeSeriestheme.candleAny price missing ⇒ no candle; default pair is neutral, not red/green.

Capability matrix

Which x-axis kinds each layer supports, whether it reads out under the cursor, whether its marks are selectable, and how it handles a NaN gap.

LayerX-axis kindsCursor readoutSelectionGap handling
LineCharttime · value✅ all modesgaps prop — all 5 modes
AreaCharttime · value✅ (rides the value edge)gaps prop — fill+outline coupled
BandCharttime · value✅ (both edge values)always breaks (no gaps prop)
ScatterCharttime · value✅ (snaps to nearest point)id-gatedNaN point not drawn
BarCharttime · value · category⚠️ single-series vertical onlyid-gatedNaN bucket → no bar
BoxPlottime · value✅ but opts out of crosshair x-snapbox missing a present quantile → nothing
Candlesticktime onlyparticipates in crosshair x-snapcandle missing any OHLC → nothing

Only ScatterChart and BarChart are selectable (both gated on an id). The BoxPlot-opts-out / Candlestick-opts-in crosshair asymmetry is the one to remember. category axis is BarChart-only (its categories mode).

Container, row & axis knobs

The composition props, one line each. Full detail on Axes, Layout, and Interaction.

<ChartContainer>

PropDefaultWhat
width— (req)Total width in CSS px (plot + gutters). Real pixels, not %.
rangeauto-fitShared x domain [begin, end] or TimeRange.
themedefaultThemeThe one ChartTheme — see Theming.
cursor'line'In-chart cursor mode (line/point/inline/flag/crosshair/region/none).
calendarTrading-time axis from a TradingCalendar (+ spacing).
sessionDividers'none'Session-seam verticals: 'labeled' / 'all' / 'none'.
gridtrueReference gridlines behind the data.
rowGap0Vertical space between stacked rows (px).
showAxistrueAuto-render the shared x axis under the rows.
timeFormatd3 multi-scaleTime-axis + cursor-time formatting.
panZoomfalseDrag-to-pan + wheel-to-zoom.

<ChartRow>

PropDefaultWhat
height— (req)Row height in CSS px.
cursorinheritsPer-row override of the container cursor mode.

<YAxis> / <XAxis>

PropOnWhat
idYAxisScale id a layer binds to via axis; first-declared = row default.
sideYAxis'left' (default) / 'right'.
min / maxYAxisExplicit domain bounds; omit to auto-fit.
formatY/XAxisd3 specifier or (v) => string; hoist an inline function.
dateStyleXAxisTime axis: 'flat' (default) inline periods / 'stacked' band row.
transformXAxisRelabel the same scale into a derived unit (dual x-axis).

Also