Highlight clicked Marker in scattermapbox graph


#1

Hi everybody,

at the moment I’m working on a map, that has many measurement stations as markers in it. The color of these markers is generally set by a calculated model efficiency and the use of e.g. colorscale='Viridis'. If the user clicks on any of these markers, I update a second graph on the page and show some time series data. So far so good. What I can’t achieve is to somehow highlight the clicked marker. Of course I could update the entire map each time the user clicks on a marker and set the marker for the clicked data manually. But this is rather slow. The Box select or Lasso select are working pretty fast, but I need to work with clicks on marker points, not selection with the selection tools. Is there a similar property I’m unable to find, that lets the user specify a behaviour for the clicked data point? Something like highlight the clicked data point by colourizing it red our outline it?

Since this is more of a general question, I didn’t attach a code example, but I can add one if needed.


#2

Wow, sounds really cool. Would love to see this app or a screenshot of it if you are able to share it!

Ideally, we’ll add a “click” mode for selectedData. We’re discussing this one here: https://github.com/plotly/plotly.js/issues/1848 and https://github.com/plotly/plotly.js/issues/2143.

This is the best solution right now unfortunately.


#3

Hi Chris,

thank you as always for your fast reply. Okay so it’s as I thought and found the GitHub issue in the mean time. Guess I’ll wait then for a possible update, since repainting isn’t really an option for me here.

And of course I can show you some pictures, but it’s nothing fancy, just some basic dashboard I would say that I use for exploring the data of my current research project. Might publish it with the manuscript, once the paper is done, until then it only serves for me and my colleagues to explore the data.

Here are some images: