Skip to content
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

Enable/Disable scroll wheel navigation via button or shortcut #325

Open
edornshuld opened this issue Jun 16, 2021 · 0 comments
Open

Enable/Disable scroll wheel navigation via button or shortcut #325

edornshuld opened this issue Jun 16, 2021 · 0 comments

Comments

@edornshuld
Copy link

edornshuld commented Jun 16, 2021

I love scroll wheel navigation but would like to switch it on and off on the fly and not permanently via scroll: false. The reason is due to packages such as r3dmol which can embed an interactive 3D object onto an Xaringan slide (Note: It works quite well though I am seeing issues with object sizing and alignment on the slide). The scroll wheel allows zooming in and out on the object; however, this will also cause the slide to change.

Could a shortcut and/or clickable button be implemented to Enable/Disable scroll wheel navigation (similar in layout to the buttons given by xaringanExtra::use_scribble())?

---
output: 
  xaringan::moon_reader
---

## Slide 1

.center[
```{r, echo=F}
library(r3dmol)

xyz <- "3
Water
O    -1.196725842138      0.000000000001     -2.881263893286
H    -1.196725842146      0.759337000000     -2.285220893285
H    -1.196725842146     -0.759337000000     -2.285220893287
"

mol <- r3dmol(width=200, height=200, backgroundColor = "0xeeeeee") %>%
  m_add_model(data = xyz, format = "xyz") %>%
  m_set_style(style = m_style_stick(colorScheme = "default"))

m_zoom_to(mol)
```
]

---

## Slide 2

.center[
```{r, echo=F}
m_zoom_to(mol)
```
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant