I have created several plots including a histogram, a surface plot, a boxplot, and a scatterplot, in a JS Reveal presentation. When I knit the presentation and open it in a browser the plots display, but when I try to select a data point to read the values of that point, the point directly beneath the cursor is not selected. Instead, a point up and to the left of the cursor is selected. This is also happening with a line graph and a scatter plot I have created using the htmlwidgets package. Is there a way that I can select data that is directly under the cursor? Any help would be greatly appreciated!
```{r}
library(plotly)
p <- plot_ly(midwest, x = percollege, color = state, type = "box")
p
```
This is a sample r chunk that creates a histogram, but I cannot select the data directly beneath the cursor.
I think this was fixed in https://github.com/ropensci/plotly/commit/c50042553080d4d004a58a760f5f67588df1d2c4.
If you're still having a problem, please reopen and I'll address it
I'm facing the issue described here: https://github.com/rstudio/revealjs/issues/47
Consider the following minimal document:
```{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)
``````
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.
---
Below is my `sessionInfo()`
```
+1
Having the exact same problem as patzaw. Knitting revealjs presentations with plotly objects seems to make the cursor behave in a weird manner - to select points I actually have to hover to the top and left of them.
+1 having the same problem with plotly + revealjs
I think the code below solves the problem.
output:
revealjs::revealjs_presentation:
reveal_options:
minScale: 1.0
maxScale: 1.0
@paulofelipe your solution worked for me.
Thanks!
Most helpful comment
I think the code below solves the problem.
output: revealjs::revealjs_presentation: reveal_options: minScale: 1.0 maxScale: 1.0