Hi, I have a scatterplot figure.
What I need to do Is to update the selectedData component when the restyleData component is called.
I want to do this to update a table were all the points that are selected in the graph are shown.
`
Basically just fire a selectedData callback once a legend is selected/deselected in the scatterplot
I have been trying with something like this:
def init_callbacks(self):
@app.callback(
[Output("data-table", "data"),
Output("data-table", "columns")],
Input("scatter-plot","selectedData"),
Input("scatter-plot", "restyleData"))
def update_table(updated_idx, updated_legend):
if callback_context.triggered_prop_ids:
component_updated = next(iter(callback_context.triggered_prop_ids))
if component_updated == 'scatter-plot.selectedData':
self.selected_idx = [point['customdata'] for point in updated_idx['points']]
if component_updated == 'scatter-plot.restyleData':
app.callback(Input("scatter-plot","selectedData")) # Want to do something like this but not sure how to do it
# DO SOMETHING ELSE
plot = self.df.iloc[self.selected_idx]
return df_to_plot(plot)
what is the best way to do this?
`