Allowing user to resize a bokeh plot


I am trying to create a bokeh plot that can be resized or moved by the user using mouse click and drag options. Does this implementation already exist somewhere?

Any direction on how to even start thinking on this is much appreciated.

Thanks a lot!

There are two parts to this task:

  1. Make the plot container interactive, allowing resizes
  2. Pass the new size to the underlying Bokeh plot

To solve (1), you can either write something yourself or use one of the numerous JS libraries that already do that. For example,
To solve (2), you have to get a handle to the correct instance of the models/plots/plot/Plot model and just set width and height to the new values. In order to get the instance, you can either specify a model ID when you create the plot and then just call Bokeh.documents[0].get_model_by_id(model_id) (assuming you have just one document on the page) or you can store the model when you embed the document (feasibility of this option depends on how you actually embed the document into your web page).

Thanks Eugene for breaking down the problem in two tasks. Solution to task 1 was exactly what I was looking for:) I am excited to try your solution.