Skip to content

[Feature] Impose GroupLayer order on LayerList to update view. #9

Closed
@willGraham01

Description

Is your feature request related to a problem? Please describe.

Currently reordering the items in the group layer list does not affect how the canvas appears (IE what layers appear above the others). Such changes are only reflected in updates to the LayerList interface itself.

Describe the solution you'd like

  • A button should be added to the GroupLayersWidget that when pressed returns a "flattened" order for the Layers.
    This button should then impose this order on the existing LayerList to re-render the canvas.
    (Extension) if a group is selected, allow imposing of the relative ordering of the layers within that group on the canvas.

Describe alternatives you've considered

Additional context

Activity

self-assigned this
on Jun 18, 2024
willGraham01

willGraham01 commented on Jun 20, 2024

@willGraham01
ContributorAuthor

This also concerns #16 - once we can impose the order of the layers back onto the main view, we can setup the appropriate signals to be emitted automatically and update the view without need of a button

willGraham01

willGraham01 commented on Jun 28, 2024

@willGraham01
ContributorAuthor

@K-Meech @alessandrofelder I have the widget now sync-ing the group layer order back to the main layer window, however had some things I wanted to run past you both about a sensible implementation for the reverse direction.

Since there are no groups in the main viewer, it is feasible that we could end up in a situation like this:

Main viewer        Group Layer Viewer

Layer_1            Layer_1
Layer_2            Group_A
                     - Layer_2
Layer_3              - Layer_3
Layer_4            Layer_4

Now suppose that the user moves Layer_4 above Layer_2 in the main viewer. Clearly Layer_4 should then move above Layer_2 in the group layer viewer, but it's not clear if it should go into Group_A or not.

Going further, if we have this situation:

Main viewer        Group Layer Viewer

Layer_1            Layer_1
Layer_2            Group_A
                     - Layer_2
Layer_3              - Layer_3
                     - Group_B
Layer_4                  - Layer_4
Layer_5            Layer_5

there are even more questions if Layer_4 gets moved - does Group_B go with it?

  • My gut instinct here is to say that we just re-order the layers in the group view as best we can, preserving the order where possible and pruning Groups that end up empty.
  • Alternatively, we just discourage use of the main layer viewer to organise layers when using the Group layers viewer (we could even disable/block the re-organisation events). Given we have our own set of controls now Adds independent layer controls to widget #22, and have right-click and LayerDelegate responsibility coming, this doesn't sound too restrictive but isn't ideal.

This is more a problem of us implementing things as a plugin rather than as core napari - if our plugin was replacing the main viewer, we wouldn't have this issue of course (as we wouldn't need to sync the two views)! Hence why I suggest option 2 above 😅

K-Meech

K-Meech commented on Jun 28, 2024

@K-Meech
Contributor

Great - thanks @willGraham01 ! My preference would also be for option 2.
Once the plugin is open, I think the idea is to ignore the 'real' layer list / controls as much as possible and just makes sure everything works consistently inside the plugin itself. If the syncing from the group layers back to the layer list works, then I'm not sure we need it in the other direction for now.

willGraham01

willGraham01 commented on Jul 5, 2024

@willGraham01
ContributorAuthor

Closing as complete in #26

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

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Participants

@K-Meech@willGraham01

Issue actions

    [Feature] Impose `GroupLayer` order on `LayerList` to update view. · Issue #9 · brainglobe/napari-experimental