Skip to content

feat: ReferenceLine + ReferenceArea annotation parts#9

Open
DloomPlz wants to merge 1 commit into
Boring-Software-Inc:mainfrom
DloomPlz:feat/reference-parts
Open

feat: ReferenceLine + ReferenceArea annotation parts#9
DloomPlz wants to merge 1 commit into
Boring-Software-Inc:mainfrom
DloomPlz:feat/reference-parts

Conversation

@DloomPlz

Copy link
Copy Markdown

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.

Two composable annotation parts for the cartesian charts, rendered in the
front SVG layer with the same shadcn theme tokens as the rest of the
chrome:

- <ReferenceLine value label? tone? variant dashed?> — a horizontal line
  at a y-value with an optional right-aligned label pill. quiet (muted
  hairline + popover pill, for readouts like hover min/max) or solid
  (seed-toned, for hard limits like a liquidation price). Hidden when the
  value falls outside the y-domain.
- <ReferenceArea x1? x2? y1? y2? tone? label?> — a low-alpha band; x edges
  are row indices (vertical band, e.g. an outage window), y edges are
  domain values (horizontal band, e.g. a danger zone); omitted edges span
  the plot.

Both ship in core (chrome). Registry JSON regenerated via npm run build.
@tripwire-dev

tripwire-dev Bot commented Jul 13, 2026

Copy link
Copy Markdown

passed — nothing tripped. good to merge.

View on Tripwire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant