why does creating the figure with selectedpoints does not register those points to the SelectedData?
(the rest of the post explains what I am trying to do.)
I have a callback that filters well a couple of components but let’s focus only on the bar charts.
Important note: the callback uses only pattern matching of ALL.
I have tried 2 ways to make this work, so I will go over them one by one.
The first way:
let us say we have 2 bar charts.
I select data in one of them, and it triggers the callback. It goes over each id in the outputs. which includes the triggering id.
it runs two checks for each id in the output for the bar chart figures:
- Is the id the triggering id?
- does the chart have selecteddata?
if one of them is true then for that figure we return dash.no_update
now if we select data in one figure everything goes well!
if we deselect the data everything also goes well!
BUT, if we select data in the second figure, the first graph also changes.
which is a problem, it’s supposed to have selecteddata but when I run a check I see that the selecteddata is empty.
even though we had selected data before we selected data from the second figure.
I pass the selected points this way:
go.Bar( x=values, y=categories, orientation='h', selectedpoints=selected_points )
I double-checked that I pass the data and create the figure with the selectedpoints and I do.
so why does it not register in the SelectedData?
The Second Way:
we just don’t do any of the checks from the first way and we build the figures for the triggering graph as well, with the selected points of course.
so they’re supposed to be selected?
but the callback triggers right after we select the data once again (the triggering factor is because SelectedData is empty after we create the figure again), without any SelectedData in the triggering graph the figures go back to the original graphs before they were filtered (the new filtering factor is nothing SelectedData is empty).
So, any idea why creating the figure with selectedpoints does not register those points to the SelectedData?