Installation
SwiftChart is published as @arshad-shah/swift-chart. React is an optional peer dependency — install it only if you plan to use the /react entry point.
pnpm add @arshad-shah/swift-chartnpm install @arshad-shah/swift-chartyarn add @arshad-shah/swift-chartBrowser support
Section titled “Browser support”Canvas 2D + ResizeObserver: Chrome 64+, Firefox 69+, Safari 13.1+, Edge 79+.
Bundle size
Section titled “Bundle size”| Entry | Gzipped | Brotli |
|---|---|---|
| Core (@arshad-shah/swift-chart) | ~25.9 KB | ~22.8 KB |
| React (@arshad-shah/swift-chart/react) | ~25.2 KB | ~22.6 KB |
These figures are the full barrel — every chart class plus helpers. Real apps import only what they render, so tree-shaking cuts this sharply: a LineChart-only build is ~8 KB Brotli. The two entry points also share most of their code, so importing both does not double the bundle.