Black Lives Matter. Please consider donating to Black Girls Code today.

Multi dropdown option in Plotly

Hi All,

I am trying to add a multi-selection dropdown to my plotly chart (Python). However, I can only find support for this in Dash (e.g. https://dash-gallery.plotly.host/dash-drug-discovery/).

Plotly.py only seems to allow only single dropdowns, and I am not able to work around it by creating multiple separate dropdowns as it overrides the visibility list. It would be great to have confirmed whether this feature is available or not, and whether there are any workarounds.

Thanks!

Hi @colin-soda,
Welcome to Plotly forum!
You can define more than one dropdown menu, because updatemenus is a list and each list element defines
one:

updatemenus = [dict(active=0,
                   buttons=[button1, button2]), #first dropdown menu

              dict(active=0,
                  buttons=[button3, button4, button5] #second dropdown menu
              ]