Skip to content

LineSeries

Read as Markdown

Import LineSeries and its types from @pibbl/core/viz. LineSeriesProps<D> requires data, x, y, xScale, and yScale. Data is a readonly array or a core signal of an array. It is not a thunk. Replace arrays to notify consumers; mutation alone is not reactive.

LineAccessor<D> accepts a property key whose value is a LineCoordinate, or (datum, index, data) => LineCoordinate. A coordinate is a number, null, or undefined. Function accessors run during component evaluation; signal reads inside them belong to the series. Row fields are not recursively unwrapped.

defined(datum, index, data) runs before coordinate accessors. False, missing, NaN, or infinite coordinates split the line into separate runs. Isolated points paint nothing. Input order is preserved; points are never sorted. LineCurve currently supports only "linear" (the default).

LineSeriesStyle is one static style across every run, with signal-valued whole style/direct fields: stroke (default #2563eb), strokeWidth (2), opacity (1), cursor, and lineInteractionWidth (defaults to strokeWidth). Widths must be finite and nonnegative; opacity is between 0 and 1. No per-datum style callback, segment styling, fill, or area is implemented.

One core Path owns the complete batch’s paint and stroke hit geometry. Ordinary core event handlers and pointerEvents work on that target; gaps remain gaps for hit testing. There is no nearest-point event enrichment. Applications can compose inspection or brushing with useLinearScale and core targets. Wrap the series in a core Clip for clipping; scales do not clip automatically.

Draws a scaled line through defined data values, leaving gaps for undefined values.

LineSeries: <D>({ data: dataInput, x: xInput, y: yInput, xScale: xId, yScale: yId, defined, curve, style: styleInput, ...eventProps }: LineSeriesProps<D>) => JSX.Element

Related API: LineSeries, LineSeriesProps, JSX.

  • props — Data, coordinate accessors, scales, and line styling. See LineSeriesProps.

Pibbl nodes drawing the data as a line series.

LineSeriesProps

View source — packages/core/src/features/viz/lib/line-series.tsx:22

A numeric series coordinate, or a missing value that can create a gap.

type LineCoordinate = number | null | undefined

Related API: LineCoordinate.

LineAccessor

View source — packages/core/src/features/viz/lib/types.ts:378

A data property or callback that extracts a numeric series coordinate.

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

Related API: LineAccessor, LineCoordinate.

  • datum — Datum whose coordinate is being read.

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

  • data — Complete source data array.

The datum’s coordinate, including the supported missing-value sentinel. See LineCoordinate .

LineCoordinate

LineSeriesProps

PointAccessor

View source — packages/core/src/features/viz/lib/types.ts:392

The supported interpolation mode for a line series.

type LineCurve = "linear"

Related API: LineCurve.

LineSeriesProps

View source — packages/core/src/features/viz/lib/types.ts:400

Supported geometry and presentation properties for LineSeries.

interface LineSeriesStyle

Related API: LineSeriesStyle.

StrokeStyle

LineSeriesProps

View source — packages/core/src/features/viz/lib/types.ts:407

stroke (optional)
readonly stroke?: StrokeStyle | undefined

Related API: StrokeStyle.

Paint used for the outline. See StrokeStyle.

View source — packages/core/src/features/viz/lib/types.ts:409

strokeWidth (optional)
readonly strokeWidth?: number | undefined

Width of the painted outline. See LineSeriesStyle.

View source — packages/core/src/features/viz/lib/types.ts:411

opacity (optional)
readonly opacity?: number | undefined

Related API: opacity.

Opacity of the painted result. See LineSeriesStyle.

View source — packages/core/src/features/viz/lib/types.ts:413

cursor (optional)
readonly cursor?: string | undefined

Cursor shown while this target owns pointer presentation. See LineSeriesStyle.

View source — packages/core/src/features/viz/lib/types.ts:415

lineInteractionWidth (optional)
readonly lineInteractionWidth?: number | undefined

Width used for line hit testing independently of the visible stroke width. See LineSeriesStyle.

View source — packages/core/src/features/viz/lib/types.ts:420

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

interface LineSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions

Related API: LineSeriesProps, PibblEventHandlers, PibblEventParticipationOptions.

PibblEventHandlers

PibblEventParticipationOptions

SignalValue

LineAccessor

ScaleId

LineCurve

SignalStyle

LineSeriesStyle

View source — packages/core/src/features/viz/lib/types.ts:434

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/types.ts:439

x
readonly x: LineAccessor<D>

Related API: LineAccessor.

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

View source — packages/core/src/features/viz/lib/types.ts:441

y
readonly y: LineAccessor<D>

Related API: LineAccessor.

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

View source — packages/core/src/features/viz/lib/types.ts:443

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/types.ts:445

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/types.ts:447

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

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

  • 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/types.ts:456

curve (optional)
readonly curve?: "linear" | undefined

Interpolation mode used to connect successive defined samples. See LineCurve.

View source — packages/core/src/features/viz/lib/types.ts:458

style (optional)
readonly style?: SignalValue<Readonly<{ readonly stroke?: SignalValue<StrokeStyle | undefined>; readonly strokeWidth?: SignalValue<number | undefined>; readonly opacity?: SignalValue<number | undefined>; readonly cursor?: SignalValue<string | undefined>; readonly lineInteractionWidth?: SignalValue<number | undefined>; }>> | undefined

Related API: SignalValue, StrokeStyle, opacity.

Declared presentation and layout properties. See SignalValue, SignalStyle, LineSeriesStyle.

View source — packages/core/src/features/viz/lib/types.ts:463

pointerEvents (optional)
readonly pointerEvents?: PibblPointerEvents | undefined

Related API: PibblPointerEvents.

Whether this content participates in pointer targeting. See PibblPointerEvents.

View source — packages/core/src/lib/events/types.ts:126

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.