letsPlot

context(section: SECTION)
fun DslSlide.letsPlot(dimensions: Dimensions? = null, configBlock: LetsPlotIframeConfig.() -> Unit = {}, block: () -> Figure)

Embed a Lets-Plot figure inside a DslSlide content{} block. The figure is exported to self-contained HTML and served from a dedicated iframe so the Lets-Plot JS runtime does not collide with reveal.js's own scripts.

The iframe's rendered size (set in configBlock) must stay compatible with the plot's own dimensions (dimensions): if width is "600px" the plot should be about that wide, otherwise you will see clipping or extra whitespace. A good tuning workflow is to set style = "border: 1px solid black;" in configBlock while iterating, then remove it.

Parameters

dimensions

plot width × height passed to Lets-Plot's HTML exporter. Omit to let Lets-Plot choose.

configBlock

size/style overrides for the enclosing iframe (symmetric with playground{}/diagram{}). Merged with global and presentation defaults.

block

lambda returning the Figure to render.

The enclosing <section> is supplied via the SECTION context parameter, so calling this outside a DslSlide content{} block is a compile-time error.


context(section: SECTION)
fun DslSlide.letsPlot(dimensions: Dimensions? = null, iframeConfig: LetsPlotIframeConfig, block: () -> Figure)

Deprecated

Pass a configBlock lambda instead of a prebuilt LetsPlotIframeConfig

Pre-built-config overload of letsPlot. Prefer the configBlock overload, which is symmetric with playground{}/diagram{}.