By default, htmlwidgets are wrapped in <div> tags, which don't support "alt" attributes for explanatory text. In yihui/knitr#2243 I have proposed that htmlwidgets which use the "aria-labelledby" attribute should get a text label added, which (at least some) screen readers will treat like alt text.
I can do this for the rgl widget by adding a widget_html.rglWebGL() function (https://github.com/dmurdoch/rgl/blob/635349d8c2c7deef5fcfa292340c93fb254a3286/R/rglwidget.R#L401-L404) but maybe this should be added by the htmlwidgets:::widget_html.default() function (
|
widget_html.default <- function (name, package, id, style, class, inline = FALSE, ...) { |
|
if (inline) { |
|
tags$span(id = id, style = style, class = class) |
|
} else { |
|
tags$div(id = id, style = style, class = class) |
|
} |
|
} |
), probably conditional on some setting in the widget.
By default, htmlwidgets are wrapped in
<div>tags, which don't support "alt" attributes for explanatory text. In yihui/knitr#2243 I have proposed that htmlwidgets which use the "aria-labelledby" attribute should get a text label added, which (at least some) screen readers will treat like alt text.I can do this for the rgl widget by adding a
widget_html.rglWebGL()function (https://github.com/dmurdoch/rgl/blob/635349d8c2c7deef5fcfa292340c93fb254a3286/R/rglwidget.R#L401-L404) but maybe this should be added by thehtmlwidgets:::widget_html.default()function (htmlwidgets/R/htmlwidgets.R
Lines 287 to 293 in e234c0e