Skip to content

Instantly share code, notes, and snippets.

View domoritz's full-sized avatar
📊
charting new territory

Dominik Moritz domoritz

📊
charting new territory
View GitHub Profile
@domoritz
domoritz / spec.json
Last active August 18, 2020 04:40
Gapminder Interactive
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Drag the sliders to highlight points.",
"data": {"url": "data/gapminder.json"},
"width": 800,
"height": 500,
"layer": [
{
"transform": [
{"filter": {"field": "country", "equal": "Afghanistan"}},
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@domoritz
domoritz / spec.json
Last active June 17, 2020 05:26
NYT Covid 19 Data
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us.csv",
"format": {"parse": {"deaths": "number"}}
},
"transform": [
{
"window": [
{"field": "deaths", "as": "previous_deaths", "op": "lag", "param": 1},
@domoritz
domoritz / .block
Created June 15, 2020 15:54
Altair container
license: mit
@domoritz
domoritz / .block
Last active June 13, 2020 02:38
Vega CSP test
license: mit
@domoritz
domoritz / .block
Last active June 13, 2020 02:30
Vega CSP inline code demo
license: mit
@domoritz
domoritz / .block
Last active May 21, 2020 16:28
Vega interaction bug with SVG
license: mit
@domoritz
domoritz / .block
Last active May 11, 2020 16:17
Vega out of sync demo
license: mit
@domoritz
domoritz / spec.json
Created May 10, 2020 17:55
Window smoothing with filter
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {"sequence": {"start": 0, "stop": 100, "as": "x"}},
"transform": [{"calculate": "random() * sin(datum.x/10)", "as": "y"}],
"vconcat": [
{
"width": 600,
"mark": "line",
"encoding": {
"x": {"field": "x", "type": "quantitative"},
@domoritz
domoritz / spec.json
Last active May 8, 2020 17:05
Vega-Lite spec from Fri May 08 2020
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.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}
]
},