Skip to content

Instantly share code, notes, and snippets.

@PBI-DataVizzle
Created January 8, 2024 22:18
Show Gist options
  • Select an option

  • Save PBI-DataVizzle/03f3a167bfd8fc21255e80be31e019c9 to your computer and use it in GitHub Desktop.

Select an option

Save PBI-DataVizzle/03f3a167bfd8fc21255e80be31e019c9 to your computer and use it in GitHub Desktop.
scatter_plot_binds_example
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"url": "data/cars.json"},
"params": [
{"name": "toggleOrigin", "bind": {"input": "checkbox"}},
{"name": "paintbrush", "select": {"type": "point", "on": "pointerover"}},
{"name": "brush", "select": "interval"},
{
"name": "opacityVar",
"value": 50,
"bind": {"input": "range", "min": 1, "max": 100}
}
],
"mark": "point",
"encoding": {
"x": {"field": "Horsepower", "type": "quantitative"},
"y": {"field": "Miles_per_Gallon", "type": "quantitative"},
"color": {
"condition": {
"param": "toggleOrigin",
"field": "Origin",
"type": "nominal"
},
"value": "steelblue"
},
"size": {"condition": {"param": "paintbrush", "value": 300}, "value": 50}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment