I am trying to find a way to have the reset tool reset the plot zoom level only, without clearing the selection.
This behavior is controlled by plot_canvas.ts:
reset(): void {
if (this.model.reset_policy == "standard") {
this.state.clear()
this.reset_range()
this.reset_selection()
}
this.model.trigger_event(new Reset())
}
So it seems what I want to do is set the plot’s reset policy to event_only
and then from e.g. a Reset
event callback, call reset_range()
on the plot_canvas
directly. However, it’s not at all clear if/how I can access the plot_canvas
from the plot
object accessible to the js callbacks.
There seems to be no other straightforward way to reset a plot’s x and y ranges, unless I am missing something? I suppose you could set the start and end of each range to the values in bounds, though that’s a bit tedious.