September 6, 2017, 12:31pm
for sure this question is trivial for many of you, but I totally lack in js coding.
I have a simple scatter plot and I pass, besides
y also an
ids list that contains ids of each feature.
ids are different than the
standard id returned by plotly.
What I’m not able to do is getting the specific element of the ids list when clicked on the corresponding point in the plot.
The plot code is here:
hovering on the points return the value, an additional text and the corresponding ids.
Is it possible to get that value?
Many thanks for any hint
September 6, 2017, 1:31pm
Here are all the fields you can grab from the plotly click event data.
September 6, 2017, 1:49pm
thanks again for the answer.
My problem is that I’m not able to get the single data of the clicked point. It is easy with
pointNumber. But with something like this:
I get the whole list of
ids and not just the single item…
Maybe that’s more a pure
js question that a plotly one…
September 6, 2017, 2:31pm
what about this
September 6, 2017, 2:46pm
that’s exactly what you suggested me here:
the problem is that sometimes (I did not figure out when and why this happens, I think might be input data related) the
id returned by plotly (what you wrote above) is not the same of the original id of the data.
So I was thinking that passing a default array with custom
ids (different than
standard ones) might be the solution