Skip to content

Paired series

Read as Markdown

PairedSeries connects two supplied outcomes in each wide record. Both endpoints must be observed; an incomplete pair contributes no segment. It does not match subjects across tables, calculate change, or replace missing outcomes. Compose PointSeries for endpoint circles, including unpaired observations.

import { PairedSeries } from "@pibbl/core/viz";
const participants = [
{ id: "P01", baseline: 62, week12: 44 },
{ id: "P02", baseline: 58, week12: null },
];
<PairedSeries
data={participants}
before="baseline"
after="week12"
beforeX="Baseline"
afterX="Week 12"
xScale="endpoint"
yScale="score"
style={{ stroke: "#087f8c" }}
/>;

Required props are data, before, after, beforeX, afterX, xScale, and yScale. Outcome accessors are numeric field keys or synchronous callbacks. Endpoint x coordinates are explicit numeric or PointScale category positions. Missing or nonfinite outcomes omit the entire pair. Unknown PointScale endpoint categories throw under the standard series coordinate contract; continuous x coordinates must be numeric. defined excludes a record before outcome accessors run. Lines retain source encounter order.

Shared style supports stroke (default #2563eb), strokeWidth (default 2 local units), opacity (default 1), cursor, and lineInteractionWidth (default stroke width). Whole-object and shallow field signals schedule updates. Each component returns one batched ordinary Pibbl Path, with standard events and pointerEvents. Events do not infer a participant or datum. Accessors are synchronous and cannot call hooks or write signals. The component owns no retained resources or statistical state.

Draws a connector for each complete wide-record before/after pair.

The component does not manufacture point marks, calculate change, select a baseline, or impute missing observations. Compose PointSeries for endpoints.

PairedSeries: <D>({ data: input, before: beforeInput, after: afterInput, beforeX, afterX, xScale: xId, yScale: yId, defined, style: styleInput, ...events }: PairedSeriesProps<D>) => JSX.Element

Related API: PairedSeries, PairedSeriesProps, JSX.

  • props — Wide records, endpoint accessors and coordinates, scales, and shared paint.

One batched ordinary Pibbl path containing source-ordered pair connectors.

PairedSeriesProps

View source — packages/core/src/features/viz/lib/paired-series.tsx:109

Authored wide-record inputs for PairedSeries.

interface PairedSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions

Related API: PairedSeriesProps, PibblEventHandlers, PibblEventParticipationOptions.

View source — packages/core/src/features/viz/lib/paired-series.tsx:24

data
readonly data: SignalValue<readonly D[]>

Related API: SignalValue.

Source records or a signal containing them.

View source — packages/core/src/features/viz/lib/paired-series.tsx:27

before
readonly before: LineAccessor<D>

Related API: LineAccessor.

Numeric baseline or first-observation value.

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

after
readonly after: LineAccessor<D>

Related API: LineAccessor.

Numeric follow-up or second-observation value.

View source — packages/core/src/features/viz/lib/paired-series.tsx:31

beforeX
readonly beforeX: SeriesCoordinate

Related API: SeriesCoordinate.

Fixed x coordinate used for every before endpoint.

View source — packages/core/src/features/viz/lib/paired-series.tsx:33

afterX
readonly afterX: SeriesCoordinate

Related API: SeriesCoordinate.

Fixed x coordinate used for every after endpoint.

View source — packages/core/src/features/viz/lib/paired-series.tsx:35

xScale
readonly xScale: ScaleId

Related API: ScaleId.

Scale mapping the two endpoint coordinates.

View source — packages/core/src/features/viz/lib/paired-series.tsx:37

yScale
readonly yScale: ScaleId

Related API: ScaleId.

Numeric scale mapping both endpoint values.

View source — packages/core/src/features/viz/lib/paired-series.tsx:39

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

Excludes a record before before/after accessors run.

  • datum — Candidate source datum.

  • index — Zero-based source index.

  • data — Complete source data array.

Whether this record contributes a connector.

View source — packages/core/src/features/viz/lib/paired-series.tsx:47

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

Related API: SignalValue, StrokeStyle, opacity.

Shared connector style, including whole-object and shallow field signals.

View source — packages/core/src/features/viz/lib/paired-series.tsx:49

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

Shared connector appearance for PairedSeries.

type PairedSeriesStyle = TrajectorySeriesStyle

Related API: PairedSeriesStyle, TrajectorySeriesStyle.

View source — packages/core/src/features/viz/lib/paired-series.tsx:21

stroke (optional)
readonly stroke?: StrokeStyle | undefined

Related API: StrokeStyle.

Path paint. Defaults to #2563eb.

View source — packages/core/src/features/viz/lib/trajectory-series.tsx:23

strokeWidth (optional)
readonly strokeWidth?: number | undefined

Visible path width in local units. Defaults to 2.

View source — packages/core/src/features/viz/lib/trajectory-series.tsx:25

lineInteractionWidth (optional)
readonly lineInteractionWidth?: number | undefined

Pointer targeting width. Defaults to strokeWidth.

View source — packages/core/src/features/viz/lib/trajectory-series.tsx:27

opacity (optional)
readonly opacity?: number | undefined

Related API: opacity.

Path opacity in [0, 1]. Defaults to 1.

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

cursor (optional)
readonly cursor?: string | undefined

Cursor while the batched path owns pointer presentation.

View source — packages/core/src/features/viz/lib/trajectory-series.tsx:31

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 dd39ce2. ALPHA — NOT FOR PRODUCTION USE.