Repository navigation
fix(charts): line, area and band default to straight segments - #12453
josephfarina wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
|
Owner decision (engineering owner, covering this pull request): Charts' |
|
/approve-spec 1d27f80 |
There was a problem hiding this comment.
Approved pending CI: the CI workflow has not finished on this head yet.
line() and area() now default to straight segments and band() draws straight bounds, as the owner-approved Chart record (FR9) states; the new tests fail against the old default and the charts suite passes.
One non-blocking suggestion:
- The Chart record still says its decision log is empty and that defaults are unchanged (
Chart.spec.mdlines 42 and 198), and its verification map has no FR9 row; adding that row and rewording those two lines keeps the record consistent with FR9.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: line and area smoothed with monotone by default and band always smoothed: verified in the base mark sources.
- Claim: the default is now straight segments (
curve: 'linear'): verified,line.tsx:47,area.tsx:56. - Claim: band bounds are straight: verified,
band.tsx:76. - Claim:
curve: 'monotone'renders exactly as before: verified, the map entry is unchanged and the Line Curves story is pixel-identical. - Claim: monotone never overshoots the two points it joins, so no chart shows wrong values today: verified, d3's monotone curve uses Steffen's method, which is monotone between each pair of points.
- Claim: no current record sets the default curve: verified, no current record governs chart curve geometry.
- Claim: bar-only charts are unchanged and smoothed charts lose every cubic segment: consistent with this review's capture (Bar story identical; Line, Area, Band and Composite stories go to zero cubic segments).
- Claim: page templates chart with Recharts, and the two chart blocks are the only shipped items using these marks: verified (nine page templates import Recharts; ChartShowcase uses bars only, ChartTrendComparison adds one line); docs examples that call
line()also straighten. - Claim: band has no
curveoption: verified,band.tsx:18-23. - Claim: new tests cover default line, area and band plus a monotone line: verified,
marks.test.tsx:175-207; three fail on the old code. - Claim: the charts suite passes, 12 files and 128 tests: verified.
- Claim: the charts package is private, so no changeset: verified,
package.jsonhasprivate: true. - Claim: the record adds FR9, names it in the non-goal and adds the marks tests to
verified_by: verified,Chart.spec.md:16,:58,:90. - Claim: writing rubric results (no narration, no change references, no project status): verified for the added lines; see the non-blocking note on the record's older sentences.
- File
docs/specs/components/Chart/Chart.spec.md: non-blocking note above. - File
packages/charts/docs/CHARTV2_VERIFICATION_CHECKLIST.md: clear. - File
packages/charts/src/marks/area.tsx: clear. - File
packages/charts/src/marks/band.tsx: clear. - File
packages/charts/src/marks/line.tsx: clear. - File
packages/charts/src/marks/marks.test.tsx: clear.
| | FR6 | `legend=true` MUST derive items from primary series; legend and tooltip config objects MUST enable their surfaces while overriding supported options. | current implementation and focused tests | verify | | ||
| | FR7 | The chart MUST expose a named `role="img"`; a supplied subtitle MUST be its description; datasets up to 100 row×series cells MUST also be mirrored in a visually hidden table. | current implementation, WCAG 1.1.1, and accessibility tests | verify | | ||
| | FR8 | Root DOM props and `ref` MUST reach the root container while Chart's own SVG name and description remain authoritative. | shared BaseProps convention and focused regression test | verify | | ||
| | FR9 | `line()` and `area()` MUST join points with straight segments unless the series passes `curve`; `curve: 'monotone'` opts it into a smooth curve. `band()` MUST join its bounds with straight segments. | owner decision (straight by default); marks tests | decided | |
There was a problem hiding this comment.
Non-blocking: FR9 records an owner decision, but the record's Verification map has no FR9 row, the Decision log still reads "None. This draft records observed behavior and open gaps only.", and the compatibility line still says defaults stay unchanged. A row such as FR9 | marks.test.tsx default-curve cases | default and monotone line, area, band | a cubic segment in a default path plus a reword of those two sentences keeps the record consistent. The template's review-state words are settled, verify or human decision.
|
/approve-spec 1dfd325 |
There was a problem hiding this comment.
Approved pending CI: the CI workflow has not run on this head, because CI admission turned it away for lack of capacity, so it needs a re-run; Lint passed.
line() and area() now default to straight segments and band() draws straight bounds, as the owner-approved Chart record (FR9) states; the new tests fail against the old default, the charts suite passes, and astryx component Chart prints the new best-practice line.
One non-blocking suggestion, unchanged since the last review:
- The Chart record still says its decision log is empty and that defaults are unchanged (
Chart.spec.mdlines 42 and 198), and its verification map has no FR9 row; adding that row and rewording those two lines keeps the record consistent with FR9.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none since the last review.
- Claim: line and area smoothed with monotone by default and band always smoothed: verified in the base mark sources (
line.tsx:46,area.tsx:55,band.tsx:76). - Claim: the default is now straight segments (
curve: 'linear'): verified,line.tsx:47,area.tsx:56. - Claim: band bounds are straight: verified,
band.tsx:76. - Claim:
curve: 'monotone'renders exactly as before: verified, the map entry is unchanged (line.tsx:25,area.tsx:27), the monotone test passes on base and head, and the Line Curves story is pixel-identical. - Claim: monotone never overshoots the two points it joins, so no chart shows wrong values today: verified, d3's monotone curve limits each tangent so the curve stays between neighbouring points.
- Claim: no current record sets the default curve: verified, no current record mentions a chart curve, including every record the spec lookup lists for the three marks.
- Claim: owner decision, straight by default: verified, the owner's comment and an engineering owner's spec approval for this head.
- Claim: bar-only charts are unchanged and default line, area and band charts lose every cubic segment: consistent with the marks tests and this review's own story captures (the Bar story is identical; the Line, Area and Band stories drop to zero cubic segments).
- Claim: page templates chart with Recharts, and the two chart blocks are the only shipped items using these marks: verified (nine page templates import Recharts; ChartShowcase uses bars only, ChartTrendComparison adds one line).
- Claim: band has no
curveoption: verified,band.tsx:18-23. - Claim:
Chart.doc.mjsgains one best-practice "Don't" thatastryx component Chartprints in a project with the charts package: verified, the command lists it under "Don't" with the quoted wording. - Claim: new tests cover default line, area and band plus a monotone line: verified,
marks.test.tsx:175-207; the three default cases fail on the old code. - Claim: the charts suite passes, 12 files and 128 tests: verified.
- Claim: the charts package is private, so no changeset: verified,
package.jsonhasprivate: true. - Claim: the record adds FR9, names it in the non-goal and adds the marks tests to
verified_by: verified,Chart.spec.md:16,:58,:90. - Claim: writing rubric results (no narration, no change references, no project status, no open questions added): verified for the added lines; see the non-blocking note on the record's older sentences.
- Claim: public text contains no internal context: verified over the title, description, branch, commit messages and every added line.
- File
docs/specs/components/Chart/Chart.spec.md: non-blocking note above. - File
packages/charts/docs/CHARTV2_VERIFICATION_CHECKLIST.md: clear. - File
packages/charts/src/Chart.doc.mjs: clear. - File
packages/charts/src/marks/area.tsx: clear. - File
packages/charts/src/marks/band.tsx: clear. - File
packages/charts/src/marks/line.tsx: clear. - File
packages/charts/src/marks/marks.test.tsx: clear.
- #12680 perf(cli): a template's component line resolves its names in one pass, not one full lookup per name Author: Joey <[email protected]> - #12180 fix(core): Calendar weekday names widen their column instead of overlapping Author: Joey <[email protected]> - #12159 feat(cli): make an icon set inside your own app Author: Joey Farina <[email protected]> - #12383 fix(Grid): a responsive column shrinks to a container narrower than minWidth Author: Joey Farina <[email protected]> - #12374 [fix] Icon: a glyph given as name renders and warns, instead of crashing Author: Joey Farina <[email protected]> - #12453 fix(charts): line, area and band default to straight segments Author: josephfarina <[email protected]> - #12296 fix(core): a neutral Badge in a primary or destructive Button meets 4.5:1 on its fill Author: Joey Farina <[email protected]> - #12395 fix(CodeBlock): without a code string, CodeBlock names the prop and the fix in development Author: Joey Farina <[email protected]> - #12260 fix(cli): `astryx component Flex` names Stack first Author: Joey Farina <[email protected]> - #12391 fix(core): a two-lane Toolbar wraps instead of squeezing its start lane Author: Joey Farina <[email protected]> - #12427 fix(core): checkbox and radio marks keep their share of the box a theme sizes Author: josephfarina <[email protected]> - #12725 [experimental] cli: with no icon set, experimental icon names the discover search where it lists packs Author: Joey Farina <[email protected]>
|
Landed in #12738. |
User impact
line()andarea()draw every series as a smoothmonotonecurve unless the page passescurve, andband()always smooths. This changes the default look to straight segments (curve: 'linear'), so a chart reads point to point, as hand-made dashboards usually do; smooth curves read as auto-generated. A band's bounds are straight too, so a band matches the line it surrounds. A line or area that wants the smooth look passescurve: 'monotone', which renders exactly as before.This is a look change only:
monotonenever overshoots the two points it joins, so no chart shows wrong values today.Visual authority
No current record sets the default curve (checked the records
pnpm specs:forlists for the three mark files). Owner decision: straight by default.Before and after
Real Chromium, one sweep page per theme: Core defaults and every first-party theme (butter, chocolate, gothic, matcha, neutral, stone, y2k), light and dark, 390 and 1280 px, in a Vite app and in a single-file
astryx experimental renderoutput (128 views).C) paths beforecurve: 'monotone'Shipped page templates draw their charts with Recharts, so this default does not reach them; the two chart blocks above are the only shipped items that use these marks.
State matrix
Core defaults + 7 first-party themes × light/dark × 390/1280, dev app and rendered file.
Scope
Components: charts
line,area,bandKnown limit:
band()has nocurveoption, so a band around a line that opts intomonotonestays straight. Adding the option is a separate API change.Docs
Chart.doc.mjsgains one best-practice "Don't" (whatastryx component Chartprints in a project with the charts package): "Passcurve: 'monotone'to line() or area() for measured data. Keep the default straight segments, so each value reads as a point joined to the next one; a smoothed curve reads as decoration."Testing
marks.test.tsxcases: a defaultline(),area()andband()draw paths with no cubic segments; a line withcurve: 'monotone'still draws them.CI=1charts suite: 12 files, 128 tests pass.@astryxdesign/chartsis private, so there is no changeset.Writing rubric results
Record touched:
component:Chart(FR9 added, the mark-geometry non-goal names FR9,marks.test.tsxadded toverified_by).R1 narration: none; FR9 states what the marks do, in the present tense.
R2 research: none in the record; the theme sweep and judge results live in this description.
R3 evidence: FR9 basis is "owner decision (straight by default); marks tests", no pull request or commit.
R4 rejected alternatives: none recorded.
R5 change references: none.
R6 open questions: none added.
R7 project status: none.