How to make static legend

I created 2 scatterplots using plotly express, and combined them into one visual using go.figure(). The graph has a dropdown, and the legend changes colors based on the values selected from the dropdown. The plot is dynamic, and I would like the legend to reflect all possible categories. Currently, the legend will only display the categories of the dropdown value selected, which may not always reflect all possible categories. However, I would like the legend to reflect all possible categories so that when you change values via the dropdown, the legend will remain constant, displaying all potential categories.

Hello @stapler,

Not sure there is a way to do this from plotly dcc.Graph alone. You could however mimic the behaviour using something like an ag grid to the side of the graph, which then responds to row clicks and things the same way that the dcc.Graph normally responds.