The following code works to create an interactive heatmap (movable/zoomable).
How to add the possibility of doing a selection rectangle (“Region Of Interest”, ROI), that will stay displayed?
If we use the icon “selection+magnification glass”, it works with a drag and drop, but after releasing the mouse, it automatically zooms in the selection.
Instead, I would like to keep the selection rectangle displayed, but not zoom in it : just keep the selection rectangle visible as a ROI (Region Of Interest) of the bigger image.
We are currently working on persistent and editable selection overlays (see Persistent box selection overlay by mattpap · Pull Request #12468 · bokeh/bokeh · GitHub) which will be available in bokeh 3.1), so this may be useful. Otherwise will are investigating adding support for data annotation tools (not yet clearly defined in scope and functionality) in a longer time perspective.
Thanks @mateusz and @Bryan for your answers! Your link SelectionGeometry example looks like a good solution for now! Would you know how to allow only one selection rectangle?
i.e. when the user does a second selection rectangle, it replaces the previous one.
With the SelectionGeometry tool, we cannot move or resize the rectangle selection box after the selection has been made, is that correct?
Yes, you would have implement this yourself, but this is precisely what my PR is trying to achieve.
(…) both moving and resizing seem to be available. Will this feature be available in BokehJS (without Python)?
Functionality of bokeh (Python) and bokehjs is mirrored as much as possible, so yes it will be available.
Would you have the example code that allowed you to record the screencast? I’d like to test this new feature
In the PR, there is new examples/interaction/tools/persistent_selection.py example, however it is tailored to selection tools. Other uses are still work in progress, so no examples thus far.
@stamljf Since this is a new feature, it will go in a 3.1 release. The next planned release will be in January, but it may be a 3.0.x bugfix release if the 3.1 branch is not ready then.
With the SelectionGeometry tool, we cannot move or resize the rectangle selection box after the selection has been made, is that correct ?
As @mateusz mentioned, that is not correct, but the updates have to be done manually, at present. Here is a relevant example: