Skip to content

Installation

AstroChart can be installed in several ways depending on your project setup.

The recommended way to install AstroChart is via npm:

Terminal window
npm install @astrodraw/astrochart
Terminal window
yarn add @astrodraw/astrochart
Terminal window
pnpm add @astrodraw/astrochart

For 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.

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)

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.

EnvironmentStatus
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

After installation, verify AstroChart is working:

3.0.2
import { Chart, version } from '@astrodraw/astrochart'
console.log('AstroChart version:', version)