Skip to content

Instantly share code, notes, and snippets.

@chrisdone-artificial
Created February 7, 2025 14:11
Show Gist options
  • Save chrisdone-artificial/7be9e43a829e9d49c6a95f8738f76822 to your computer and use it in GitHub Desktop.
Save chrisdone-artificial/7be9e43a829e9d49c6a95f8738f76822 to your computer and use it in GitHub Desktop.
vega lite for a line chart with error bands.json
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"autosize": {
"type": "fit", "contains": "padding", "resize": true
},
"height": 100,
"width":"container",
"data": {
"values": [
{
"mean": 1.211,
"upper": 1.250,
"lower": 1.145,
"stddev": 0.058,
"commit": "015b",
"timestamp": "2024-01-04"
},
{
"mean": 1.213,
"upper": 1.280,
"lower": 1.142,
"stddev": 0.052,
"commit": "2eae",
"timestamp": "2024-01-05"
},
{
"mean": 1.213,
"upper": 1.280,
"lower": 1.142,
"stddev": 0.052,
"commit": "dfsdf",
"timestamp": "2024-01-05"
},
{
"mean": 1.213,
"upper": 1.280,
"lower": 1.142,
"stddev": 0.052,
"commit": "dfgd",
"timestamp": "2024-01-05"
}
]
},
"layer": [
{
"mark": "errorband",
"encoding": {
"x": {
"field": "commit",
"type": "ordinal",
"title": null
},
"y": {
"field": "lower",
"type": "quantitative",
"title": ""
},
"y2": {
"field": "upper", "title": "Max"
},
"tooltip": [
{"field": "commit", "title": "Commit"},
{"field": "timestamp", "title": "Timestamp"},
{"field": "upper", "title": "Upper Bound"},
{"field": "lower", "title": "Lower Bound"},
{"field": "stddev", "title": "Standard deviation"}
]
}
},
{
"mark": {"type": "line", "point": true},
"encoding": {
"x": {
"field": "commit",
"type": "ordinal"
},
"y": {
"field": "mean",
"type": "quantitative"
},
"color": {"value": "blue"},
"tooltip": [
{"field": "mean", "title": "Mean"}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment