[Kibana/Vega] Map signals latitude, longitude & zoom


I'm trying to modify the values of the latitude, longitude and zoom signals in order to have a global view of France and then, after a certain time (5s), zoom on a city (Paris in the example below). And back to the original view, and zoom, ...
And I'm getting various results, but not the one I want.

Here's the code:




When checking the signal values with VEGA_DEBUG.view.getState(), they are coherent with the code but the visualisation doesn't follow.
Each signal change independently functions.
But if I try all of them at the same time, depending on their order in the signals block, I can see a mix of changes (ex.: only zoom, or zoom and latitude but not longitude...) but not all three.
Tried by using a different timer signal for each signal, but no change.

Also, when for example latitude and longitude changes are taken into account, I see the visualisation move first for latitude, then for longitude. The visualisation doesn't "jump" directly to the new (latitude, longitude).
Is there a way to make the move "smoothly"?


This question might be better suited on the Vega GitHub Issues page.

If you look at this in the Vega Editor and click on Signal View and Record Signal Changes you can see they all change independently so it appears that is normal functionality built into Vega.

My only guess right now would possibly make the data into an array and just call the specific element. So the data would all update at the same time and you just reference the element you needed. Not even sure if that's possible, just saying that is what I would explore.


Thanks for the answer.
Not used to the Vega Editor, I'll have a look at it.
And post an issue on Vega GitHub.



I took a closer look at the vega documentation and it seems that signals are updated sequentially. So the behaviour is normal...

Still I managed to do what I wanted by creating the following signal:


setMapView() modifies all three signals at the same time.

The info was found here: GitHub - nyurik/leaflet-vega: Leaflet layer based on Vega visualization grammar.


1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.