shiny.output_maidr

widget.shiny.output_maidr(id, *, width='100%', height='auto')

Create a container for a :class:render_maidr output.

Parameters

Name Type Description Default
id str Output id, matching the name of the @render_maidr function. Module namespacing is applied by Shiny, so the same id works inside a :func:shiny.module.ui. required
width str CSS width of the container. "100%"
height str CSS height of the container. "auto"

Returns

Name Type Description
htmltools.Tag The output container.

Notes

No :class:htmltools.HTMLDependency is attached here, which is the one place this deviates from Shiny’s packaged-component recipe. Which copy of maidr.js a chart needs is a per-render decision – use_cdn chooses between the CDN and the bundled copy – so the dependency rides on the rendered value, where Shiny’s _process_ui picks it up. Attaching it to the container instead would ship the bundle to every page even when every chart on it loads from the CDN.

Examples

>>> from shiny import ui
>>> from maidr.widget.shiny import output_maidr
>>> app_ui = ui.page_fluid(output_maidr("my_plot"))