Adapt the width of a Bokeh figure to the width of the containing panel WidgetBox?

I first wanted to access the current width of the containing panel widget but there seems to be no field for this as the “width” field only shows the fixed or suggested width? Is it possible to retrieve the actual width of a widget in Python?

Is there some other way to automatically adjust the width of a Bokeh figure to the width of the containing WidgetBox (which stretches with the browser window)?

Maybe set the sizing_mode="stretch_width". But without a minimal, reproducible example (MRE), it is hard to help you.

1 Like