Skip to content

Censored point series

Read as Markdown

CensoredPointSeries draws supplied numerical observations as circles and reporting limits as open directional markers. It is designed for assay and laboratory datasets where a result may be reported as below an LLOQ or above a ULOQ without inventing an exact measurement.

import { Absolute } from "@pibbl/core";
import { CensoredPointSeries, LinearScale, LogScale } from "@pibbl/core/viz";
const samples = [
{ hour: 0.25, concentration: 0.5, reporting: "below" as const },
{ hour: 2, concentration: 12.8, reporting: "observed" as const },
{ hour: 24, concentration: 50, reporting: "above" as const },
];
<Absolute style={{ left: 64, top: 32, width: 600, height: 320 }}>
<LinearScale id="time" domain={[0, 24]} range={[0, 600]}>
<LogScale id="concentration" domain={[0.25, 100]} range={[320, 0]}>
<CensoredPointSeries
data={samples}
x="hour"
y="concentration"
censoring="reporting"
xScale="time"
yScale="concentration"
/>
</LogScale>
</LinearScale>
</Absolute>;

Required inputs are data, x, y, censoring, xScale, and yScale. x and y are numeric property keys or synchronous accessors. censoring is a property key or callback returning one of "observed", "below", or "above". Both scales are ancestor continuous scales: linear, UTC, log, or symlog.

For below and above, the supplied y is the laboratory reporting limit, not a replacement observation. below points toward decreasing y-domain values; above points toward increasing y-domain values. Direction stays semantically correct for reversed ranges and reversed domains. The component performs no imputation, substitution, model fitting, or inference.

Rows with a nullish/non-finite coordinate or status are omitted. Unknown non-null statuses throw. A log scale rejects nonpositive reporting limits under its normal scale contract. defined runs before the accessors and can exclude a row. Accessors cannot call hooks or write signals during rendering.

style accepts a whole-object signal and shallow field signals. radius defaults to 4 pixels, fill (observed circles only) and stroke default to #087f8c, strokeWidth defaults to 1.5 pixels, and opacity defaults to 1. The censor markers are always open. Zero radius hides all marks. Records retain source paint order and use two ordinary batched Path targets. Series event handlers receive ordinary bubbled mark events; they do not infer a datum.

The censored concentration-time assay shows synthetic LLOQ and ULOQ results with an application-owned accessible table.

Draws supplied numeric observations as circles and below/above reporting limits as open arrows.

below points toward decreasing y-domain values and above toward increasing y-domain values, including when the y scale uses a reversed domain or range. The supplied y value remains the reporting limit; this component never substitutes a measurement, imputes a value, or fits a model.

CensoredPointSeries: <D>({ data: input, x: xInput, y: yInput, censoring: censoringInput, xScale: xId, yScale: yId, defined, style: styleInput, pointerEvents, ...events }: CensoredPointSeriesProps<D>) => JSX.Element

Related API: CensoredPointSeries, CensoredPointSeriesProps, JSX.

Two ordinary batched paths for observed and open censored marks.

CensoredPointSeriesProps

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

A supplied assay reporting status. below and above retain the supplied reporting limit.

type CensoringStatus = "observed" | "below" | "above"

Related API: CensoringStatus.

CensoredPointSeriesProps

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

Extracts an observation’s supplied reporting status.

type CensoringAccessor<D> = | {
[K in keyof D]-?: D[K] extends CensoringStatus | null | undefined
? K
: never;
}[keyof D]
| ((
datum: D,
index: number,
data: readonly D[],
) => CensoringStatus | null | undefined)

Related API: CensoringAccessor, CensoringStatus.

  • datum — Original record being read.

  • index — Zero-based source index.

  • data — Complete supplied record array.

The supplied status, or a nullish sentinel that omits the record.

CensoringStatus

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

Authored inputs for supplied observed and censored numeric observations.

interface CensoredPointSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions

Related API: CensoredPointSeriesProps, PibblEventHandlers, PibblEventParticipationOptions.

CensoredPointSeries

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

data
readonly data: SignalValue<readonly D[]>

Related API: SignalValue.

Original records, or a signal of records. The series performs no imputation or inference.

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

x
readonly x: LineAccessor<D>

Related API: LineAccessor.

Property or callback supplying the numeric horizontal coordinate.

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

y
readonly y: LineAccessor<D>

Related API: LineAccessor.

Property or callback supplying the numeric vertical value or reporting limit.

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

censoring
readonly censoring: CensoringAccessor<D>

Related API: CensoringAccessor.

Property or callback yielding observed, below, or above.

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

xScale
readonly xScale: ScaleId

Related API: ScaleId.

Ancestor continuous numeric scale mapping x.

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

yScale
readonly yScale: ScaleId

Related API: ScaleId.

Ancestor continuous numeric scale mapping y and its reporting limit.

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

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

Optional synchronous predicate; excluded rows contribute no mark.

  • datum — Original record being tested.

  • index — Zero-based source index.

  • data — Complete supplied record array.

Whether this record contributes a mark.

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

style (optional)
readonly style?: SignalValue<Readonly<{ readonly radius?: SignalValue<number | undefined>; 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 style; whole-object and shallow field signals are observed by the series.

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

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 mark paint and local-pixel geometry for CensoredPointSeries.

interface CensoredPointSeriesStyle

Related API: CensoredPointSeriesStyle.

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

radius (optional)
readonly radius?: number | undefined

Circle and open censor marker radius in local pixels; defaults to 4.

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

fill (optional)
readonly fill?: FillStyle | undefined

Related API: FillStyle.

Fill for observed circles; defaults to #087f8c. Censor markers remain open.

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

stroke (optional)
readonly stroke?: StrokeStyle | undefined

Related API: StrokeStyle.

Outline for circles and open directional censor markers; defaults to #087f8c.

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

strokeWidth (optional)
readonly strokeWidth?: number | undefined

Outline width in local pixels; defaults to 1.5.

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

opacity (optional)
readonly opacity?: number | undefined

Related API: opacity.

Shared paint opacity from zero to one; defaults to 1.

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

cursor (optional)
readonly cursor?: string | undefined

Cursor for painted mark targets.

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

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.