discover · compare · collections · requirements · contribute · feed · watching · stats · help with your tokens
metricsgraphics/metrics-graphics · source
Snapshot 0 · 2026-11-04T12:47:23Z · TypeScript ·
Content fingerprint
3b6a8b5601304e030b52b03a8107c2bb736b1660fc4948757f156f76db3e8be7GitHub description at capture
A library optimized for concise and principled data graphics and layouts.
README at capture
[](https://metricsgraphicsjs.org)
[](https://bundlephobia.com/result?p=mg2) [](https://codeclimate.com/github/jens-ox/metrics-graphics/maintainability) [](https://app.netlify.com/sites/affectionate-benz-6e3cf9/deploys)
*MetricsGraphics* is a library built for visualizing and laying out time-series data. At around 15kB (gzipped), it provides a simple way to produce common types of graphics in a principled and consistent way. The library currently supports line charts, scatterplots and histograms, as well as features like rug plots.
## Example
All you need to do is add an entry node to your document:
```html
<div id="chart"></div>
```
Then, use the id to mount the chart:
```js
import LineChart from 'metrics-graphics'
new LineChart({
data, // some array of data objects
width: 600,
height: 200,
target: '#chart',
area: true,
xAccessor: 'date',
yAccessor: 'value'
})
```
That's it!

The raw data for this example can be found [here](packages/examples/src/assets/data/ufoSightings.js)
## Documentation
If you want to use *MetricsGraphics*, you can find the public API [here](packages/lib/docs/API.md).
If you want to extend *MetricsGraphics*, you can read up on the [components](packages/lib/docs/Components.md) and [utilities](packages/lib/docs/Utility.md).
## Development Setup
This project uses [Yarn Workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/). Please make sure that Yarn is installed.
```bash
# clone and setup
git clone https://github.com/metricsgraphics/metrics-graphics
cd metrics-graphics
yarn install
```
Run both the development setup of the library and the development setup of the examples
```bash
# inside packages/lib
yarn dev
# inside packages/examples
yarn dev
```