-
-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
Create the reusable ChartDemo.astro component that renders interactive AstroChart demos in pages, plus a shared demoData.ts module.
Deliverable
A working chart demo component that can be dropped into any Markdown page and renders an interactive SVG chart with optional code snippet display.
Acceptance Criteria
-
src/components/ChartDemo.astroimplemented with props:id: string— unique container IDheight?: number— default 500mode?: 'radix' | 'transit' | 'animate'— chart typeshowCode?: boolean— default true, shows code block
- Component renders a
<div id={id}>container - Inline
<script is:inline>loads/public/astrochart.jsand initializes chart - For
animatemode: renders a button that callstransit.animate()on click - Code snippet display: collapsible
<details>with syntax-highlighted code (via Shiki or Prism) -
<noscript>fallback showing placeholder message -
src/data/demoData.tscreated with:defaultRadixData: AstroData— 15 planets + 12 cuspsdefaultTransitData: AstroData— transit ring planets + cusps
- Demo component tested in a test page (
src/content/docs/test-demo.md) - Chart renders visually correctly in dev server (no console errors)
- Component is documented with JSDoc comment explaining all props
Related Plan Section
docs-plan.md §6 (Visual & Interactive Examples)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels