D3.js is a chart framework for building interactive, composable visualizations with Angular.
Plot is a structured wrapper around D3.js that provides:
- Layout system - Divide charts into logical areas (top, left, center, right, bottom)
- Composable items - Create custom visualizations as
PlotItemclasses with lifecycle hooks - Full D3 access - No limitations; use any D3 feature you need
- Built-in scaling - Automatic coordinate mapping with configurable domains
- Reusable elements - Pre-built items for axes, lines, bars, stacked bars, tooltips, and more
For a detailed guide on the architecture and how to build custom charts, see Plot Architecture.
- Angular 20 (standalone components)
- TypeScript
- D3 v7
- Jest (unit tests for plot utilities and plot behavior)
Install dependencies:
npm installThe project includes a Python script to generate age distribution samples for the histogram chart:
# Create and activate Python virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
# Generate age histogram data (outputs to age_data_bins.ts)
python3 src/python/age_histogram.pyRun the app locally:
npm startThen open http://localhost:4200.
Run unit tests:
npm test- D3 rendering is encapsulated in plot base components that attach SVG output to a container and react to window resize.




