Skip to content

Instantly share code, notes, and snippets.

View Spencatro's full-sized avatar

Spencatro Spencatro

View GitHub Profile
@Spencatro
Spencatro / 00_plotly_dash_multiple_clickdatas.md
Last active March 20, 2023 11:09
Choosing the last clickData event from a list of graphs in plot.ly dash

I've been working with plot.ly dash a bit lately, and let me tell you: this tool is incredible. I won't spend too long gushing about it, but definitely check it out if you ever need to draw graphs, but don't want to have to learn a million javascript graphing libraries to get it done. This gist will assume you have a decent base knowledge of plot.ly dash, so if you don't have much experience, you probably will want to go play around with it some.

While composing various interactive graphs, I found that I needed a way to use clickData events from multiple graphs as inputs to a callback, so that when a user clicked on any of three graphs, some other graph could redraw using a subset of data from whichever graph was clicked. This starts out sounding like a pretty