Html Report Renderer
A ReportVisitor that renders a ReportNode tree to a self-contained HTML file.
Structure:
<html><head>— inline REPORT_CSS + Lets-Plot CDN<script>(emitted once)<body>— content;<h1>document title<details open><summary>— collapsible sections (nested sections indent)<footer>— generated timestamp
Node rendering:
ReportNode.Document —
<h1>title; footer timestamp on exitReportNode.Section —
<details open><summary>title</summary>ReportNode.Heading —
<h{level}>text</h{level}>ReportNode.Paragraph —
<p>text</p>ReportNode.StatTable —
StatisticReporter.asDataFrame→toHtmlTable; detail=true appends an extended diagnostic tableReportNode.WeightedStatTable — HTML
<table>with all weighted-statistic fieldsReportNode.DataTable — HTML
<table>; numeric columns right-alignedReportNode.PlotNode —
<div class="plot-container">+ ksl.utilities.io.plotting.PlotIfc.toEmbeddedHTMLReportNode.RawText —
<pre>content</pre>ReportNode.PageBreak —
<hr/>
The Lets-Plot CDN <script> is emitted exactly once inside <head> so all embedded plot fragments can share it. Plots beyond RenderContext.maxPlotsPerSection per section are replaced with a <p class="plot-omitted"> notice.
All mutable state uses the my prefix per KSL coding conventions.
CSS selection (evaluated in priority order):
cssPath non-null →
<link rel="stylesheet" href="...">is emitted; no inline<style>blockcss non-null → the supplied string is inlined in a
<style>blockBoth null (default) → REPORT_CSS is inlined in a
<style>block
Parameters
the render context supplying output paths and formatting preferences
path to an external CSS file; when non-null a <link> tag is emitted and css is ignored
inline CSS string to embed in a <style> block; only used when cssPath is null; when both are null REPORT_CSS is used
Functions
Writes the accumulated HTML to a temporary file in RenderContext.outputDir and opens it in the system default browser. Returns the File that was created.