xability / r_maidr

Making data visualization accessible to blind and low-vision people through multimodal access and interactive data representation (MAIDR)
GNU General Public License v3.0
1 stars 1 forks source link

Support multi-plot in Rmd #1

Open jooyoungseo opened 1 year ago

jooyoungseo commented 1 year ago

In the following example, only the last plot gets the interactivity. We have to support multi-plots in Rmd.

Reprex

test.Rmd:

---
output: html_document
---

```{r}
library(tidyverse)
library(maidr)

g <- ggplot(mpg, aes(class)) +
  geom_bar()
maidr(g)$maidr_widget
g2 <- ggplot(starwars, aes(height, mass)) +
  geom_point() +
  geom_smooth(method = "loess")
maidr(g2)$maidr_widget