Skip to content

Instantly share code, notes, and snippets.

@briancodes
Created February 27, 2022 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briancodes/5f7bad5d19c7ec6d1890884cb62e00fa to your computer and use it in GitHub Desktop.
Save briancodes/5f7bad5d19c7ec6d1890884cb62e00fa to your computer and use it in GitHub Desktop.
vega-stacked-trellis
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"url": "data/seattle-weather.csv"},
"mark": "bar",
"encoding": {
"x": {
"timeUnit": "month",
"field": "date",
"type": "ordinal",
"title": "Month of the year"
},
"y": {
"aggregate": "count",
"type": "quantitative"
},
// add 'column' for trellis
// "column": {
// "field": "weather",
// "type": "nominal"
// },
"color": {
"field": "weather",
"type": "nominal",
"scale": {
"domain": ["sun", "fog", "drizzle", "rain", "snow"],
"range": ["#e7ba52", "#c7c7c7", "#aec7e8", "#1f77b4", "#9467bd"]
},
"title": "Weather type"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment