GeezerVison is showing github.com — make a `PlotFrame` class for `Toolbar` and `sidecar` functionality · Issue #310 · fastplotlib/fastplotlib
make a PlotFrame class for Toolbar and sidecar functionality #310Activityclewis7 commented on Sep 23, 2023 show() method is getting pretty spaghetti-like, need to create a class for Plot and GridPlot to subclass from
kushalkolar commented on Sep 24, 2023 More thoughts from #300 :
- I don't think we can use
Widget or any ipywidget imports, such as VBox directly within show() because if ipywidgets is not installed in the environment (if they are using fastplotlib with only glfw or Qt), this will raise a error.
- Likewise, since
Sidecar is referenced in show(), it will raise an error if it's not installed.
Proposed solution:
- Create
PlotFrameBase and two subclasses PlotFrameNotebook and PlotFrameDesktop. The notebook subclass implements the toolbar, other ipywidget stuff, and sidecar. The desktop subclass has a more basic show().
Need to think about how exactly to implement this. Should Plot and GridPlot just inherit from PlotFrame? Can probably use a __init_subclass__ method that determines if it's running in a nb or not, and then starts the right subclass. kushalkolar commented on Oct 2, 2023 All toolbar buttons should be @properties so the button states and programmatic access are synced kushalkolar commented on Oct 4, 2023 kushalkolar commented on Oct 12, 2023 sidecar instance, and other plot "housekeeping" instances should be read-only properties. kushalkolar commented on Oct 26, 2023 @clewis7 what are you thoughts on making a PlotFrame that's compatible with both ipywidgets and Qt? As much as we like ipywidgets, I think it's inevitable that a lot of people will want Qt. In notebooks we are quite limited by the jpeg encoding, which really becomes limiting as we approach 4k resolutions especially on laptops. clewis7 commented on Oct 26, 2023 I think supporting Qt would be great, would also help with the napari embedding too probably kushalkolar commented on Oct 26, 2023 this wouldn't help with napari, that's really a napari-specific issue where their canvas isn't easily swapped out
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|