No legendgroup for Surface objects?

Hi,
I’m looking to make a certain subset of traces (Scatter3d & Surfaces) show/hide on toggle via the legend. However, there doesn’t seem to be a legendgroup option for Surfaces… does anyone have a suggestion for a workaround?

The current behavior is, when I click a legend item that is part of legendgroup ‘A’, all Scatter3d objects will disappear but the Surface objects will not. I want both to disappear.

Thanks.

@gekko102

You can use a button to make the traces disappear using the visible attribute like in this example https://plot.ly/python/custom-buttons/#update-button

1 Like

Thanks. The update buttons work except for one tiny snag: is there any way to make them toggleable?
The args variable is just a list of boolean values, which means that combinations of buttons cannot be toggled like in the legends. Is there any way to make it so that the boolean list is APPLIED (i.e. logical and) to the current state of the data objects so that the visibility can be toggled on/off?

Appreciate the help.

@gekko102
Did you ever find a solution to this?
I’m trying to create update buttons which allow me to toggle mesh3d traces individually.

Hi @CarlAndersson,

this feature has been implemented in the last plotly version (4.5)

Alex-