-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement shared zoom state #6914
Conversation
Until we have a way to only listen for changes from outside of the visualization, or a way to tell the visualization not to render for specific changes, this is what we have to do
… to link() in children
…st setSilent() calls
@spalger showed me this pr as some help with my implementation of the same thing. I'm not a fan of this, because i think it does too much. I don't think aggConfigs need a uiState, when they all have access to the vis which already has one. |
One of the goals with the uiState design was to support sub-states, which is what the states attached to each aggConfig are, a sub-state of the visualization uiState. The reason I prefer the sub-state implementation is because it links the state values for an agg to that agg; if that agg gets deleted so does it's UI state, multiple aggs can have separate uiStates, etc. if some state value makes more sense at the vis level it can still go there, but I think that having agg-level uiStates is a win overall. |
Wouldn't it be better to save the map bounds instead of the zoom and center? When I move the map to fit a country, I want the map to fit this country in the dashboard with a smaller map, and I think you cannot do this with only the zoom and center. |
Hmm, idk how i feel about that, @spalger, this is the only scenario we would have to have developed it for so far, and why build something extra, and add more abstraction for one thing? Also they already have params which I'm investigating currently but seem to be persisted someway, probably after I can see kind of where you're coming from I just don't think the Agg is the correct place for this, Perhaps we can move it to the vis, it's already there, just kind of not really implemented, this can also be linked to a child state based off of the ID but will enable us to do a whole bunch of cool things on the dashboard like panel specific filters. To sum up; the |
@jazzzz we currently pick the geohash precision based on the zoom level in a static map. The center point is just there to restore the focus of the visualization. @panda01 it's your change, so I'll let you implement it how you like. I agree now that aggregation-level uiState really isn't useful for two reasons:
|
This change implements a way to save the zoom and center position of the map using uiState.
It does this by doing two things: