feat(charts): honor ChartAxis.stepSize, ChartConfig.description and .height (framework#3752) - #2888
Merged
Merged
Conversation
…height (framework#3752) The tail of the declared-≠-delivered sweep from framework#3729 / #2880. Three ChartConfig props reached the renderer and did nothing. stepSize: Recharts has no "a tick every N units" prop — tickCount is a hint it may ignore and interval is for categorical axes — so honoring a step means handing it the tick array outright. ticksFor builds it from the axis's own min/max where declared and from the plotted values otherwise. A data-derived max rounds UP to the next step (otherwise the topmost bar sits above the last gridline and the axis reads as truncated); an explicit max clamps instead, since a tick outside a pinned domain would be drawn outside the plot. The step-count division carries a small epsilon because 0.5/0.1 is 5.000000000000001 one way and 4.999999999999999 the other, and a bare floor() drops a whole tick in the second case. More than 200 ticks is refused rather than rendered — that is a wrong config, and drawing it would hang the page instead of surfacing the mistake. description: the accessibility description. A chart is a picture to a screen reader; the container now carries role="img" + aria-label. Without a description it stays an ordinary div, because stamping role="img" on an unlabelled graphic is worse than leaving one a screen reader can skip. height: was read only by the legacy ChartBarRenderer, not by the advanced path that draws every real chart. Now an inline style on the chart container, which beats its default h-[350px] class. height and description ride on the shared container props, so they apply to all eight chart families rather than one branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMHZBHTjH4rw8xmDYirFC7
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 28, 2026 02:46
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.
Implements the objectui half of objectstack-ai/objectstack#3752. Framework companion: objectstack-ai/objectstack#3753 (merge this one first).
The tail of the declared-≠-delivered sweep from #2880 / framework#3729. Three
ChartConfigprops reached the renderer and did nothing.ChartAxis.stepSizeRecharts has no "a tick every N units" prop —
tickCountis a hint it may ignore andintervalis for categorical axes — so honoring a step means handing it the tick array outright.ticksForbuilds it from the axis's ownmin/maxwhere declared and from the plotted values otherwise, so a step works with or without a pinned domain.Two details that are easy to get wrong:
0.5 / 0.1is5.000000000000001one way and4.999999999999999the other, and a barefloor()silently drops a whole tick in the second case.A step that would produce more than 200 ticks is refused rather than rendered — that is a wrong config, and drawing it would hang the page instead of surfacing the mistake.
ChartConfig.descriptionThe accessibility description. A chart is a picture to a screen reader; the container now carries
role="img"+aria-label. Without a description it stays an ordinary div — stampingrole="img"on an unlabelled graphic is worse than leaving one a screen reader can skip.ChartConfig.heightWas read only by the legacy
ChartBarRenderer, not byAdvancedChartImpl— the path that draws every real chart. Now an inline style on the chart container, which beats its defaulth-[350px]class.heightanddescriptionride on the shared container props, so they apply to all eight chart families rather than one branch.Not implemented, by decision
ChartInteraction.zoomandChartInteraction.clickActionare removed from the schema in the framework PR rather than implemented here —brushalready narrows a range, and a segment click already has two working owners (drillDown,onSegmentClick). Neither had a consumer anywhere in either repo.Verification
normalizeChartSchema.test.ts— 31 tests (11 new: container props,ticksForrange/clamp/float-drift/absurd-count/empty)AdvancedChartImpl.specConfig.test.tsx— 16 tests (4 new: aria wiring, the deliberate no-role case, explicit height, ticks at the declared step)type-checkclean; eslint 0 errors🤖 Generated with Claude Code
https://claude.ai/code/session_01UMHZBHTjH4rw8xmDYirFC7
Generated by Claude Code