Skip to content

Summary interval diamonds

Read as Markdown

Import IntervalDiamondSeries from @pibbl/core/viz. It renders supplied summary results without estimating weights, pooling effects, or calculating confidence intervals. Use it alongside ordinary study marks in a forest plot.

import {
IntervalDiamondSeries,
LinearScale,
PointScale,
} from "@pibbl/core/viz";
const summaries = [
{ analysis: "Supplied summary", estimate: 0.72, lower: 0.58, upper: 0.89 },
];
const result = (
<PointScale id="analyses" domain={["Supplied summary"]} range={[40, 40]}>
<LinearScale id="effect" domain={[0, 1.5]} range={[20, 300]}>
<IntervalDiamondSeries
data={summaries}
category="analysis"
estimate="estimate"
lower="lower"
upper="upper"
categoryScale="analyses"
valueScale="effect"
style={{ height: 12 }}
/>
</LinearScale>
</PointScale>
);
void result;

data accepts a readonly array or signal. Accessors accept field keys or synchronous (datum, index, data) callbacks. categoryScale names an ancestor PointScale or BarScale; band categories use their centers. valueScale names an ancestor continuous numeric scale. Lower and upper bounds map to the horizontal tips; the estimate maps to both perpendicular vertices. Asymmetry is preserved, including on log scales and reversed ranges. No containment, pooling, or confidence level is inferred from category labels.

defined excludes rows before coordinate accessors. Missing/nonfinite coordinates and unknown categories omit the complete row before bounds validation. Included rows require lower <= estimate <= upper. Equal bounds are accepted as degenerate outlined geometry. Invalid log inputs reject under the scale contract. Accessors cannot call hooks or write signals.

Shared style supports whole-object and shallow signals: height (full local pixel height, default 12), fill and stroke (default #087f8c), strokeWidth (default 1.5), lineInteractionWidth (defaults to stroke width), opacity (default 1), and cursor. Sizes must be finite and nonnegative; opacity lies in [0, 1]. Zero height hides all marks. The series returns one batched ordinary Path target. Overlapping contours share one fill/stroke operation and opacity; ordinary handlers do not infer a datum. Use pointerEvents="none" for decorative summaries. Compose explicit Clip, transforms, labels, row controls, and an HTML table as needed. No core runtime changes or new resource lifetime are required.

Draw supplied summary estimates as horizontal diamonds; no pooling or inference. Left/right tips map lower/upper, top/bottom map the estimate. Estimates must lie inside the supplied bounds. Missing/nonfinite rows and unknown categories are omitted; reversed bounds and invalid log values reject included rows. Diamonds share one ordinary Path target; handlers receive ordinary events. Mapping does not clamp or clip. Compose a Clip when required.

IntervalDiamondSeries: <D>(props: IntervalDiamondSeriesProps<D>) => PibblNode

Related API: IntervalDiamondSeries, IntervalDiamondSeriesProps, PibblNode.

  • props — Supplied rows, accessors, categorical/value scales, and shared paint.

One batched Pibbl Path containing the supplied diamonds in source order.

IntervalDiamondSeriesProps

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

Supplied summary estimates and bounds placed horizontally at categorical centers.

interface IntervalDiamondSeriesProps<D> extends Omit<
IntervalSeriesProps<D>,
"style"
>

Related API: IntervalDiamondSeriesProps, IntervalSeriesProps.

IntervalSeriesProps

IntervalDiamondSeriesStyle

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

style (optional)
readonly style?: SignalValue<Readonly<{ readonly height?: SignalValue<number | undefined>; readonly fill?: SignalValue<FillStyle | undefined>; 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, FillStyle, StrokeStyle, opacity.

Whole-object and shallow field signals are observed; per-datum styling is not supported.

View source — packages/core/src/features/viz/lib/interval-diamond-series.tsx:46

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

data
readonly data: SignalValue<readonly D[]>

Related API: SignalValue.

Original records, or a signal of records; no estimation is performed.

View source — packages/core/src/features/viz/lib/interval-series.tsx:48

category
readonly category: BarCategoryAccessor<D>

Related API: BarCategoryAccessor.

Property or callback supplying a category; missing/unknown categories omit rows.

View source — packages/core/src/features/viz/lib/interval-series.tsx:50

estimate
readonly estimate: LineAccessor<D>

Related API: LineAccessor.

Property or callback supplying the numeric point estimate.

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

lower
readonly lower: LineAccessor<D>

Related API: LineAccessor.

Property or callback supplying the numeric lower bound.

View source — packages/core/src/features/viz/lib/interval-series.tsx:54

upper
readonly upper: LineAccessor<D>

Related API: LineAccessor.

Property or callback supplying the numeric upper bound.

View source — packages/core/src/features/viz/lib/interval-series.tsx:56

categoryScale
readonly categoryScale: ScaleId

Related API: ScaleId.

Ancestor PointScale or BarScale; band categories use their centers.

View source — packages/core/src/features/viz/lib/interval-series.tsx:58

valueScale
readonly valueScale: ScaleId

Related API: ScaleId.

Ancestor continuous numeric scale mapping estimate and both bounds independently.

View source — packages/core/src/features/viz/lib/interval-series.tsx:60

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

Optional synchronous predicate; excluded rows contribute no marks.

  • datum — Original record being tested.

  • index — Source index of the record.

  • data — Complete supplied data array.

Whether to include this record’s estimate and interval.

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

Local-pixel height and shared paint for supplied summary diamonds.

interface IntervalDiamondSeriesStyle

Related API: IntervalDiamondSeriesStyle.

IntervalDiamondSeries

View source — packages/core/src/features/viz/lib/interval-diamond-series.tsx:20

height (optional)
readonly height?: number | undefined

Full perpendicular height in local pixels; defaults to 12. Zero hides marks.

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

fill (optional)
readonly fill?: FillStyle | undefined

Related API: FillStyle.

Diamond interior paint; defaults to #087f8c.

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

stroke (optional)
readonly stroke?: StrokeStyle | undefined

Related API: StrokeStyle.

Diamond outline paint; defaults to #087f8c.

View source — packages/core/src/features/viz/lib/interval-diamond-series.tsx:26

strokeWidth (optional)
readonly strokeWidth?: number | undefined

Visible outline width in local pixels; defaults to 1.5.

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

lineInteractionWidth (optional)
readonly lineInteractionWidth?: number | undefined

Outline targeting width in local pixels; defaults to strokeWidth.

View source — packages/core/src/features/viz/lib/interval-diamond-series.tsx:30

opacity (optional)
readonly opacity?: number | undefined

Related API: opacity.

Shared opacity from zero to one; defaults to 1.

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

cursor (optional)
readonly cursor?: string | undefined

Cursor shown over painted diamonds.

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

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.