Skip to content

make a PlotFrame class for Toolbar and sidecar functionality #310

Closed

Description

@clewis7

TODO once #300 is merged

Activity

  1. clewis7 commented on Sep 23, 2023

    @clewis7
    MemberAuthor

    show() method is getting pretty spaghetti-like, need to create a class for Plot and GridPlot to subclass from

  2. kushalkolar commented on Sep 24, 2023

    @kushalkolar
    Member

    More thoughts from #300 :

    1. 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.
    2. 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.

  3. kushalkolar commented on Oct 2, 2023

    @kushalkolar
    Member

    All toolbar buttons should be @properties so the button states and programmatic access are synced

  4. kushalkolar commented on Oct 4, 2023

    @kushalkolar
    Member

    Thinking about this a bit, and I think that the best way to organize this is to get some direct inspiration from pyqtgraph 😄

    https://pyqtgraph.readthedocs.io/en/latest/getting_started/plotting.html#organization-of-plotting-classes

    image

  5. kushalkolar commented on Oct 12, 2023

    @kushalkolar
    Member

    sidecar instance, and other plot "housekeeping" instances should be read-only properties.

  6. kushalkolar commented on Oct 26, 2023

    @kushalkolar
    Member

    @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.

  7. clewis7 commented on Oct 26, 2023

    @clewis7
    MemberAuthor

    I think supporting Qt would be great, would also help with the napari embedding too probably

  8. kushalkolar commented on Oct 26, 2023

    @kushalkolar
    Member

    this wouldn't help with napari, that's really a napari-specific issue where their canvas isn't easily swapped out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions