Skip to contents

For HTML output that cannot show a chart inline (see knitr_chart_output()), and for a chart that could not be. Online, the frame loads maidr.js from the CDN, and the document is given its own copy of the bundle (maidr_page_bundle_dependency()) for the frame to fall back on. The frame's document sits in a srcdoc attribute, where R Markdown's self_contained and Quarto's embed-resources cannot reach its <script src>; the copy is what they embed instead, once per document however many charts it has, so a self-contained document's charts work offline. Offline at render time, each frame carries the bundle inline, as before.

Usage

create_knitr_iframe(content)

Arguments

content

The chart's SVG content, from create_maidr_html()

Value

Character string of iframe HTML