feat(react): add optional 3D city map #238
main fromrefs/pull/238/head·opened Add an opt-in React city renderer that encodes metrics as building heights, category intersections as districts, and health status as building effects. Records retain their identity through the existing mark, scene, renderer, focus, and selection contracts.
Reference: https://raphox.github.io/atlas/
- Expose the city capability from
@tanstack/react-charts/city, mirrored at@tanstack/charts/react/city, with an optional Three.js peer. - Own scoped presentation in the renderer, preserving
sideEffects: falseand the ordinary chart entry points. Consumers import the component without a separate stylesheet. - Render the normal semantic SVG scene for SSR and WebGL initialization failure; the WebGL canvas paints the interactive city above that scene.
- Register
benchmarks/conformance/cases/city-mapwith the standardcase.json, self-containedexample.tsx, typed data,tanstack.ts, isolated Plot reference, and package/case regressions. - Use the shared React mount and definition-only preview helpers. The live catalog displays the WebGL map and source; compact previews and the Plot comparison use its semantic district layout.
- Document the capability in the mark reference and existing maps/spatial guide, with the regular catalog embed, navigation, metadata index, preview, and coverage inventories.
- Keep regression tests alongside the package and use the existing Vitest, conformance, documentation, and packaging commands.
The internal Atlas engine remains JavaScript behind explicit TypeScript public contracts. This draft requests feedback on the API and package placement. The Atlas code is offered under the repository's MIT license with authorization to distribute it.
Validation:
- Main Vitest suite: 306 files / 2,300 tests passed.
- TypeScript, public callback, source-example, catalog index, documentation, formatting, and diff contracts passed.
- Standard first-party conformance matrix passed. The scoped Plot comparison passed with clean types and matching semantic geometry/paints.
- Chromium catalog check passed with WebGL, camera controls, and source display, with no page errors.
- Installed tarball runtime/declaration checks passed, including React 18 SSR without warnings, React Native/Expo, framework adapters, and the unified city entry.
- Catalog previews generated and checked with the existing catalog tooling.
To try locally, run pnpm dev:conformance and open /charts/city-map/.
- 1
🦋 Changeset detected#
Latest commit: 70bf7ae10dbd6fe7423bcaef8dffb997e80f25f2
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 12 packages
Name Type @tanstack/react-charts Minor @tanstack/charts Minor @tanstack/alpine-charts Minor @tanstack/angular-charts Minor @tanstack/lit-charts Minor @tanstack/octane-charts Minor @tanstack/preact-charts Minor @tanstack/react-native-charts Minor @tanstack/solid-charts Minor @tanstack/svelte-charts Minor @tanstack/vue-charts Minor @tanstack/charts-scales Minor 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
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
Diff Package Supply Chain
SecurityVulnerability Quality Maintenance License three@0.180.0
Sign in to join this conversation.
Important
Draft PR not reviewed#
Draft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration:
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