plotly / plotly/plotly.R

Missing aesthetic on hover in geom_rect()

Open
#1,003 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Ploltly is not showing in the hover all the variables used in aes().

Missing hover info with geom_rect:

library(ggplot2)
library(plotly)
test <- data.frame(C1 = c(2, 3), C2 = c(3, 4), C3 = c(2, 3), C4 = c(1, 4), C5 = c('A', 'B'))
ggplotly( ggplot(data=test) + geom_rect(aes(xmin=C1, xmax=C2, ymin=C3, ymax=C4, fill=C5)))

Result:
rect

Complete hover info with geom_segment:

 ggplotly(ggplot(data=test) + geom_segment(aes(x=C1, xend=C2, y=C3, yend=C4, color=C5)))

Result:
segment

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 supplied R examples with ggplot2 and plotly, comparing geom_rect() with geom_segment(). Trace the geom_rect conversion and hover-data handling in the plotly.R package; done means every variable mapped in aes(), including C1 through C5, appears in the rectangle hover information.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.