Closed mattijn closed 7 months ago
Thanks for the report. Looking at the Vega spec that Vega-Lite generates here I noticed something. Selections in Vega-Lite are represented as Vega datasets with a _store
suffix. The selection that represents the interval selection is stored as the param_3_store
dataset. In the Vega editor Data Viewer, the initial value of `param_3store is:
But the initial value specified in the dataset itself in the spec is:
{
"name": "param_3_store",
"transform": [{"type": "collect", "sort": {"field": "_vgsid_"}}],
"values": [{"unit": "view_3", "_vgsid_": [-50, -110]}]
},
It looks like the param_3_store
dataset is initialized with the range of the selection rather with the IDs of the selected data points, so the first time the selection is evaluated nothing looks selected.
The way this works normally is that the the store is updated in response to the geo_interval_init_tick
signal, which triggers every millisecond.
{
"name": "geo_interval_init_tick",
"value": null,
"on": [
{
"events": "timer{1}",
"update": "geo_interval_init_tick === null ? {} : geo_interval_init_tick"
}
]
},
Looks like this boils down to https://github.com/vega/vega/issues/3481.
I'll see if I can make a corresponding workaround in vl-convert
I got this worked out in https://github.com/vega/vl-convert/pull/138
I noticed that colors as defined by a condition based on a selection value not is evaluated (ref: https://github.com/altair-viz/altair/pull/3275).
I would expect something as such:
But it is saved as such:
Probably something with this part
Full reproducible example: