Hello,
i want to get the x value everywhere i hover.If i hover on a blank spot, i want to get the x value and then get all y values for this x point. Is it possible?
Example:
AIMPED
October 7, 2024, 9:20pm
2
@Stunkata I don´t think that is possible with plotly. Even in dash
the hoverData
is only triggered, if hovering over an actual data point.
The only idea I had a while back to achieve something similar can be found here:
I understand. This is interesting! This is the solution I had in mind. If you do the callback clientside this could work quite well IMHO. But there is still room for improvement I guess.
import json
from dash import Dash, dcc, html, Input, Output, State
import dash_bootstrap_components as dbc
from dash.exceptions import PreventUpdate
import plotly.express as px
import numpy as np
# create image and plotly express object
fig = px.imshow(
np.zeros(shape=(90, 160, 4))
)
fig.add_scatter(
…