Skip to content

Commit 664ebfc

Browse files
Merge pull request #184 from TanStack/taren/post-1.0-fixes
feat(charts): ship compatible post-1.0 fixes and layout options
2 parents e6a51a8 + b2ef7e1 commit 664ebfc

201 files changed

Lines changed: 2447 additions & 11101 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': minor
3+
---
4+
5+
Add opt-in `fit: 'compress'` for crowded dodge layouts and `axis.ticks.line` for styling or hiding tick stubs independently of labels. Preserve existing layout and tick defaults.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': minor
3+
---
4+
5+
Pass `brushX` `format` a context naming the `start` or `end` handle it is labeling, so values that mark boundaries between items can produce correct value text for each handle.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': patch
3+
---
4+
5+
Keep the number of selected values when dragging a `brushX` selection with explicit `values`, including when the drag stops at the edge of the plot.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': patch
3+
---
4+
5+
Remove built-in card styles from custom tooltip bodies and restore them when returning to the built-in tooltip.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': patch
3+
---
4+
5+
Accept the first resize observer's measurement precision when layout and CSS content dimensions are unchanged, avoiding a spurious resize that cancels entrance motion. Continue responding to actual fractional resizes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': patch
3+
---
4+
5+
Use the scale returned by its range setter so immutable custom scales receive the chart's pixel range without changing their source.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': patch
3+
---
4+
5+
Look up interaction values by key and snap pointer positions by binary search, so `brushX`, `zoomX`, `handleX`, and cursors with many explicit values stay responsive while dragging.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@tanstack/charts': patch
3+
'@tanstack/react-charts': patch
4+
---
5+
6+
Mark React chart entries as client components for React Server Component applications. Document where chart definitions belong and how to render a hydration-safe client-only chart.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/charts': patch
3+
---
4+
5+
Avoid repeating focus callbacks after scene updates when the focused datum and group have not changed. Continue repainting updated geometry and notifying changed data or group membership.

‎API-FRICTION.md‎

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ Each entry records:
345345
| F-306 | Inferred consumer declarations could not name core types | Tooling | resolved |
346346
| F-307 | Grouped-y keyboard navigation followed x order | API | resolved |
347347
| F-308 | Raster format documentation omitted browser encoder fallback | Documentation | resolved |
348+
| F-309 | Immutable range setters lost their returned scale | API | resolved |
349+
| F-310 | React client boundaries and migration options were unclear | Documentation/Tooling | resolved |
350+
| F-311 | Crowded dodge layouts had no bounded offset policy | API | resolved |
351+
| F-312 | Tick stubs could not be styled independently | API | resolved |
352+
| F-313 | Initial observer precision cancelled entrance motion | Tooling | resolved |
353+
| F-314 | Framework ticks and immediate focus layers were unclear | Documentation | resolved |
348354

349355
## Findings
350356

@@ -9199,3 +9205,96 @@ Each entry records:
91999205
decodes as WebP in Chromium and Firefox and PNG in WebKit. Dimensions and
92009206
opaque red pixels pass with lossy-encoding tolerance, alongside ten existing
92019207
PNG checks per engine. No page errors or console warnings/errors occur.
9208+
9209+
### F-309 - Immutable range setters lost their returned scale
9210+
9211+
- Status: resolved
9212+
- Severity: high
9213+
- Owner: API
9214+
- Observed in: reproducing GitHub issue #177 against 1.0 runtime code
9215+
- Friction: Charts copies a configured scale but discards the object returned
9216+
by `range()`. An immutable range setter therefore leaves mapping, inversion,
9217+
and tick positions in the original unit range.
9218+
- Decision: retain the returned scale, without changing domain inference or
9219+
the independently mutable domain requirement for semantic viewports. The
9220+
fix is included in `taren/post-1.0-fixes`, commit `c76566f1`, after the
9221+
user approved its measured size exception.
9222+
- Verification: the new regression fails before the fix and passes afterward
9223+
for two responsive widths, mapping, inversion, tick positions, and source
9224+
immutability. All 30 configured-scale tests and root TypeScript pass. The
9225+
minimal fix adds 0.002 kB minified to affected consumer bundles; gzip deltas
9226+
range from -0.001 to +0.002 kB. The user approved that exception on October 8.
9227+
9228+
### F-310 - React client boundaries and migration defaults were hard to find
9229+
9230+
- Status: resolved
9231+
- Severity: medium
9232+
- Owner: Documentation/Tooling
9233+
- Observed in: GitHub issues #175, #176, #180, and the FACEIT migration report
9234+
in #183
9235+
- Friction: React entries did not declare their client boundary, a chart
9236+
definition cannot be serialized through an RSC prop, and existing options
9237+
for client-only mounting, tick stubs, sparse focus, and small sparkline
9238+
domains were difficult to find.
9239+
- Decision: preserve client directives in React entries and verify the
9240+
published imports during the existing package gate. Document application
9241+
ownership of the client boundary and post-hydration mounting. Add a Recharts
9242+
migration guide and explicit tick-size and nicening guidance, without
9243+
changing defaults or adding a runtime API.
9244+
- Verification: seven source compilation regressions fail before and pass
9245+
after adding the directives. The client-only recipe passes Strict Mode SSR,
9246+
hydration, mounted SVG, frame reuse, and teardown checks without recoverable
9247+
hydration errors. Consumer bundle output remains unchanged.
9248+
9249+
### F-311 - Crowded dodge layouts had no bounded offset policy
9250+
9251+
- Status: resolved
9252+
- Severity: medium
9253+
- Owner: API
9254+
- Observed in: reproducing issue #174 with crowded, variable-radius dots
9255+
- Friction: collision-free offsets extended outside the plot, requiring a
9256+
custom packer to bound positions.
9257+
- Decision: add opt-in `fit: 'compress'`, preserving existing overflow behavior.
9258+
Compression can overlap dots. A circle wider than the plot requires a smaller
9259+
authored radius and produces an explicit error.
9260+
- Verification: all six anchors keep variable-radius circles within bounds;
9261+
roomy layouts retain their exact positions, empty layouts work, and oversized
9262+
circles fail clearly. The crowded-layout regression fails before the feature.
9263+
9264+
### F-312 - Tick stubs could not be styled independently
9265+
9266+
- Status: resolved
9267+
- Severity: medium
9268+
- Owner: API
9269+
- Observed in: issue #180, authored baseline paint did not affect tick stubs
9270+
- Decision: add `axis.ticks.line` with the existing guide style type and `false`
9271+
to hide stubs while retaining labels. Keep existing axis defaults.
9272+
- Verification: both axes accept stroke paint and retain all authored labels
9273+
when stubs are hidden. Existing default guide output tests pass unchanged.
9274+
9275+
### F-313 - Initial observer precision cancelled entrance motion
9276+
9277+
- Status: resolved
9278+
- Severity: high
9279+
- Owner: Tooling
9280+
- Observed in: issue #182, CSS reported 569.594 while layout reported 569.59375
9281+
- Decision: adopt the first observer's precision only when the measured bounds
9282+
and CSS content size have not changed. Compare subsequent resizes exactly.
9283+
- Verification: regression covers repeated initial reports, transformed border
9284+
boxes, and a real 0.125 pixel resize. Chromium, Firefox, and WebKit retain
9285+
running entrance motion and accept subsequent fractional resizes.
9286+
9287+
### F-314 - Framework ticks and immediate focus layers were hard to discover
9288+
9289+
- Status: resolved
9290+
- Severity: medium
9291+
- Owner: Documentation
9292+
- Observed in: issues #179 and #181 duplicated layout math and expected inline
9293+
states to own geometry concurrently with data motion
9294+
- Decision: document resolved scales and plot bounds from `onRender` for HTML
9295+
tick content, plus `whenFocused` for immediate focus indicators. Explain
9296+
inline state deferral and independent tooltip timing. No motion default changes.
9297+
- Verification: React HTML labels align with SVG tick stubs across size and
9298+
direction changes. A focus dot appears during entrance while the data path
9299+
and its running animation remain intact. Concurrent inline states remain a
9300+
separate feature; this addresses the documented alternatives requested.

0 commit comments

Comments
 (0)