Hi,
I think you will have to wait for some upcoming changes to see other avenues for improvement. There are various deficiencies with tabs that are “overlookable” for small cases, but are probably not acceptable with 20+ tabs. Bokeh uses a constraint solver to solve for its layout positioning, and currently creates one set of constraints per document root, which means everything in all tabs add up to one enormous pile of layout constraints, even though only one tab is visible at a time.
The upcoming work will allow individual document roots to be individually “addressable” for templating purposes, so you will be able to use a other/better JS tab/panel libs than Bokeh’s built in one, and put different plots (or whatever) in each tab. Bokeh will not try to combine layout constraints across them if they are different document roots. I am going to be working on this next week, I think it’s probably one of the most important remaining pre-1.0 tasks.
If you are after simple and quick, Bokeh layouts are terrific, but if you needs something more sophisticated and polished, realistically we will never be able to make Bokeh layouts all that much better (we don’t have the experience in team, and it would be duplicative of lots of other existing work) so a way to embed individual document roots in a template should provide a relief valve for that case.
Thanks,
Bryan
On Sep 29, 2017, at 09:16, Sébastien Roche sebastie...@gmail.com wrote:
In the code below, the first time I click the button it takes ~1 sec to add the 10 tabs, the second time it takes ~5 sec to add the next 10 tabs, the third time it takes ~10-15 sec etc.
from bokeh.plotting import figure
from bokeh.models import Tabs,Panel,Button
from bokeh.io import curdoc
button = Button(label=‘add tabs’, width=200)
main = Tabs(tabs=)
j=0
def add_tabs():
global j
main.tabs+=[Panel(child=figure(),title=‘tab’+str(j+i)) for i in range(10)]
j+=10
button.on_click(add_tabs)
curdoc().add_root(button)
curdoc().add_root(main)
It seems to update all the tabs each time. Can I add a new Panel to a Tabs object without updating all the other Panels?
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7af0c69e-cbf4-4b00-bde6-a84740b5e8b0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.