Thank you very much for your kind reply @talley .
If I understood correctly, in Napari we only have one VispyCanvas (which inherits from VisPy’s SceneCanvas), and within the canvas we only have one single VisPy’s ViewBox, and when we click on the grid button all the layers get plotted within that ViewBox, am I right?..This ViewBox only have one associated camera, which in 2D mode corresponds to a PanZoom camera. Therefore, when I click on the toggle button, and then proceed to do mouse-wheel zoom over the canvas, among all the layers currently rendered in the Grid View, only one of them gets truly zoom-in (the zoom target is the layer where the mouse is currently located), is this correct?.
When I took a look at the _on_grid_change_method, I saw there a call to _subplot. In this “subplot” function I was expecting to see the actual code that renders the image, but instead I saw that this method focused on configuring some parameters of a layer, could you please point me to the code that does the actual “plotting” of the image when we go to Grid view mode?.
Thanks for pointing me to the issue 760 and issue 561, very interesting!, but after reading these issues
I got very confused by the terminology . So I went back to revisited this excelent SciPy talk, where Almar Klein, one of the founders fathers of VisPy, explains the main concepts behind VisPy, and then I went to check this VisPy example. In this example we can see one SceneCanvas, which contains a grid of ViewBoxes, and each viewbox has its corresponding camera, and according to this code , these cameras can be linked.
My confusion is the following:
- why do these issues mentioned multi-canvas as a main-way to realize the “subplot” functionality?
- when they mention “multi-canvas”, do they mean multi-ViewBoxes?.
Please let me give you a little bit more context by explaining the use-case I have in mind: Let’s say we have 3 layers (all of them the same size), which correspond to 2D images of the same object captured by 3 different sensors (e.g., xrays, rgb camera and depth camera). When I click on the grid button, I would see the 3 images next to each other. Then, when I do some mouse-wheel zoom-in in one of the images, I would like to see how the exact same area gets also zoom-in in the other two images. At the moment, this is not possible in Napari because we only have one single ViewBox (where all the layers get render one next to each other) with one associated camera. Please bear with me, I am just brain-storming here , by taking some inspirations from the previous example , I think we can accomplish the desire functionality described in this use case by using a multi-ViewBox approach instead of a multi-canvas approach: we already have one SceneCanvas, so what if we create one ViewBox for each image, each one having a PanZoom camera (in the 2D case), and then we link the cameras, this way if we zoom-in in one image, this would also zoom-in in the other two images, what do you think
about this approach?..is there any disadvantage of this approach with respect to the multi-canvas approach described in the issues?
Thank you very much for your attention, and please excuse me for the long text .