equinor / webviz-subsurface-components

Custom subsurface visualizations for use in Webviz and/or Dash.
https://github.com/orgs/equinor/projects/24
Mozilla Public License 2.0
40 stars 41 forks source link

Viewport with empty layer ids list shows all layers #2254

Open rubenthoms opened 2 months ago

rubenthoms commented 2 months ago

I would expect a viewport with an empty layer ids list to not show anything.

w1nklr commented 2 months ago

It is for convenience. If you display a single view (the usual case), you probably don't want to specify all the displayed layers on one side plus all the corresponding layer ids for the viewport...

rubenthoms commented 2 months ago

@w1nklr I understand the use case. However, in my opinion, sending in an empty list should result in showing no layers, as specified. Why can't layerIds be left undefined if one wants all layers to be displayed?

w1nklr commented 2 months ago

I don't know. I was not there at the initial design... I don't really see the use case needed to display nothing.

But if you have such an use case and if you can provide an easy way to display all the layers (and set that as DEFAULT_VIEWS), I don't object to a change.

BTW, this would be closer to Deck.gl approach: https://github.com/visgl/deck.gl/blob/4dd814805121ab70c16ea3b458593ecc92f92f1a/docs/api-reference/core/layer-manager.md?plain=1#L46

rubenthoms commented 2 months ago

We have a component where individual viewports can be added. To each of the latter custom layers can be added later on (in some sort of tree arrangement). When adding a layer to the first viewport, it becomes visible in all (empty) viewports although they should not have any children. We would be glad to have the possibility to temporarily have views without any layers.

hkfb commented 2 months ago

Agree, it makes sense to be able to show empty views, especially in the multi-viewport case.

It should be a minor change. Who will fix this (preferably with a story to demonstrate)?