Skip to content

feat(charts): RowHeight on every chart that lays its categories out as rows - #176

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

phmatray merged 1 commit into
mainfrom
feat/row-height-all-charts

Conversation

@phmatray

Copy link
Copy Markdown
Owner

Closes #175. Follow-up to #173, which fixed only RangeBarChart.

What

  • D3Chart.RowHeight (moved here from RangeBarChart, so its API is unchanged): a chart that lays its categories out as rows becomes RowHeight × (rows + band padding) + its frame's margins tall, instead of width ÷ AspectRatio. Each chart reports its rows through an internal RowBands override, counted with the same filtering its layout applies:

    Chart Rows Exactness
    GanttChart lanes plus group headers, within From/To exact
    LollipopChart, DumbbellChart, RangeBarChart finite items or distinct labels exact
    BulletChart finite rows exact when SharedAxis is set; when left automatic and the layout shares the axis, rows are 16 ÷ n units shorter
    HeatmapChart Rows, else rows with a finite cell exact
    BeeswarmChart, RidgelineChart groups with values exact
    BoxPlotChart, ViolinChart, WaterfallChart when horizontal exact
    Column3DChart when horizontal slightly short: the 3D depth grows with the band

    Charts without rows, or in the other orientation, ignore it and keep AspectRatio.

  • BarChart.RowHeight: a horizontal bar chart sizes its box by its categories instead of Height. Reference and marker labels above the plot take a little of that space.

  • GanttChart.From / To: pin the time window. Bars are clipped to it; tasks wholly outside it are left out, and are not counted as rows.

Tests

  • tests/charts-row-height.test.mjs: for every chart, lays it out at the height its component computes and asserts that consecutive rows are exactly RowHeight apart (Column3D: within 20%). Changing a frame constant fails the matching case; I checked that a wrong margin turns a 24-unit step into 25.91. Gantt from/to clipping and filtering are covered too.
  • ChartsRowHeightTests (bUnit): checks that each component computes those same heights, including the orientations that ignore RowHeight, Gantt without headers or with a window, and the horizontal BarChart box.
  • Results: all 206 node tests and all 579 component tests pass locally; layouts.fixture.json was re-recorded. The Charts.Server (Jint) tests run in CI only: the docs site's Tailwind CLI is killed by macOS on this machine.

🤖 Generated with Claude Code

…s rows

A D3Chart is as tall as its measured width divided by AspectRatio, so a
chart with a row per category got taller rows on wider screens, and
callers could only guess a ratio for a 640px width. RowHeight moves from
RangeBarChart to D3Chart: each row chart (Gantt, Lollipop, Bullet,
Dumbbell, Beeswarm, Ridgeline, Heatmap, and BoxPlot, Violin, Waterfall
and Column3D when horizontal) reports its rows from the same filtering
as its layout, with its frame's band padding and margins, and is then
RowHeight per row tall. A horizontal BarChart sizes its box the same way
instead of Height. GanttChart gets From/To to pin its time window.

A node test checks every chart's rows land RowHeight apart at the height
its component computes; a bUnit test checks the components compute it.

Closes #175

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

Row charts: RowHeight on every chart that lays its categories out as rows

1 participant