Skip to content

feat(charts): add the shared error cross mark (S2) (@fehmer) - #8624

Open
fehmer wants to merge 3 commits into
feature/ts-charts-s1-foundationfrom
feature/ts-charts-s2-cross-mark
Open

fehmer wants to merge 3 commits into
feature/ts-charts-s1-foundationfrom
feature/ts-charts-s2-cross-mark

Conversation

@fehmer

@fehmer fehmer commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

S2 of docs/specs/tanstack-charts: the shared TanStack half of the Chart.js pointStyle: "crossRot" error datasets, for the mini result (S6) and result (S9) charts.

 src/ts/components/
+├── charts/
+│   └── error-cross.ts     # errorCross(rows, { x, y, yScale, color, size, strokeWidth })
errorCross (createMark, not compositeMark - no built-in mark draws short segments)
  initialize: materialize x/y channels into the reserved or named scales
  render: per row
    one ChartPoint, always        # chart.js: pointRadius 0 at zero, index tooltip keeps it
    if count > 0
      two rule arms, rotated 45°  # the crossRot geometry: tip `size` px from centre, 3/2 defaults
  • A createMark, not a compositeMark: the cross is two free-standing segments, which no built-in mark draws.
  • Scale bindings follow the built-ins' OptionScaleId semantics: unbound marks own the reserved x/y scales in their type, yScale: "error" binds the named scale — so the mark type-checks inside defineChart either way (a mark whose phantom omits a reserved scale makes the compiler demand y: null).
  • No chart consumes it yet, so nothing renders and nothing ships: verified the production build is unchanged (no error-cross string in dist, vendor-chart 416.49 kB / 137.96 kB gzip as on the s1 PR; createMark ships in the @tanstack/charts root entry S3 already pulls in).
  • Spec: the error-markers mapping records the settled design; the "may become dots" deviation is dropped from both deviation lists (the cross is kept, settled 4). Roadmap row ticked; S2 is a stacked PR on S1 (feat(charts): add TanStack Solid Charts foundation + about speed histogram (S1, S3) (@fehmer) #8623), so PR 1 is now S4–S6.

Evidence

  • New spec (__tests__/components/charts/error-cross.spec.ts), asserted through createChartScene:
✓ errorCross > binds the error counts to the y scale            (x [1,5], y [0,3] from the mark channels)
✓ errorCross > emits one point per row, zero errors included    (5 points, values [0,0,3,0,2], stable keys)
✓ errorCross > paints a rotated cross per positive error ...    (4 rules, ±size/√2 endpoints, stroke + width; zero rows paint nothing)
✓ errorCross > binds to a named error scale when given          (yScale: "error", y: null dormant)
  • Full suite: 132 passed (132), 2006 passed (2006) — existing specs unchanged.
  • pnpm oxlint --type-aware --type-check clean; oxfmt no changes.
  • Browser: about page loads, the histogram renders with the parity flag both ways, console clean (no visible change expected).
  • example graph
image

Merge Danger

Door: two-way.

A new self-contained module with zero consumers plus doc updates; reverting deletes two files.

Blast Radius: none — the module is tree-shaken from every build and no chart reads it until S6/S9.

@monkeytypegeorge monkeytypegeorge added frontend User interface or web stuff docs Related to Markdown files and documentation labels Nov 25, 2026
@fehmer
fehmer changed the base branch from integration/charts to feature/ts-charts-s1-foundation November 25, 2026 17:16
@fehmer
fehmer added this pull request to stack #8625 November 25, 2026 17:16
@fehmer
fehmer force-pushed the feature/ts-charts-s2-cross-mark branch from bec6f73 to b68e699 Compare November 26, 2026 01:56
@fehmer
fehmer force-pushed the feature/ts-charts-s2-cross-mark branch from b68e699 to abe82aa Compare November 26, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Related to Markdown files and documentation frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants