toEmbeddedHTML

abstract fun toEmbeddedHTML(): String(source)

Returns an embeddable HTML fragment (a <div> and inline <script>) suitable for compositing into a larger HTML page. Unlike toHTML, this does not include <html>, <head>, or <body> wrappers.

The caller must load the Lets-Plot JS library once in the enclosing page's <head>, via PlotHtmlHelper.scriptUrl, or the fragment renders as an empty box. A page built by ksl.utilities.io.report.renderer.HtmlReportRenderer already does this. Use toSelfContainedHTML instead when the output has to stand on its own.