plotly / plotly/plotly.R

Hover information partially disappear when providing color input

Open
#2,311 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

Thanks for this package, it is very useful!
When using it, I encountered a kind of weird bug.

The two following plots should be identical and behave in the same way, except that the second one has colored points.

library(plotly)

plot_ly() %>%
  add_markers(
    x = c(1,2,3), y = c(1,2,3), z = c(1,2,3))

plot_ly() %>%
  add_markers(
    x = c(1,2,3), y = c(1,2,3), z = c(1,2,3), color = c(1,2,3))

For the first plot, all the values appear when I hover over all 3 points, as expected.
However, for the second plot, I can only hover over the second point; no information appears when I hover over the first nor the third point. Here are two screenshots that I made with the second plot (the one that has the bug).

image

image

The expected behavior is that the similar type of information would appear for all points.

More generally, I have the impression than when doing a scatter plot with $n$ points, I can only get the hover information of $n-2$ of them if they are colored. For example, the hoverinfo do not appear for the "extreme" points of this plot:

n = 10
plot_ly() %>%
  add_trace(
    x = 1:n, y = 1:n, z = 1:n, color = 1:n, type="scatter3d", mode="markers")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the two plot_ly()/add_markers() examples and the scatter3d example with n = 10 to reproduce the missing hover information at the extreme points. Compare the hover behavior for colored and uncolored points; done means hover information appears consistently for every point.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.