maidr: Multimodal Access and Interactive Data Representation
Source:R/maidr-package.R
maidr-package.RdThe 'maidr' package provides accessible, interactive visualizations through the MAIDR (Multimodal Access and Interactive Data Representation) system. It converts 'ggplot2' and Base R plots, and experimentally 'lattice' charts, into accessible HTML/SVG formats with keyboard navigation, screen reader support, and sonification capabilities. This enables users with visual impairments to independently explore and understand data visualizations through multiple sensory modalities.
Main Functions
show: Display an interactive MAIDR plot in the browser or RStudio Viewersave_html: Save a plot as a standalone HTML filerun_example: Run interactive example plotsmaidr_on: Turn automatic MAIDR interception back onmaidr_off: Disable automatic MAIDR interceptionrender_maidr: Render MAIDR plots in Shiny applicationsmaidr_output: Create MAIDR output container for Shiny UI
Supported Plot Types
The package supports a wide variety of plot types from both 'ggplot2' and Base R plotting systems:
ggplot2 plots:
Bar charts (simple, grouped, stacked) -
geom_bar(),geom_col()Pie charts -
geom_col()/geom_bar()withcoord_polar("y")Histograms -
geom_histogram()Scatter plots -
geom_point()Line plots -
geom_line()Step plots -
geom_step()Box plots -
geom_boxplot()Violin plots -
geom_violin()Heat maps -
geom_tile()Candlestick (OHLC) charts -
tidyquant::geom_candlestick()Density/smooth curves -
geom_density(),geom_smooth()Faceted plots -
facet_wrap(),facet_grid()Multi-panel layouts (via 'patchwork' package)
Multi-layered plot combinations
Base R plots:
Bar plots (simple, grouped, stacked) -
barplot()Pie charts -
pie()Histograms -
hist()Step plots -
plot(type = "s"),plot(type = "S")Box plots -
boxplot()Contour plots -
contour()Candlestick (OHLC) charts -
quantmod::chartSeries()Multi-panel layouts -
par(mfrow),par(mfcol)
Experimental plot types: The types above are stable. The package also reads a longer list of charts as prototypes: none has been through a user study, and each may change without a deprecation period. In these docs an experimental type is marked [experimental] after its name; a type with no mark is stable. Every chart read from 'lattice' is one of them, whatever its layer type. Among them:
ggplot2 area charts [experimental]
ggplot2 contour plots -
geom_contour()[experimental]ggplot2 error bars [experimental]
ggplot2 Gantt charts -
maidr_gantt()[experimental]ggplot2 hexbin plots [experimental]
ggplot2 ROC curves -
maidr_roc()[experimental]ggplot2 precision-recall curves -
maidr_pr_curve()[experimental]ggplot2 volcano plots -
maidr_volcano()[experimental]ggplot2 Manhattan plots -
maidr_manhattan()[experimental]ggplot2 Kaplan-Meier curves -
maidr_survival(),survminer::ggsurvplot()[experimental]ggplot2 percentile bands -
ggdist::stat_lineribbon(),stat_summary(geom = "ribbon", fun.data = median_hilow)[experimental]ggplot2 directed graphs -
ggraph::ggraph()[experimental]Base R correlograms [experimental]
Base R Q-Q plots [experimental]
Base R radar charts -
stars()[experimental]Base R mosaic plots [experimental]
Base R violin plots -
vioplot::vioplot()[experimental]Base R word clouds [experimental]
lattice bar charts (simple, grouped, stacked) -
barchart()[experimental]lattice histograms -
histogram()[experimental]lattice box plots -
bwplot()[experimental]lattice scatter, line, step and lollipop plots -
xyplot()[experimental]lattice density curves -
densityplot()[experimental]lattice dot plots -
dotplot()[experimental]lattice heat maps -
levelplot()[experimental]lattice contour plots -
contourplot()[experimental]lattice conditioned (multi-panel) charts -
y ~ x | g[experimental]
The full list is under "Experimental Plot Types" in the README.
Accessibility Features
Keyboard Navigation: Use arrow keys to explore data points
Screen Reader Support: ARIA labels and live regions for announcements
Sonification: Audio representation of data patterns
Text Summaries: Automatic statistical descriptions
Grid Navigation: Efficient exploration of scatter plots
Integration
The package integrates seamlessly with:
RStudio: Direct display in the Viewer pane
R Markdown/Quarto:
library(maidr)in the document makes its plots accessible charts, inline in an HTML page; so does rendering it in a session where maidr is loaded, even only its namespaceShiny: Interactive plots in Shiny apps via
render_maidr()Standalone HTML: Export plots for sharing with
save_html()
Getting Started
To create your first accessible plot:
library(maidr)
library(ggplot2)
# Create a ggplot2 plot
p <- ggplot(mtcars, aes(x = factor(cyl), y = mpg)) +
geom_boxplot()
# Display as interactive MAIDR plot
show(p)
# Or save to HTML file
save_html(p, file = "my_plot.html")For Base R plots:
Learn More
Package website: https://r.maidr.ai/
MAIDR project: https://maidr.ai/
GitHub repository: https://github.com/xability/r-maidr
Get started:
vignette("getting-started", package = "maidr")Shiny integration:
vignette("shiny-integration", package = "maidr")
Author
Maintainer: JooYoung Seo jseo1005@illinois.edu [copyright holder]
Authors:
JooYoung Seo jseo1005@illinois.edu [copyright holder]
Niranjan Kalaiselvan nk46@illinois.edu