question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

x-unified hover skips a level for data with different lengths

See original GitHub issue

Synopsis

This is rather difficult to describe, but I’ll give it a go and use visual aids to convey it.

Given the following:

  • hovermode: "x unified"
  • There are many data points on the graph - roughly >100.
  • There are two sets of data - i.e. one visualised as bar and one as line - and one of the two ends before the other.

As you approach the end of the x-axis, the hover jumps one level as the shorter dataset ends.

Examples

You can see an example of the issue on our live service. There is also an alternative description of the issue in our repository.

The issue basically boils down to this:

In the animation, you can see that when hovering from 3 May to the right, the next point is skipped and then the successive point for 5 May is then displayed. This happens even if you manage to hover exactly over the bar for 4 May.

screengrab

Exceptions

The issue resolves itself if you zoom into the data (x-axis zoom).

Expected behaviour

The tooltip should be displayed for all successive points and jump one step at a time.

Additional info

In case it helps, the code for the visualisation can be found here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolaskruchtencommented, Jun 8, 2021

“no longer snappy” doesn’t really sound great, but if you’re happier with the behaviour I’ll take it 😉

happy to help, and happy to chat with you 1-1 if there’s anything else I or anyone on the Plotly team can do to support your important work 💪

1reaction
nicolaskruchtencommented, Jun 8, 2021

OK, I see what’s happening. I think the behaviour is very slightly improved in 2.0 but it’s still not doing what you’d like. Internally, the scatter trace is taking precedence and because the default layout.hoverdistance is 20, there’s some radius beyond which it’s overriding the bars. I’ll think about a better default behaviour a little bit, but in the meatime, for your specific charts which have a fully-dense coverage using bars, I think that setting layout.hoverdistance=1 or some other small number will get you what you need.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When using plotly in R with "hovermode = 'x'" enabled, is it ...
I've been able to skip hoverinfo for entire traces, and I have been able to get the behavior I want with simple scatter...
Read more >
Dates appear twice on hover-over on bar charts #332 - GitHub
Describe the bug On the vaccinations given chart, the hover-over on daily doses is missing ... x-unified hover skips a level for data...
Read more >
Customizing text on x unified hovering - Plotly Python
I'm using “x unified” hovermode on a plot where the x-axis variable is a date. I'd like to be able to customize the...
Read more >
plotlywidget | Yarn - Package Manager
... plot axes in one dimension and the data in another dimension can be added ... This makes it possible to skip hover...
Read more >
python-plotly-4.7.1-bp152.1.1 - SUSE Package Hub -
This makes it possible to skip hover information for some arguments or to change ... data correctly [#2357] * Performance + This version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found