Skip to content

Instantly share code, notes, and snippets.

@putnik
Created February 15, 2018 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save putnik/fa81f34f7cddf3b435f55803b541908c to your computer and use it in GitHub Desktop.
Save putnik/fa81f34f7cddf3b435f55803b541908c to your computer and use it in GitHub Desktop.
{
"version": 2,
"width": 700,
"height": 300,
"data": [
{
"name": "table",
"values": [
{"year":1907,"population":51815},
{"year":2011,"population":310956},
{"year":2017,"population":269022}
],
"transform": [
{
"type": "formula",
"field": "date",
"expr": "datetime(datum.year,1,1)"
}
]
}
],
"scales": [
{
"name": "x",
"type": "time",
"range": "width",
"domain": {
"data": "table",
"field": "date"
}
},
{
"name": "y",
"type": "linear",
"range": "height",
"domain": {
"data": "table",
"field": "population"
}
}
],
"marks": [
{
"type": "line",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x","field": "date"},
"y": {"scale": "y","field": "population"},
"stroke": {"value": "#99B2CC"},
"strokeWidth": {"value": 3},
"interpolate": {"value": "monotone"}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment