Skip to content

PlotSeries

Read as Markdown

Import from @pibbl/core/viz. Supply data, numeric x/y accessors, xScale, yScale, and render(datum,index,data). The callback returns Pibbl nodes around local (0,0) at the mapped point. Invalid coordinates and defined=false skip rows. Custom elements keep ordinary styles, targets, and event handlers.

Use keyBy="id" or a key accessor for identity across reorder. Without keyBy, original source indices are keys. Removing or invalidating a row unmounts it; returning null retains the row wrapper. Keys normalize as Pibbl string/number keys.

The render callback constructs nodes; hooks belong in returned components. Its explicit signal reads belong to the row receiver. Series handler props are structural propagation listeners, with no independent hit geometry. Apply pointerEvents, cursor, and styles to returned elements.

Marks inherit the plot allocation and are translated without resizing or centering. Percentage lengths retain that allocation until an inner container changes it. Each row costs its normal component subtree; use PointSeries for large dot batches, optionally overlaid with a few custom PlotSeries annotations.

Places keyed custom Pibbl subtrees at local data coordinates.

PlotSeries: <D>({ data: input, x: xInput, y: yInput, xScale: xId, yScale: yId, defined, keyBy, render, ...events }: PlotSeriesProps<D>) => PibblNode

Related API: PlotSeries, PlotSeriesProps, PibblNode.

  • props — Data, coordinate accessors, scales, keys, and per-datum renderer. See PlotSeriesProps .

Pibbl nodes placing each rendered datum at its mapped coordinates. See PibblNode.

PlotSeriesProps

PibblNode

View source — packages/core/src/features/viz/lib/plot-series.tsx:29

Authored inputs for PlotSeries, including the declared data and presentation options.

interface PlotSeriesProps<D> extends PibblEventHandlers

Related API: PlotSeriesProps, PibblEventHandlers.

PibblEventHandlers

SignalValue

PointAccessor

ScaleId

PlotKeyAccessor

PibblNode

PlotSeries

View source — packages/core/src/features/viz/lib/plot-types.ts:31

data
readonly data: SignalValue<readonly D[]>

Related API: SignalValue.

Application data supplied to the component or reported by the event. See SignalValue.

View source — packages/core/src/features/viz/lib/plot-types.ts:35

x
readonly x: PointAccessor<D>

Related API: PointAccessor.

Property key or callback extracting the horizontal domain coordinate. See PointAccessor.

View source — packages/core/src/features/viz/lib/plot-types.ts:37

y
readonly y: PointAccessor<D>

Related API: PointAccessor.

Property key or callback extracting the vertical domain coordinate. See PointAccessor.

View source — packages/core/src/features/viz/lib/plot-types.ts:39

xScale
readonly xScale: ScaleId

Related API: ScaleId.

The scale used to map horizontal data coordinates. See ScaleId.

View source — packages/core/src/features/viz/lib/plot-types.ts:41

yScale
readonly yScale: ScaleId

Related API: ScaleId.

The scale used to map vertical data coordinates. See ScaleId.

View source — packages/core/src/features/viz/lib/plot-types.ts:43

defined (optional)
readonly defined?: ((datum: D, index: number, data: readonly D[]) => boolean) | undefined

Returns whether a datum contributes drawable or queryable coordinates. See PlotSeriesProps.

  • datum — Datum to test.

  • index — Zero-based index in the source data.

  • data — Complete source data array.

Whether this datum should participate in the series or query.

View source — packages/core/src/features/viz/lib/plot-types.ts:52

keyBy (optional)
readonly keyBy?: PlotKeyAccessor<D> | undefined

Related API: PlotKeyAccessor.

Property or callback supplying stable identity for each datum. See PlotKeyAccessor.

View source — packages/core/src/features/viz/lib/plot-types.ts:54

render
readonly render: (datum: D, index: number, data: readonly D[]) => PibblNode

Related API: PibblNode.

Renders the current data or resources using the supplied context. See PibblNode.

  • datum — Datum to render.

  • index — Zero-based index in the source data.

  • data — Complete source data array.

Pibbl content to place at the datum’s mapped coordinates. See PibblNode.

View source — packages/core/src/features/viz/lib/plot-types.ts:62

A property or callback that provides stable identity for a plotted datum.

type PlotKeyAccessor<D> = | { [K in keyof D]-?: D[K] extends string | number ? K : never }[keyof D]
| ((datum: D, index: number, data: readonly D[]) => string | number)

Related API: PlotKeyAccessor.

  • datum — Datum requiring an identity.

  • index — Zero-based index in the source data.

  • data — Complete source data array.

A stable string or numeric key for the datum.

PlotSeriesProps

PieOptions

View source — packages/core/src/features/viz/lib/plot-types.ts:17

Read the Data visualization companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision 380919b. ALPHA — NOT FOR PRODUCTION USE.