Skip to content

trace shown in hoverinfo despite using hoverinfo='skip' #2077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ismirsehregal opened this issue Nov 22, 2021 · 1 comment
Open

trace shown in hoverinfo despite using hoverinfo='skip' #2077

ismirsehregal opened this issue Nov 22, 2021 · 1 comment

Comments

@ismirsehregal
Copy link

ismirsehregal commented Nov 22, 2021

Coming from here.

After updating from R plotly 4.9.4.1 to 4.10.0 (and therefore updating underlying plotly.js library from v1.57.1 to v2.5.1 as mentioned in the NEWS) using hoverinfo='skip' along with hovermode = 'y unified' still shows a trace - only the trace name is hidden:

library(plotly)

fig <- plot_ly()
fig <- fig %>% add_trace(x = ~2:4, y = ~4:6, name = "yaxis data", mode = "lines+markers", type = "scatter")
fig <- fig %>% add_trace(x = ~4:6, y = ~4:6, name = "yaxis 2 data", mode = "lines+markers", type = "scatter")
fig <- fig %>% add_trace(x = ~6:8, y = ~4:6, name = "omit_hoverinfo", mode = "lines+markers", type = "scatter", hoverinfo='skip')

fig <- fig %>% layout(
  hovermode = 'y unified'
)

fig

image

Result using R plotly 4.9.4.1:

image

@ismirsehregal
Copy link
Author

It seems this was already fixed in plotly.js:

plotly/plotly.js#5854

This does not occur using plotly.py 5.4.0 (with underlying plotly.js 2.6.3.)

import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Scatter(x=[1, 2, 3], y=[1, 3, 2]))
fig.add_trace(go.Scatter(x=[2, 3, 4], y=[1, 3, 2], hoverinfo='skip'))
fig.update_layout(hovermode="y unified")

fig.show()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant