[feat]: Integrate @tanstack/charts into Chart primitive
area: request
### Feature description
Support `@tanstack/charts` for the `Chart` component (either as a native refactor or as an alternative alongside Recharts).
### Affected component/components
- `Chart` (`components/ui/chart.tsx`)
### Motivation & Rationale
- **SVG + Canvas Dual Engine:** Recharts hits DOM paint bottlenecks with larger datasets (~2k+ points). TanStack Charts allows switching to Canvas without changing chart logic or data models.
- **Stack Consistency:** `shadcn/ui` already relies on `@tanstack/react-table`; adopting `@tanstack/charts` creates stack symmetry across data-heavy UI primitives.
- **Type Safety & Tree-Shaking:** Offers a headless, modular architecture that integrates cleanly with Tailwind CSS variables (`var(--color-*)`).
### Proposed Solution
- **Option A (Recipe):** Add a doc recipe showing how to construct `ChartContainer` using `@tanstack/charts`.
- **Option B (Adapter/Migration):** Refactor `components/ui/chart.tsx` to support `@tanstack/charts` natively or via a configurable engine prop.
2 条评论