Alternative to Tabs for Rapid Switching Between Viz Elements While Preserving State?

I am attempting to build a Panel application that allows the user to rapidly switch between a Tabulator view of a data frame and a map that visualizes the subset of geometries selected via Tabulator. I would rather not use the Tabs functionality to accomplish this switching, but I’ve yet to find a mechanism that is as performant and preserves state. The Tabs functionality is fantastic in that the map and data table aren’t reloaded after switching views. My first attempt at building an alternative, with buttons that trigger updates of the Row elements defining the viz, shows the map and data table are getting reloaded and the current state of each viz element is lost after switching.

Is there a way to achieve this view switching similar to Tabs but via another mechanism? I’d like to place the buttons for switching between views elsewhere in the viz, integrating them into a side panel with other controls.

Any pointers would be greatly appreciated!


1 Like

This is a great question. The Tabs allow for this because switching tabs still keeps the generated Bokeh.js View objects in memory and switching a tab simply re-adds the DOM elements. What you could try is simply toggling the visible parameter on the individual objects.

1 Like

Brilliant - thank you for this! I’ll dig into the documentation and see if I can put the pieces together. If not, I’ll circle back.

What you might run into is that a specific component does not correctly implement visible, in which case you should raise an issue.

Sounds good. Will do.

Just implemented this and it worked brilliantly with the DeckGL and Tabulator components. Thank you again!!

1 Like

Sounds like a cool project. Are you able to link to code?

1 Like

As in share code to the application? I can’t do that at present unfortunately.

1 Like