Skip to content

Weighted point series

Read as Markdown

WeightedPointSeries maps x and y observations and converts a supplied weight to circle area. It does not calculate precision, sample size, effect estimates, or any statistical summary.

import { WeightedPointSeries } from "@pibbl/core/viz";
const assayObservations = [{ concentration: 1, inhibition: 49, precision: 64 }];
<WeightedPointSeries
data={assayObservations}
x="concentration"
y="inhibition"
weight="precision"
xScale="concentration"
yScale="inhibition"
weightDomain={[0, 100]}
radiusRange={[0, 10]}
/>;

Required props are data, x, y, weight, xScale, yScale, and weightDomain. Coordinate and weight accessors are field keys or synchronous callbacks. Both coordinate scales follow PointSeries: each can be continuous or categorical where supported by the selected scale.

weightDomain is [0, maximum], where maximum is finite and positive. The zero baseline is required so a mark’s area is proportional to its supplied weight. radiusRange is [0, maximumRadius] and defaults to [0, 6] local units. The radius is maximumRadius * sqrt(weight / maximum). A zero or nullish weight omits a mark; negative, nonfinite, and out-of-domain weights throw. The component never clamps or infers a weight.

style is shared across marks and supports whole-object and shallow signals. Its fields are fill (default #087f8c), stroke, strokeWidth (default 1), opacity (default 1), and cursor. Radius is intentionally derived only from weight. defined omits a record before other accessors run. Missing coordinates omit that record under the ordinary series contract.

Marks retain source paint order and are batched into one ordinary Pibbl pointer target. Series event handlers receive ordinary bubbled events rather than an inferred datum. Use pointerEvents="none" for decorative points. Signals update on Pibbl’s scheduler; the component owns no retained resources or inference state.

Draws batched circles whose visible area is proportional to supplied weights.

Nullish weights and zero weights omit their marks. Finite positive weights must fall inside weightDomain; the component never clamps or infers weights. data and shared style signals schedule ordinary Pibbl updates. The component owns no retained resources and returns one ordinary Pibbl pointer target.

WeightedPointSeries: <D>({ data: input, x: xInput, y: yInput, weight: weightInput, xScale: xId, yScale: yId, weightDomain, radiusRange, defined, style: styleInput, ...events }: WeightedPointSeriesProps<D>) => JSX.Element

Related API: WeightedPointSeries, WeightedPointSeriesProps, JSX.

One batched Pibbl Path whose mark area is proportional to each supplied weight.

WeightedPointSeriesProps

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:175

Authored inputs for WeightedPointSeries.

Weights are supplied data, not calculated precision, sample size, or evidence. The zero baseline and squared-radius interpolation make displayed area linear in the supplied weight.

interface WeightedPointSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions

Related API: WeightedPointSeriesProps, PibblEventHandlers, PibblEventParticipationOptions.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:52

data
readonly data: SignalValue<readonly D[]>

Related API: SignalValue.

Readonly data or a signal containing it.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:55

x
readonly x: SeriesAccessor<D>

Related API: SeriesAccessor.

Horizontal coordinate property or synchronous accessor.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:57

y
readonly y: SeriesAccessor<D>

Related API: SeriesAccessor.

Vertical coordinate property or synchronous accessor.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:59

weight
readonly weight: WeightAccessor<D>

Related API: WeightAccessor.

Nonnegative supplied weight property or synchronous accessor.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:61

xScale
readonly xScale: ScaleId

Related API: ScaleId.

Scale used to map x coordinates.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:63

yScale
readonly yScale: ScaleId

Related API: ScaleId.

Scale used to map y coordinates.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:65

weightDomain
readonly weightDomain: readonly [0, number]

Supplied inclusive weight extent. The lower bound must be zero.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:67

radiusRange (optional)
readonly radiusRange?: readonly [0, number] | undefined

Radius extent [0, maximumRadius]; defaults to [0, 6].

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:69

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

Excludes a datum before coordinate and weight accessors run.

  • datum — Candidate source datum.

  • index — Zero-based source index.

  • data — Complete source data array.

Whether this datum contributes a mark.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:77

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

Related API: SignalValue, FillStyle, StrokeStyle, opacity.

Shared presentation. Whole-object and shallow field signals are supported.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:79

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 presentation for WeightedPointSeries.

interface WeightedPointSeriesStyle

Related API: WeightedPointSeriesStyle.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:32

fill (optional)
readonly fill?: FillStyle | undefined

Related API: FillStyle.

Paint used for point interiors. Defaults to #087f8c.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:34

stroke (optional)
readonly stroke?: StrokeStyle | undefined

Related API: StrokeStyle.

Paint used for point outlines. Defaults to no outline.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:36

strokeWidth (optional)
readonly strokeWidth?: number | undefined

Outline width in local coordinate units. Defaults to 1.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:38

opacity (optional)
readonly opacity?: number | undefined

Related API: opacity.

Opacity in the inclusive range [0, 1]. Defaults to 1.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:40

cursor (optional)
readonly cursor?: string | undefined

Pointer cursor while the series owns a target.

View source — packages/core/src/features/viz/lib/weighted-point-series.tsx:42

A data property or callback extracting a nonnegative research weight.

type WeightAccessor<D> = LineAccessor<D>

Related API: WeightAccessor, LineAccessor.

WeightedPointSeriesProps

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

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.