Replies: 2 comments 4 replies
-
|
Currently Mosaic hasn't had careful design attention for charts that enter, leave, and re-enter a display. The simplest setup from Mosaic's perspective would be to preserve the original chart instances by hiding them rather than removing and reinstantiating them. Then the state should persist without issues. I think the current problem is that the prior selections persist within Mosaic's state, and they are then used to filter the newly instantiated versions. One needs to deregister clients. If you aren't doing so already, you can call Still, our current There is also a separate issue of serializing selections for reuse. Interactors maintain a I realize the above may be hard to follow if you don't know Mosaic internals. Sorry! Again, if possible, I think the easiest solution for now would to simply toggle the visibility of side charts without actually dropping charts and then adding completely new ones. |
Beta Was this translation helpful? Give feedback.
-
|
Happy holidays, Jeff! Thanks for your great work on Mosaic and for the detailed answer back then. I just stumbled upon the same issue again while working on the SQLRooms Deck.gl + Mosaic example, and wanted to ask, whether there's now a proper way of doing this in Mosaic. It seems that the filters are being correctly set and the charts are rendered correctly after hiding the filter panel and showing it again, but the brush rectangle isn't rendered and so the filter charts aren't interactive, although I am passing the same brush selection instance to the VgPlot charts. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello wonderful Mosaic team!
I am trying to use Mosaic in a kind of a dashboard with charts rendered in panels which can be toggled on and off. I noticed that when displaying a filterable vgplot chart again after it had been hidden, it would not pick up the previous selection correctly. Instead, it represents the filtered data as if it was the whole unfiltered dataset and the brush selection is empty.
Is there a way to initialize the chart so that the selection is represented correctly?
And a related question: is there a way to serialize and deserialize
Selectionso that the filter state can be saved in the dashboard and displayed correctly on reload?Thanks in advance!
Kapture.2024-03-28.at.09.15.39.mp4
The chart specs I use look like below, where
filterSelection = Selection.crossfilter():And the wrapper React component I am using to render the charts:
Beta Was this translation helpful? Give feedback.
All reactions