What is the error you are getting, or are you getting an error? Your first function has four Inputs but only three function parameters.
Maybe you could use State('oi_graphs','figure) as an input to display_hover_data.
When the hoverData is updated:
- check if the y data for the last thing in the figure’s
datalist has identical items (i.e.y[0]==y[-1], i.e. there’s already a vertical line) - if it does, just pop it off the end of the list
- add a
go.Scatter(marker=dict(...,mode='line')to the list ofdataat thehoverData's x coordinate with x and y vertical like in How do i plot vertical line over a timeseries curve in plotly? - return the new figure with the new vertical line
Using subplots make this harder, but I think the general idea would work, and it should be relatively fast.