Installation
Installation
Section titled “Installation”AstroChart can be installed in several ways depending on your project setup.
The recommended way to install AstroChart is via npm:
npm install @astrodraw/astrochartWith Yarn
Section titled “With Yarn”yarn add @astrodraw/astrochartWith PNPM
Section titled “With PNPM”pnpm add @astrodraw/astrochartFor quick prototyping or embedding AstroChart in existing projects, use the UMD bundle from a CDN:
<script src="https://unpkg.com/@astrodraw/astrochart/dist/astrochart.js"></script>
<div id="chart"></div>
<script> const data = { planets: [/* ... */], cusps: [/* ... */] }
const chart = new astrochart.Chart('chart', 600, 600) chart.radix(data)</script>The UMD bundle exposes astrochart as a global variable containing all exports.
ESM Import
Section titled “ESM Import”For modern bundler setups (Webpack, Vite, Rollup, etc.), import directly:
import { Chart } from '@astrodraw/astrochart'
const chart = new Chart('chart', 600, 600)chart.radix(data)TypeScript
Section titled “TypeScript”Full TypeScript type definitions are included in the npm package:
import type { Chart, AstroData, Settings } from '@astrodraw/astrochart'
const chart: Chart = new Chart('chart', 600, 600)const settings: Settings = { /* ... */ }No additional @types/ package needed.
Compatibility
Section titled “Compatibility”| Environment | Status |
|---|---|
| Node.js 18+ | ✅ Supported |
| Browsers (modern) | ✅ Supported |
| IE11 | ⚠️ Requires polyfills |
| Mobile browsers | ✅ Supported |
| React | ✅ See React guide |
| Vue | ✅ See Vue guide |
| Angular | ✅ See Angular guide |
Verification
Section titled “Verification”After installation, verify AstroChart is working:
import { Chart, version } from '@astrodraw/astrochart'
console.log('AstroChart version:', version)Next Steps
Section titled “Next Steps”- Quick Start — Render your first chart
- API Reference — Learn all available methods
- Guides — Explore common use cases