https://github.com/interactivethings/chart-server
A server for a light-weight charting system.
https://github.com/interactivethings/chart-server
Last synced: 8 months ago
JSON representation
A server for a light-weight charting system.
- Host: GitHub
- URL: https://github.com/interactivethings/chart-server
- Owner: interactivethings
- License: bsd-3-clause
- Created: 2016-11-11T22:58:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-16T10:16:29.000Z (about 9 years ago)
- Last Synced: 2025-05-05T10:40:38.832Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.69 MB
- Stars: 17
- Watchers: 6
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chart Server
A server for a light-weight charting system.
[](https://docs.google.com/spreadsheets/d/18ByaFrHDh7y0_nY-mFrk05Nx21e0UBAWe-qKfd2tAL8/edit#gid=0)
Read «[Roll your own charting system](https://blog.interactivethings.com/69f5753efc1c)» on the Interactive Things blog to learn more.
## Chart Types
You can render any Vega-Lite specification to SVG by sending it to `/VegaLite` with the `spec` query paramter.
Example:
```json
{
"description": "A simple bar chart with embedded data.",
"data": {
"values": [
{"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
{"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
{"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
]
},
"mark": "bar",
"encoding": {
"x": {"field": "a", "type": "ordinal"},
"y": {"field": "b", "type": "quantitative"}
}
}
```

Additionally three example chart types, `Bar`, `DemographicBar` and `DistrictBar`, built on top of Vega-Lite and one, `ZurichMap`, build on top of Vega are provided in the [`charts` folder](https://github.com/interactivethings/chart-server/tree/master/charts). There is also a example [essay](https://interactivethings.github.io/chart-server/example.html) and [spreadsheet](https://docs.google.com/spreadsheets/d/1Mt6xzEGcuO9cusTUB3q3JwhNOZbhwHK71TfpOaUWS9c/edit?usp=sharing) available utilizing those types.
## Prerequisites
- make
- [Node.js](https://nodejs.org/) (v6)
- [Cairo](https://github.com/Automattic/node-canvas#installation)
## Develop
Install dependencies and start the development server
```
make
```
## Deploy
The repository contains a `Dockerfile` and `app.json` manifesto and can easily be deployed.
- [▲ ZEIT `now --docker`](https://zeit.co/now)
- [Deploy to Heroku](https://heroku.com/deploy)