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

Interaction between two dataframes in dash

Hi there,

I am very new to plotly and dash, up until now I have mainly been using matplotlib.

I am working on a dashboard and the end results should look more or less like this example in the dash tutorial, https://dash.plot.ly/interactive-graphing, “Update graph on hover”.

My problems is that my data is divided into two different dataframes, one for the main scatter and one for the timeseries plots.

Ideally, I would like to update the timeseries plots based on which point is selected on the main scatter plot just like in the example.

Is there a way to do this other than try to merge the two dataframes?

I can provide the dataframes and my temporary code if needed.

Use customdata for providing a common attribute key in two dataframes and then generate the graph for the other. That’s what i have been doing too.

Hi there, and thanks for writing in!

A toy version of your app would help provide more context, but this should be possible. With hover events, all you’re doing is getting a list of points that are hovered, represented as dicts providing x, y, and other metadata. If these values are coming from one dataframe, as long as you’re able to filter the other dataframe based on one of the values coming in, you should be able to achieve what you want.