Repository navigation
feat(charts): RangeBarChart RowHeight and a pinned Min/Max value axis - #173
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #172.
What
RangeBarChartgets three optional parameters (defaults unchanged):RowHeight(px, horizontal only): the chart's height follows its number of categories instead ofAspectRatio, 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, andRowHeightcounts only the rows that remain.Supporting changes:
D3Chart.ViewHeightis nowvirtual.aspect-ratio: W / H) instead ofAspectRatio. 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
rangebarlayout test covering a pinned window, clipping, dropped spans, one pinned end, and an empty window.layouts.fixture.jsonre-recorded withrecord-layouts.mjs. All 199 node tests pass.RowHeightheight (placeholder, spec andviewBox), theMin/Maxspec, and the unchangedAspectRatiopath (noRowHeight, or vertical). All 571 component tests pass.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