Sorry, something went wrong.
Sorry, something went wrong.
|
This is working now with JupyterOutputContext! Also fixed the wonky issue with auto-scale and center scene when you had a single controller controlling multiple cameras for diff subplots. Now onto Qt output context and toolbar. |
Sorry, something went wrong.
|
Everything works on my end, I tested every combination with ipywidgets, sidecar/no sidecar, Qt, and with ImageWidget. Right now the toolbar implementations are quite repetitive, we can make that nicer in a future PR after we have some time to think about it. Someone must have made a common interface between ipywidgets and Qt that we can use. qt.mp4 |
Sorry, something went wrong.
| self.output = (frame.canvas, *add_widgets) | ||
|
|
||
| if make_toolbar: # make toolbar and stack canvas, toolbar, add_widgets | ||
| self.toolbar = IpywidgetToolBar(frame) |
There was a problem hiding this comment.
what if ImageWidget? where is logic for if plot type is imagewidget?
Sorry, something went wrong.
There was a problem hiding this comment.
ImageWidget just uses the Gridplot context:
Sorry, something went wrong.
|
did you update the requirements file? |
Sorry, something went wrong.
|
Another thing I see is that when I have two subplots in an imagewidget and the camera y_scales are opposite that when I change click between subplots the flip button is not changing in accordance with the camera y_scale...just stays the same |
Sorry, something went wrong.
|
did you update the requirements file? No dependency changes here. |
Sorry, something went wrong.
|
Another thing I see is that when I have two subplots in an imagewidget and the camera y_scales are opposite that when I change click between subplots the flip button is not changing in accordance with the camera y_scale...just stays the same In ipywidgets or Qt? |
Sorry, something went wrong.
|
Another thing I see is that when I have two subplots in an imagewidget and the camera y_scales are opposite that when I change click between subplots the flip button is not changing in accordance with the camera y_scale...just stays the same In ipywidgets or Qt? ipwidgets |
Sorry, something went wrong.
|
did you update the requirements file? No dependency changes here. not even if someone only wants qt? they would need to have pyqt6 installed right? |
Sorry, something went wrong.
|
did you update the requirements file? No dependency changes here. not even if someone only wants qt? they would need to have pyqt6 installed right? Qt land is a bit complicated, so they will have to install Qt themselves separately. We can do toggles later, because to do this properly we need to give users the option of PySide etc and decide how broad we want this support. |
Sorry, something went wrong.
|
Another thing I see is that when I have two subplots in an imagewidget and the camera y_scales are opposite that when I change click between subplots the flip button is not changing in accordance with the camera y_scale...just stays the same In ipywidgets or Qt? ipwidgets I think now I see what you mean, it is wonky! So this is because in ImageWidget all cameras are under one controller. I did not decide how to deal with flipping when controllers are diff. What I will do is if the flip button is clicked, it will flip the camera for the current subplot but also any camera that has the same controller (similar to what I did for panzoom and maintain_aspect). |
Sorry, something went wrong.
closes #310 closes #342 closes #268
This PR adds a Frame class that manages how plots are shown. Plot and Gridplot, and any future flexilbe gridplot, inherit from Frame.
How this works:
Toolbars
Refactored ipywidget Toolbar that is common between Plot, Gridplot and any future gridplots
Output Contexts
These are classes that "hold" the output of a Plot/Gridplot. They determine how the canvas, toolbar, and any additional widgets are shown. When Plot.show() is called, they return an instance of one of the following output contexts based on the curent plot canvas.
This cleans up the messy show() calls we previously had everywhere, and cleans up other stuff too. Now the output context manages closing plots too.
BTW, the QOutputContext can also be used in notebooks with if you execute %gui qt before creating plots 😄