-
Notifications
You must be signed in to change notification settings - Fork 85
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
plotly graphs have don't correctly track cursor #47
Comments
+1, experienced this as well |
I am also experiencing this issue. Mine however is a different hovering pattern: to the right and below. |
@GuiMarthe Do you experience the same results with the minimal example? |
@sebastian-c, with your minimal example, I get the same problem, as you described, mouse having to be placed above and to the left. |
Huum, this is really curious. If you change the sign on the x aestetics -- as in the code below -- getting a negatively sloped sort of data, the points on the upper leftmost have the tooltip rightly detected by the mouse. Is it the same for you guys?
|
I'm not seeing a difference, but is that extra space you have before |
I have the same issue. Mine is also in the right and below : output: revealjs::revealjs_presentation
|
It seems like this is a conflict with sizing feature of reveal.js because this seems to solve the problem: ---
title: plotly test
output:
revealjs::revealjs_presentation:
reveal_options:
minScale: 1.0
maxScale: 1.0
---
```{r plotly, message = FALSE, echo = FALSE}
library(ggplot2)
library(plotly)
g <- ggplot(mpg, aes(x = cty, y = hwy, colour = as.factor(cyl))) +
geom_point()
ggplotly(g)
``` (found in plotly/plotly.R#648 (comment)) reveal.js do (a lot ?) about presentation size (https://revealjs.com/presentation-size/) including scaling. Avoiding scaling fixes the issue. So it seems an issue between reveal.js and plotly JS libs. I got the same issue with a recent reveal.js library using Pandoc directly. |
Related issues I believe:
It seems something has been fixed in plotly last year (plotly/plotly.js#5193) and available in plotly.js since 1.58.0 The R package version of plotly we are using here does not include this version. CRAN plotly is 4.9.4.1 and plotly.js version is 1.57 there. However, dev version of plotly now include v2+ of plotly.js (plotly/plotly.R#1982) And with this version, everything is working ok for me now. ---
title: plotly test
output:
revealjs::revealjs_presentation: default
---
# Plotly
```{r plotly, message = FALSE, echo = FALSE}
library(ggplot2)
library(plotly)
g <- ggplot(mpg, aes(x = cty, y = hwy, colour = as.factor(cyl))) +
geom_point()
ggplotly(g)
``` So I'll close this. If you the issue now, please install the dev version of plotly from https://github.com/ropensci/plotly Using already build binary version # Enable this universe
options(repos = c(
ropensci = 'https://ropensci.r-universe.dev',
CRAN = 'https://cloud.r-project.org'))
# Install some packages
install.packages('plotly') Or from source remotes::install_github("ropensci/plotly") |
Consider the following minimal document:
When using reveal.js, the cursor needs to be placed above and to the left of the points for the tooltip to trigger - rather than on top of them. This doesn't occur when using the default
html_document
style.The text was updated successfully, but these errors were encountered: