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

Better handle svg through native {knitr} option #2

Open jooyoungseo opened 1 year ago

jooyoungseo commented 1 year ago

When rendering maidr through Rmd, current logics don't fall back to knitr's svg options chunk label and id. Rather than passing object$maidr_widget, I need to use knitr option internally.

jooyoungseo commented 1 year ago

Need to use options(knitr.chunk.dev = 'svglite') and knitr.svg.object = TRUE.

jooyoungseo commented 1 year ago

We can also assign id to the current chunk via out.extra='id="my-plot"' See https://github.com/yihui/knitr/issues/2152

jooyoungseo commented 1 year ago

See also, fig.id option at https://yihui.org/knitr/options/