Internal function that creates an interactive MAIDR widget from a ggplot object. This is called internally by render_maidr() and should not be called directly. Use maidr_output() and render_maidr() for Shiny integration instead.
maidr_widget(plot, width = NULL, height = NULL, element_id = NULL, ...)An htmlwidget object that can be displayed in RStudio, Shiny, or saved as HTML
A ggplot object to render as an interactive MAIDR widget
The width of the widget in pixels or CSS units (default: NULL for auto-sizing)
The height of the widget in pixels or CSS units (default: NULL for auto-sizing)
A unique identifier for the widget (default: NULL for auto-generated)
Additional arguments passed to create_maidr_html()
Uses iframe-based isolation to ensure MAIDR.js initializes properly. Each widget gets its own isolated JavaScript context where MAIDR.js can discover and initialize the SVG with maidr-data attribute.