How to put two figure in one TabPanel in Bokeh

Good morning, I have 2 figures

First for graph

graph = figure(
 x_range=Range1d(data.first().created, data.last().created),
 x_axis_type='datetime',
 y_range=Range1d(1, 1000),
)

and second for RangeTool

# Range Graph
range_figure = figure(
   x_axis_type='datetime',
   y_axis_type=None,
   tools='',
   toolbar_location=None,
   height=50,
   background_fill_color='#ffffff',
)
range_tool = RangeTool(x_range=composite_graph.x_range)
range_tool.overlay.fill_color = 'navy'
range_tool.overlay.fill_alpha = 0.2
            
range_figure.line(
  x=[reading.created for reading in readings],
  y=[reading.reading['ORP'] for reading in readings]
)
range_figure.xaxis.visible = False
range_figure.add_tools(range_tool)

I try to put them on TabPanel like children

...
TabPanel(
    title='Graph',
    child=layout(
    children=[
     column(
       children=[header_div],
       sizing_mode='stretch_width'
     ),
     graph,
     range_figure
    ],
  sizing_mode='stretch_width'
  ),
),
...

Everything is created perfectly, but after I try to embed it in React I have an error:
models must be owned by only a single document
Error shows only during rerender of the component only after 2-nd render.

When for e.i I remove one of the figures everything is working.

Most likely this, which will be fixed in upcoming 3.3.1

(Ignore the “Jupyter notebook” part of the OP title, the issue is deeper than that)

1 Like

huge thanks,

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