#9

feat: ReferenceLine + ReferenceArea annotation parts

OpenDloomPlzwants to merge intofrom

Motivation

Real dashboards annotate: a liquidation price, a hover min/max readout, an outage window, a danger zone. Today each consumer rebuilds these as bespoke SVG overlays against the chart's mapping. These are the two primitives we kept reaching for while porting a DeFi dashboard onto the kit — generalized to the same shadcn theme tokens as the rest of the chrome.

What

Two composable front-SVG parts, shipped in core:

<ReferenceLine value={1.1} label="Liquidation 1.10" tone="red" variant="solid" /> A horizontal line at a y-value with an optional right-aligned label pill. quiet = muted hairline + popover-styled pill (readouts); solid = seed-toned line and pill (hard limits). Hidden automatically when the value is outside the y-domain, so hosts pass raw values without clamping.

<ReferenceArea x1={18} x2={24} label="offline" /> / <ReferenceArea y1={0} y2={1.1} tone="red" /> A low-alpha band. x1/x2 are row indices (vertical band — outage/maintenance windows); y1/y2 are domain values (horizontal band — threshold zones); omitted edges span the plot. With a tone the fill uses that seed at 8% alpha, otherwise a muted neutral.

Pairs naturally with #6 (explicit/auto y-domains) but doesn't depend on it. Registry JSON regenerated via npm run build; both parts exported from the index.

Activity

3
tripwire-dev[bot]4mo ago

passed — nothing tripped. good to merge.

DloomPlz4mo ago

Rebased onto the registry/CLI architecture — reference parts are now declared in registry.json + scripts/build-registry.mts CORE_FILES and the r/ JSON is regenerated. Suite green (24/24).