Skip to content

Instantly share code, notes, and snippets.

@atn832
Created September 10, 2021 07:29
Show Gist options
  • Save atn832/f86f8d3b82e4314af4101ab83a4c0aae to your computer and use it in GitHub Desktop.
Save atn832/f86f8d3b82e4314af4101ab83a4c0aae to your computer and use it in GitHub Desktop.
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 700,
"height": 500,
"padding": 5,
"title": "CPU performance over time",
"data": [
{
"name": "benchmarks",
"format": {
"type": "tsv",
"parse": "auto"
},
"url": "https://gist.githubusercontent.com/atn832/f4ee6c9625d3846c34e8e739cfaeef36/raw/f1aa73815157fe868128cb1d8d22caf952892392/CPU%2520benchmarks.tsv"
}
],
"scales": [
{
"name": "x",
"domain": {"data": "benchmarks", "field": "Date"},
"round": true,
"nice": true,
"range": "width",
"type": "time"
},
{
"name": "y",
"domain": {"data": "benchmarks", "field": "Multi-core"},
"nice": true,
"range": "height"
},
{
"name": "color",
"type": "ordinal",
"range": "category",
"domain": {"data": "benchmarks", "field": "Platform" }
}
],
"axes": [
{
"scale": "x",
"title": "Date",
"orient": "bottom"
},
{
"scale": "y",
"title": "Multi-core Performance",
"orient": "left"
}
],
"marks": [
{
"type": "group",
"from": {
"facet": {
"data": "benchmarks",
"name": "facet",
"groupby": ["Platform", "Tier"]
}
},
"marks": [
{
"type": "line",
"from": {"data": "facet"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "Date"},
"y": {"scale": "y", "field": "Multi-core"},
"stroke": {"scale": "color", "field": "Platform"}
}
}
}
],
"legends": [
{
"title": "Platform",
"stroke": "color",
"symbolType": "stroke"
}
]
},
{
"type": "symbol",
"from": {"data": "benchmarks"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "Date"},
"y": {"scale": "y", "field": "Multi-core"},
"fill": {"scale": "color", "field": "Platform"},
"size": {"value": 50}
}
}
},
{
"type": "text",
"from": {"data": "benchmarks"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "Date"},
"y": {"scale": "y", "field": "Multi-core"},
"dy": { "value": -4},
"fill": { "value": "#000"},
"text": { "field": "Model"},
"align": {"value": "center"},
"baseline": {"value": "bottom"}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment