Repository navigation
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@gillkyle, the shared path recorder is useful for the curved-bar work in #202 too. I tested the recorder at return (
squaredDistanceToSegment(x0, y0, x3, y3, x1, y1) <=
pathTolerance * pathTolerance &&
squaredDistanceToSegment(x0, y0, x3, y3, x2, y2) <=
pathTolerance * pathTolerance
)This checks both control points against the finite endpoint segment, so it does not flatten collinear overshoots or loops into one chord. It reuses the existing helper and leaves the rendered path string, tolerance, and depth limit unchanged. In isolated Chromium, Firefox, and WebKit runs, 2,003 directed/random cubics with 201 samples each stayed within the existing 0.25px tolerance. The largest sampled candidate error was 0.187px. A deliberately broken always-flat control failed on a collinear overshoot. For a 720px-wide, 10,000-point oscillating basis curve, contour points fell from 114,279 to 18,299. Direct PR-versus-candidate timings for ten constructions, two warmup pairs and eight alternating measured pairs, were 50.5 → 23.8ms in Chromium, 70 → 43ms in Firefox, and 57 → 27ms in WebKit. Path strings matched. These are construction-only measurements, not whole-chart performance claims. The standalone One separate shared limitation to keep in mind for #202: the interaction callback has no clip context. The existing |
|
Thanks @gillkyle, I completed the full isolated checkout checks at this head: 807 DOM tests, all six additional framework targets, TypeScript and the documentation contract pass. The packed-consumer gate passes too, including bare React Native and Expo, and all seven adapter package gates pass. These are this older 0.6.2 checkout’s own checks, not validation of a rebase onto current main. The actual packed scenePath export also passes 603 sampled distance checks across three directed cubics, including an overshoot and a loop, plus a closed-path control. Flattening those curves to one chord makes the verifier fail. The bundle check passes against the PR’s proposed limits. That does not approve the increases or apply the optional flatness optimization above. I have left the draft status unchanged; required CI, budget decisions and validation against the eventual merge base still remain. Verified head: |
Problem
Curved marks look smooth, but hover selection currently tests the straight polygon connecting their original data points.
In a curved stacked-area chart, the cursor can be visibly inside the top layer while the tooltip selects the layer underneath it.
This PR makes hover selection follow the curve that was actually drawn.
Approach
Built-in D3 curves get this automatically. Custom marks can use
scenePath.CleanShot.2026-08-02.at.17.26.59.mp4
Cost
Every row below is a TanStack Charts bundle or consumer:
The last row shrinks because our old adapter bundled D3's full line and area generators. The new recorder calls the D3 curve function directly, allowing those larger generators to tree-shake out. This is a TanStack implementation saving, not a comparison against D3.
Curved selection is about 0.3 µs slower per query (3.6 vs 3.3 µs). Point-only selection is unchanged.
bundle:checkremains red because the standalone resolver is 227 B over its existing 2 KiB budget; this draft leaves that trade-off visible for review.Validated with 775 tests, typecheck, package/docs checks, production build, benchmarks, and live SVG/Canvas checks.
Not included: frame-by-frame animated picking or parsing arbitrary SVG path strings.