Skip to content

Instantly share code, notes, and snippets.

@hcoohb
Created July 20, 2022 05:58
Show Gist options
  • Save hcoohb/1e5d2598265f3556adee09260adbf94a to your computer and use it in GitHub Desktop.
Save hcoohb/1e5d2598265f3556adee09260adbf94a to your computer and use it in GitHub Desktop.
Vega-Lite bar with params - deneb issue
{
"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}
]
},
"params": [
{
"name": "cornerRadius",
"value": 0,
"bind": {"input": "range", "min": 0, "max": 50, "step": 1}
},
{"name": "labels", "bind": {"input": "checkbox"}},
{
"name": "color",
"bind": {"input": "select", "options": ["gray", "green", "red", "blue"]},
"value": "gray"
}
],
"encoding": {
"x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
"y": {"field": "b", "type": "quantitative"}
},
"layer": [
{
"mark": {
"type": "bar",
"cornerRadius": {"expr": "cornerRadius"},
"color": {"expr": "color"}
}
},
{
"mark": {"type": "text", "baseline": "bottom"},
"encoding": {
"text": {
"condition": {"param": "labels", "field": "b", "type": "quantitative"}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment