Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/koaning/justcharts

Just charts. Really.
https://github.com/koaning/justcharts

Last synced: 15 days ago
JSON representation

Just charts. Really.

Awesome Lists containing this project

README

        

# justcharts

> Just charts. Really.

The goal of this project is to make it incredibly easy to hack together a [vegalite](https://vega.github.io/vega-lite/) dashboard declaratively. The goal is that anything made in the [vegalite editor](https://vega.github.io/editor/#/) can be copied into a static file with ease.

## include

You can use [jsDelivr](https://www.jsdelivr.com/?docs=gh) to deliver the `justcharts.js` file via CDN. Note
that you'll also need to have some vega dependencies around.

```html

```

## usage

There are two main ways you can create just charts.

### schema

You can create a vega based chart directly in html.

```html

```

### inline

Alternatively, you can also declare the vegalite-json definition inline in the `vegachart` component.

```html

{
"data":{
"url": "https://cdn.jsdelivr.net/gh/koaning/justcharts/bigmac.csv",
"format": {
"type": "csv"
}
},
"mark": "line",
"encoding": {
"x": {"field": "date", "type": "temporal"},
"y": {"field": "local_price", "type": "quantitative"},
"color": {"field": "currency_code", "type": "nominal"}
},
"width": "container",
"title": "hello there"
}

```

Note the `"width":"container"` setting. By doing this you're able to set the width/height of the chart directly from the `` html-style property. This is great for containers with relative widths.

## demo

You can find a demo [here](https://koaning.github.io/justcharts/).