I want my users to be able to zoom/pan in specific parts of the plot depending on an event external to the plot.
My “data scientist” scenario:
- I return a holoviews plot in a jupyter notebook cell
my_recs = hv.Rectangles([[ 0, 10,
10, 20],
[ 40, 50,
30, 40],
]).opts(fill_color= ‘black’,line_width=0)
my_recs - in the next cell I want to do something like:
my_recs.set_bounds(x=(0,20))
without returning the plot in this new cell, just modify the plot in the previous cell
My User scenario (a dashboard served on the LAN): by selecting a number in a widget, the plot will zoom on the rectangle associated with it
note:
-
I am not interested in the streams object “BoundsXY” or anything like that, as it’s doing the opposite of what I need to do: this is a “getter” not a “setter”.
-
Using rectangles is just an example. I’m not interested in editing or creating rectangles or polygons.
-
returning
my_recs
in a function called within aPanel
pane, likemy_recs.otps(xlim=(0,20))
is not an option as it is extremely slow, it rebuilds the whole figure. I don’t want that. I want to instanciate my initial figure when starting the app, and just change the X and Y bounds from outside the bokeh plot.
Anybody has an idea?
Thanks