The ellmer package enables dynamic alt text generation for ggplot2 charts in Shiny apps using large language models like Google Gemini. The implementation includes error handling, consistent image rendering, and automatic cleanup to ensure reliable accessibility features. The approach generates descriptive alt text that stays synchronized with user interactions while gracefully degrading if API calls fail. For production apps with high traffic, consider caching alt text for unchanged plots and allowing manual overrides for critical visualizations.
Table of contents
Alt TextAlt Text within Apps and DashboardsWhy Dynamic Alt Text Needs CareUsing {ellmer} in a Shiny AppExamplesUsing Dynamic Alt Text in ShinyOther ConsiderationsConclusion50 Impressions