I’m trying to find a solution within Plotly/Dash where I can filter the incoming data for a plot with the selection of a custom button.
For example, consider the following data:
x | y | Special
.23 .55 N
.11 .89 Y
.45 .34 Y
.91 .21 N
How could I make an ‘updatemenu’ addition to my plots that displays only the data points where Special=‘Y’ with one button selection or all of the points with another selection’?
What I have now:
my_figure.update_layout(
updatemenus=[
dict(
buttons=list([
dict(
args=[<unknown> (filter function goes here?)],
label="Only Special Data",
method="restyle"
),
dict(
args=[<unknown> (filter function goes here?)],
label="All Data",
method="restyle"
)
]),
),
]
)
I’m new to the custom button feature of Plotly so any help would be greatly appreciated!