Render min/max-decimated series as range bars / OHLC instead of a polyline #112

Closed
opened 2026-06-22 14:34:04 +02:00 by Brummel · 1 comment
Owner

Follow-up to #111 (the line/mean half). The decimation reduction is now tap-aware:
a bounded level series (exposure) reduces by per-bucket mean and renders as a
clean line; an envelope series (equity) keeps per-bucket min/max. But the
min/max series is still drawn as a uPlot polyline through the (min, max) pairs —
i.e. range data drawn as a line. That is acceptable for equity (its per-bucket range
is tiny against the curve, so it reads fine), but it is not the honest rendering: the
diagonal min→max segments imply a path the value did not take.

The right model (user, 2026-06-22)

  • min/max (range data) → bar chart, possibly OHLC (open = first, high = max,
    low = min, close = last value in the bucket — the full faithful downsample).
  • mean (point data) → line chart — already done in #111.

Scope

This is a rendering-model change, NOT a hotfix:

  • the chart payload reshapes from the current 2-x-slots-per-bucket line spine to
    one x per bucket carrying a range (lo/hi) for an envelope series and a single
    value for a level series — so Series becomes line-shaped or band/OHLC-shaped;
  • chart-viewer.js buildCharts draws a range series as uPlot bars / a band
    (uPlot.paths.bars or the band-fill feature), a level series as a line; OHLC is a
    custom candlestick path (the largest part);
  • the headless .mjs guards (chart_viewer_build / gaps / xmode / label) assert on
    the line-data shape and must be updated;
  • the render tests + cli_run.rs E2E that assert on the injected series shape follow.

A reasonable staging: range bars first (small, covers equity honestly), OHLC
candles only if the open/close direction is wanted.

context: surfaced demonstrating cut 2 (#108) — the exposure band; the mean/line half
shipped as #111, this is the deferred bar/OHLC half.
depends on: #111 (ReduceKind, the tap-aware reduction — the foundation this builds the
render shape on).

Follow-up to #111 (the line/mean half). The decimation reduction is now tap-aware: a bounded **level** series (exposure) reduces by per-bucket **mean** and renders as a clean line; an **envelope** series (equity) keeps per-bucket **min/max**. But the min/max series is still drawn as a uPlot **polyline** through the (min, max) pairs — i.e. range data drawn as a line. That is acceptable for equity (its per-bucket range is tiny against the curve, so it reads fine), but it is not the honest rendering: the diagonal min→max segments imply a path the value did not take. ## The right model (user, 2026-06-22) - **min/max (range data) → bar chart**, possibly **OHLC** (open = first, high = max, low = min, close = last value in the bucket — the full faithful downsample). - **mean (point data) → line chart** — already done in #111. ## Scope This is a rendering-model change, NOT a hotfix: - the chart payload reshapes from the current 2-x-slots-per-bucket line spine to **one x per bucket** carrying a range (lo/hi) for an envelope series and a single value for a level series — so `Series` becomes line-shaped or band/OHLC-shaped; - `chart-viewer.js` `buildCharts` draws a range series as uPlot bars / a band (`uPlot.paths.bars` or the band-fill feature), a level series as a line; OHLC is a custom candlestick path (the largest part); - the headless `.mjs` guards (chart_viewer_build / gaps / xmode / label) assert on the line-data shape and must be updated; - the render tests + `cli_run.rs` E2E that assert on the injected series shape follow. A reasonable staging: range **bars** first (small, covers equity honestly), OHLC **candles** only if the open/close direction is wanted. context: surfaced demonstrating cut 2 (#108) — the exposure band; the mean/line half shipped as #111, this is the deferred bar/OHLC half. depends on: #111 (ReduceKind, the tap-aware reduction — the foundation this builds the render shape on).
Brummel added the idea label 2026-06-22 14:34:04 +02:00
Collaborator

Closed as ratified drop (owner decision, 2026-07-21, idea-cull round): chart cosmetics. The honest core (the min/max polyline implies a false path) will resurface the moment chart work is next touched; nothing blocks on it meanwhile.

Closed as ratified drop (owner decision, 2026-07-21, idea-cull round): chart cosmetics. The honest core (the min/max polyline implies a false path) will resurface the moment chart work is next touched; nothing blocks on it meanwhile.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#112