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, its theme slot, and its one sharp edge. (The View-builder column exposes the chart-ready view shape for custom draw code — starting from a pond series, the component itself is the whole contract.)

LayerSeries / inputKey columnsView builderTheme slotSharp edge
LineChartTimeSeries | ValueSeriesone numeric columnfromTimeSeriestheme.linecurve smooths the drawing, not the data — denoise with smooth().
AreaChartTimeSeries | ValueSeriesone column, fill from baselinefromTimeSeriestheme.areaGaps couple fill+outline; fill must be CSS hex.
BandChartTimeSeries | ValueSeriestwo columns lower + upperbandFromTimeSeriestheme.bandAlways breaks on a gap (no gaps prop, by design).
ScatterChartTimeSeries | ValueSeriescolumn (y) + optional radius/color colsfromTimeSeriestheme.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 optboxFromTimeSeriestheme.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.

Row lists — standalone (no ChartContainer)​

One DOM table row per entity on one shared value scale; label + data cells, sortBy/custom sort, per-row expander, reference markers. Not draw layers — the in-plot histogram stays <BarChart orientation="horizontal">.

ComponentInputKey propsReaderTheme slotSharp edge
BarListseries or rows: ListRow[]columns (values names), cells, sort, renderExpandedseries direct (or ListRow[] records)theme.barNon-negative values assumed (length-encoded from the domain min).
BoxListseries or rows: ListRow[]five-number names + value tick per column, same table propsfacts by hand (partitionBy + reduce spread)theme.boxDoesn't compute quantiles; q1/q3 both-or-neither throws.

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 modes—gaps 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 only✅ id-gatedNaN bucket → no bar
BoxPlottime · value✅ crosshair snaps to the nearest quantile—box missing a present quantile → nothing
Candlesticktime only✅ participates in crosshair x-snap—candle missing any OHLC → nothing

Only ScatterChart and BarChart are selectable (both gated on an id). 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.
calendar—Trading-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).
showAxisautoAuto-render the shared x axis; a mounted <XAxis> replaces it.
timeFormatd3 multi-scaleTime-axis + cursor-time formatting.
panZoomfalseDrag-to-pan + wheel-to-zoom.

<ChartRow>​

PropDefaultWhat
height— (req)Row height in CSS px.

Cursors​

Mount one inside <ChartContainer> to get a cursor — or inside a <ChartRow> to override it for that row. Mount none for no cursor.

ComponentWhat
<LineCursor />Synced vertical line (showTime for the time atop).
<PointCursor />A dot on each series, no line.
<InlineCursor />Dots plus a value chip beside each series.
<FlagCursor />Dots plus value flags.
<CrosshairCursor />Snapped reticle + axis pills (snap, format).
<RangeCursor />Bucket shading + drag-to-select (sequence, onDragRelease).

<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​