# chartist-js/chartist architecture

> Architecture diagram of the GitHub repository chartist-js/chartist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chartist-js/chartist
- Repository: https://github.com/chartist-js/chartist

## Overview

Chartist is a typed SVG charting library: a caller supplies chart data and options, chart configuration and data normalization feed a phased layout/composition pipeline, and a renderer produces responsive DOM SVG. The repository also includes documented server rendering and plugin capabilities, legacy compatibility, and separate terminal, tooltip, essentials, and playground packages. Source excerpts establish the chart-to-pipeline and terminal rendering paths; several other links reflect README capability statements, while unsampled implementation details are left unasserted.

Main entry points: [`packages/chartist/src/chart/chart.ts`](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/chart/chart.ts) (Chart API), [`packages/chartist/src/pipeline/phases.ts`](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/pipeline/phases.ts) (Chart pipeline), [`packages/terminal/src/charts.ts`](https://github.com/chartist-js/chartist/blob/main/packages/terminal/src/charts.ts) (Terminal charts), [`packages/terminal/src/cli/main.ts`](https://github.com/chartist-js/chartist/blob/main/packages/terminal/src/cli/main.ts) (Terminal CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Chart engine"]
  node_chartapi["Chart API<br/>[chart.ts]"]
  node_charttypes["Chart configurations"]
  node_normalize["Data normalization<br/>[normalize.ts]"]
  node_pipeline["Chart pipeline<br/>[phases.ts]"]
  node_layers["Chart layers"]
  node_axes["Axes and scales<br/>[axis.ts]"]
  node_scene["Scene tree<br/>[node.ts]"]
  node_responsive["Responsive options<br/>[responsive.ts]"]
end

subgraph group_extensions["Extensions"]
  node_essentials["Essentials plugins"]
  node_tooltips["Tooltip plugin<br/>[plugin.ts]"]
  node_compat["Legacy compatibility<br/>[index.ts]"]
end

subgraph group_outputs["Rendering outputs"]
  node_dom["DOM SVG renderer<br/>[dom.ts]"]
  node_server["Server rendering"]
  node_live["Live updates<br/>[renderer.ts]"]
  node_terminal["Terminal charts<br/>[charts.ts]"]
end

subgraph group_tools["Developer tools"]
  node_terminalcli["Terminal CLI<br/>[main.ts]"]
  node_playground["Interactive playground<br/>[playground.ts]"]
  node_typeclient["Type worker client<br/>[client.ts]"]
  node_typeservice["TypeScript service<br/>[service.ts]"]
  node_worker["Type worker<br/>[worker.ts]"]
end

node_author(("Application caller"))

node_author -->|"creates chart"| node_chartapi
node_chartapi -->|"runs phases"| node_pipeline
node_chartapi -->|"renders via"| node_dom
node_chartapi -->|"handles sizing"| node_responsive
node_chartapi -.->|"animates updates"| node_live
node_charttypes -.->|"normalizes data"| node_normalize
node_pipeline -->|"creates axes"| node_axes
node_pipeline -->|"composes layers"| node_layers
node_pipeline -->|"builds scene"| node_scene
node_author -->|"renders server-side"| node_server
node_author -->|"adds plugins"| node_essentials
node_author -.->|"adds tooltips"| node_tooltips
node_author -->|"opts into legacy"| node_compat
node_author -->|"runs command"| node_terminalcli
node_terminalcli -->|"draws chart"| node_terminal
node_terminal -->|"builds scene"| node_scene
node_author -.->|"edits example"| node_playground
node_playground -.->|"requests types"| node_typeclient
node_typeclient -->|"sends requests"| node_worker
node_worker -->|"runs service"| node_typeservice

click node_chartapi "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/chart/chart.ts"
click node_charttypes "https://github.com/chartist-js/chartist/tree/main/packages/chartist/src/charts"
click node_normalize "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/core/data/normalize.ts"
click node_pipeline "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/pipeline/phases.ts"
click node_layers "https://github.com/chartist-js/chartist/tree/main/packages/chartist/src/layers"
click node_axes "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/scales/axis.ts"
click node_scene "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/scene/node.ts"
click node_responsive "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/responsive/responsive.ts"
click node_dom "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/render/dom.ts"
click node_server "https://github.com/chartist-js/chartist/tree/main/packages/chartist/src/server"
click node_live "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/live/renderer.ts"
click node_essentials "https://github.com/chartist-js/chartist/tree/main/packages/essentials/src"
click node_tooltips "https://github.com/chartist-js/chartist/blob/main/packages/tooltips/src/plugin.ts"
click node_compat "https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/compat/index.ts"
click node_terminal "https://github.com/chartist-js/chartist/blob/main/packages/terminal/src/charts.ts"
click node_terminalcli "https://github.com/chartist-js/chartist/blob/main/packages/terminal/src/cli/main.ts"
click node_playground "https://github.com/chartist-js/chartist/blob/main/packages/playground/src/playground.ts"
click node_typeclient "https://github.com/chartist-js/chartist/blob/main/packages/playground/src/types/client.ts"
click node_typeservice "https://github.com/chartist-js/chartist/blob/main/packages/playground/src/types/service.ts"
click node_worker "https://github.com/chartist-js/chartist/blob/main/packages/playground/src/types/worker.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chartapi,node_charttypes,node_normalize,node_pipeline,node_layers,node_axes,node_scene,node_responsive toneBlue
class node_essentials,node_tooltips,node_compat toneAmber
class node_dom,node_server,node_live,node_terminal toneMint
class node_terminalcli,node_playground,node_typeclient,node_typeservice,node_worker toneRose
class node_author toneIndigo
```

## Components

### Chart engine

- [Chart API](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/chart/chart.ts): `packages/chartist/src/chart/chart.ts`
- [Chart configurations](https://github.com/chartist-js/chartist/tree/main/packages/chartist/src/charts): `packages/chartist/src/charts`
- [Data normalization](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/core/data/normalize.ts): `packages/chartist/src/core/data/normalize.ts`
- [Chart pipeline](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/pipeline/phases.ts): `packages/chartist/src/pipeline/phases.ts`
- [Chart layers](https://github.com/chartist-js/chartist/tree/main/packages/chartist/src/layers): `packages/chartist/src/layers`
- [Axes and scales](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/scales/axis.ts): `packages/chartist/src/scales/axis.ts`
- [Scene tree](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/scene/node.ts): `packages/chartist/src/scene/node.ts`
- [Responsive options](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/responsive/responsive.ts): `packages/chartist/src/responsive/responsive.ts`

### Extensions

- [Essentials plugins](https://github.com/chartist-js/chartist/tree/main/packages/essentials/src): `packages/essentials/src`
- [Tooltip plugin](https://github.com/chartist-js/chartist/blob/main/packages/tooltips/src/plugin.ts): `packages/tooltips/src/plugin.ts`
- [Legacy compatibility](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/compat/index.ts): `packages/chartist/src/compat/index.ts`

### Rendering outputs

- [DOM SVG renderer](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/render/dom.ts): `packages/chartist/src/render/dom.ts`
- [Server rendering](https://github.com/chartist-js/chartist/tree/main/packages/chartist/src/server): `packages/chartist/src/server`
- [Live updates](https://github.com/chartist-js/chartist/blob/main/packages/chartist/src/live/renderer.ts): `packages/chartist/src/live/renderer.ts`
- [Terminal charts](https://github.com/chartist-js/chartist/blob/main/packages/terminal/src/charts.ts): `packages/terminal/src/charts.ts`

### Developer tools

- [Terminal CLI](https://github.com/chartist-js/chartist/blob/main/packages/terminal/src/cli/main.ts): `packages/terminal/src/cli/main.ts`
- [Interactive playground](https://github.com/chartist-js/chartist/blob/main/packages/playground/src/playground.ts): `packages/playground/src/playground.ts`
- [Type worker client](https://github.com/chartist-js/chartist/blob/main/packages/playground/src/types/client.ts): `packages/playground/src/types/client.ts`
- [TypeScript service](https://github.com/chartist-js/chartist/blob/main/packages/playground/src/types/service.ts): `packages/playground/src/types/service.ts`
- [Type worker](https://github.com/chartist-js/chartist/blob/main/packages/playground/src/types/worker.ts): `packages/playground/src/types/worker.ts`

### Other components

- **Application caller**

## Connections

- Application caller → Chart API: creates chart
- Chart API → Chart pipeline: runs phases (evidence: `packages/chartist/src/chart/chart.ts`)
- Chart API → DOM SVG renderer: renders via (evidence: `packages/chartist/src/chart/chart.ts`)
- Chart API → Responsive options: handles sizing (evidence: `packages/chartist/src/chart/chart.ts`)
- Chart API → Live updates: animates updates
- Chart configurations → Data normalization: normalizes data
- Chart pipeline → Axes and scales: creates axes (evidence: `packages/chartist/src/pipeline/phases.ts`)
- Chart pipeline → Chart layers: composes layers (evidence: `packages/chartist/src/pipeline/phases.ts`)
- Chart pipeline → Scene tree: builds scene (evidence: `packages/chartist/src/pipeline/phases.ts`)
- Application caller → Server rendering: renders server-side
- Application caller → Essentials plugins: adds plugins
- Application caller → Tooltip plugin: adds tooltips
- Application caller → Legacy compatibility: opts into legacy (evidence: `packages/chartist/src/compat/index.ts`)
- Application caller → Terminal CLI: runs command (evidence: `packages/terminal/src/cli/main.ts`)
- Terminal CLI → Terminal charts: draws chart (evidence: `packages/terminal/src/cli/main.ts`)
- Terminal charts → Scene tree: builds scene (evidence: `packages/terminal/src/charts.ts`)
- Application caller → Interactive playground: edits example
- Interactive playground → Type worker client: requests types
- Type worker client → Type worker: sends requests (evidence: `packages/playground/src/types/client.ts`)
- Type worker → TypeScript service: runs service (evidence: `packages/playground/src/types/worker.ts`)
