Skip to content

perf: skip sunburst boundary sampling during animation - #224

Merged
tannerlinsley merged 3 commits into
mainfrom
taren/sunburst-path-projection
Oct 14, 2026
Merged

tannerlinsley merged 3 commits into
mainfrom
taren/sunburst-path-projection

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Change

Sunburst animation frames only need an SVG path, but were also rebuilding sampled hit-test boundaries. Separate path projection from boundary sampling and reuse the existing D3 arc defaults. Initial scene construction still builds interaction boundaries.

Found while investigating the polar animation report from @toomingos in #194. This does not resolve that issue or include the held rounded-arc changes.

Verification

  • All 19 validation tasks pass, including 2,234 core tests and nine new projection regression cases.
  • Maintained example builds and sunburst conformance pass.
  • Chromium, Firefox and WebKit produce identical before/after paths, including all 30 sampled nested animation frames, with clean teardown.
  • All existing bundle limits pass without changes. Sunburst gzip: 7.599 to 7.571 kB. Radial-bar gzip: 27.773 to 27.765 kB.
  • Seven measured paired Chromium trials at 1,000 sectors: 30 flat animation frames improve from 19.2 to 14.9 ms, nested frames from 27.5 to 22.4 ms. Ten scene builds measure 6.7 to 6.4 ms flat and 8.8 to 8.9 ms nested. These are isolated local measurements, not whole-app throughput claims.
  • All 188 generated preview images stay unchanged. Only their source fingerprint and comparison provenance change.

Includes a patch Changeset. No public API or dependency changes.

Summary by CodeRabbit

  • Performance Improvements
    • Sunburst chart animations avoid rebuilding hit-test boundaries for each projected frame, reducing repeated work while keeping the chart’s displayed behavior unchanged.
  • Documentation
    • Updated chart comparison pages to reflect the latest workspace revision and bundle snapshot date.

@changeset-bot

changeset-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e9e894f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@tanstack/charts Patch
@tanstack/alpine-charts Patch
@tanstack/angular-charts Patch
@tanstack/lit-charts Patch
@tanstack/octane-charts Patch
@tanstack/preact-charts Patch
@tanstack/react-charts Patch
@tanstack/react-native-charts Patch
@tanstack/solid-charts Patch
@tanstack/svelte-charts Patch
@tanstack/vue-charts Patch
@tanstack/charts-scales Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b9370423-ad88-493e-b1e4-2d972e648fe5
📥 Commits

Reviewing files that changed from the base of the PR and between 5a34b7e and e9e894f.

📒 Files selected for processing: 8
  • .changeset/sunburst-path-projection.md
  • benchmarks/comparison/bundle-baseline.json
  • benchmarks/conformance/previews/manifest.json
  • docs/comparison.md
  • packages/charts-core/docs/comparison.md
  • packages/charts-core/src/hierarchy-sunburst.ts
  • packages/charts-core/src/polar-sector-internal.test.ts
  • packages/charts-core/src/polar-sector-internal.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The sunburst path projection now uses a dedicated polar-sector projector. Tests cover projected paths, resolved boundary points, repeated projection, and invalid sector values. Benchmark and comparison metadata identify updated source revisions and dates.

Changes: Sunburst sector projection

Layer / File(s) Summary
Polar-sector projection and sunburst integration
packages/charts-core/src/polar-sector-internal.ts, packages/charts-core/src/hierarchy-sunburst.ts, packages/charts-core/src/polar-sector-internal.test.ts, .changeset/sunburst-path-projection.md
projectPolarSector generates sector paths. projectSunburstSectorPath now uses it instead of resolving the sector boundary. Tests cover projected paths, resolved points, repeated projection, and invalid values. A patch changeset records the change.
Benchmark and comparison revision metadata
benchmarks/comparison/bundle-baseline.json, benchmarks/conformance/previews/manifest.json, docs/comparison.md, packages/charts-core/docs/comparison.md
The baseline and manifest contain updated timestamps, revisions, and hashes. Both comparison pages identify the updated workspace revision and baseline date.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: greglum

Merge Risk: ⚪ Minimal · up to e9e89

The projection change is mergeable after normal checks; no actionable issue remains identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (5 skipped: 5… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: avoiding sunburst boundary sampling during animation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e9e894f

Command Status Duration Result
nx run charts-workspace:ci-distributed ✅ Succeeded 2m 31s View ↗
nx run charts-workspace:package-check ✅ Succeeded <1s View ↗
nx run charts-workspace:benchmark-check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-14 02:16:06 UTC

@tannerlinsley

Copy link
Copy Markdown
Member Author

Follow-up timing check: the short nested scene-build samples differed by 0.1 to 0.2 ms across ten builds, so I repeated with 100 builds per sample. Two seven-pair runs measured median 91.9 to 91.6 ms and 87.1 to 87.6 ms. The small difference changed direction, so these measurements do not establish a repeatable scene-build regression. Thirty animation frames remained faster in both runs: 27.9 to 22.8 ms and 27.6 to 22.6 ms. All four CI stress partitions and all four comparison partitions have passed; static checks and review are still running.

@tannerlinsley
tannerlinsley merged commit d91e0a0 into main Oct 14, 2026
19 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant