Skip to content

feat(charts): RangeBarChart RowHeight and a pinned Min/Max value axis - #173

Merged
phmatray merged 1 commit into
mainfrom
feat/rangebar-row-height-domain
Oct 28, 2026
Merged

phmatray merged 1 commit into
mainfrom
feat/rangebar-row-height-domain

Conversation

@phmatray

Copy link
Copy Markdown
Owner

Closes #172.

What

RangeBarChart gets three optional parameters (defaults unchanged):

  • RowHeight (px, horizontal only): the chart's height follows its number of categories instead of AspectRatio, so rows stay the same height at any width.
  • Min / Max: pin the value axis. Spans are clipped to it; spans wholly outside it are left out, and RowHeight counts only the rows that remain.

Supporting changes:

  • D3Chart.ViewHeight is now virtual.
  • The loading and error placeholders use the view box's shape (aspect-ratio: W / H) instead of AspectRatio. For every other chart the shape is the same, so they're unaffected.

Why

Measured on a 33-row "runs over the last 24 hours" timeline in a consuming app: the chart was 1830px tall at a 1440 viewport and 5830px at 4K. Also, the axis ran from wherever the oldest run was to +5 hours, because nice() rounded past "now".

Tests

  • node: a new rangebar layout test covering a pinned window, clipping, dropped spans, one pinned end, and an empty window. layouts.fixture.json re-recorded with record-layouts.mjs. All 199 node tests pass.
  • bUnit: new tests for the RowHeight height (placeholder, spec and viewBox), the Min/Max spec, and the unchanged AspectRatio path (no RowHeight, or vertical). All 571 component tests pass.
  • Not run locally: DaisyBlazor.Charts.Server.Tests. The docs site's Tailwind CLI was killed by macOS on this machine (exit 137), so CI is the check for those.

🤖 Generated with Claude Code

A horizontal RangeBarChart was sized by AspectRatio alone, so with many
categories its rows grew with the screen width (a 33-row timeline was
1830px tall at 1440 and 5830px at 4K). RowHeight sizes it by its rows
instead. Min and Max pin the value axis (e.g. -24 to 0 for the last
24 hours); spans are clipped to it and spans wholly outside are left out.

D3Chart.ViewHeight becomes virtual, and the loading and error
placeholders take the view box's shape, so a chart that sets its own
height reserves the right space while it loads.

Closes #172

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phmatray
phmatray merged commit ef05f97 into main Oct 28, 2026
1 check passed
@phmatray
phmatray deleted the feat/rangebar-row-height-domain branch October 28, 2026 09:33
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.

RangeBarChart: fixed row height and a pinned value axis (Min/Max)

1 participant