Drawing Line between points of different traces

I am new to Plotly and i want to find distance between two points in which one point is in one trace and the other is in an other trace. is there any possibility to do this. if yes please share the solution and i am using plotly with javascript

We don’t expose an easy way to that. I’d recommend adding traces to draw the line between points of different traces.

the new line is not permanent. just i want to calculate the distance between those to points and after calculating the distance he will click out side of the chart in that case this line has to disappear