admin管理员组文章数量:1122846
I've got a U.S. choropleth with a lookup transform of the counties to the sunrise time (in UTC minutes).
It works, but it's just a single day. My dataset has a column for every day of the calendar year, and I would like to add this dimension to the visualization.
Here is the spec:
{"encoding": {
"color": {
"field": "1-june",
"type": "quantitative",
"scale": {"scheme": "rainbow"}
}
},
"transform": [
{
"lookup": "id",
"from": {
"data": {
"url": "http://localhost:7777/_fs/resources/data/sunrise-times.csv"
},
"key": "geoid",
"fields": ["1-june"]
}
}
],
"mark": "geoshape",
"width": 650,
"background": "transparent",
"$schema": ".json",
"projection": {"type": "albersUsa"},
"height": 400,
"data": {
"url": "http://localhost:7777/_fs/resources/data/counties-10m.json",
"format": {"type": "topojson", "feature": "counties"},
"name": "counties-geojson"
}
}
Note that in this case I am just showing 1-june
, but once again, I want to incorporate the whole calendar year. It seems like I just need to figure out:
- How to encode an array of column names into the spec
- How to interactively choose a column
A slider input could work (a range), if that integer value could be used to index into the column name array.
I tried adding the column name array as an inline dataset, but that didn't seem to be present at runtime. I could make it a parameter as well, but I'm not sure how to reference parameters in an expression.
I'm very open minded as to the best way to implement this.
本文标签: vegalite choropleth with interactively chosen lookup fieldStack Overflow
版权声明:本文标题:vega-lite choropleth with interactively chosen lookup field - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300647a1930890.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论