Forum Discussion
kbdw
3 years agoNew Member
Wind Direction Aster Plot
Hello, I am trying to create an aster plot (or similar) showing wind direction at a weather station. The measurements were every 15 minutes, from which I have created an average daily measurement...
dm-p
3 years agoSuper User
Updated version with a ThetaMid column (which is just the angle value in radians for the text mark):
{
"data": {"name": "dataset"},
"layer": [
{
"mark": {
"type": "arc",
"innerRadius": 20,
"stroke": "#444"
}
},
{
"mark": {
"type": "text",
"radiusOffset": 50
},
"encoding": {
"text": {
"field": "Direction",
"type": "nominal"
},
"theta": {
"value": {
"expr": "datum['ThetaMid']"
}
}
}
}
],
"encoding": {
"theta": {
"value": {
"expr": "datum['Theta']"
},
"type": "quantitative",
"stack": false
},
"theta2": {
"value": {
"expr": "datum['Theta2']"
},
"type": "quantitative"
},
"radius": {
"field": "Sum of Count",
"scale": {
"type": "sqrt",
"zero": true
}
},
"color": {
"field": "Direction",
"type": "nominal"
}
}
}
Cheers,
Daniel
lbendlin
3 years agoSuper User
Thank you for the insights. Need to bottle this up somehow. You're not planning to write a book or something on the finer details of data binding by any chance?