unaiverse.stats_html_renderer
What this module does 🟢
Renders runtime statistics into a standalone Plotly HTML report for visualization.
stats_html_renderer
¶
Minimal HTML wrapper for the base Stats.plot() output.
Converts a Plotly-format JSON payload ({"data": [...], "layout": {...}}) into a
self-contained <!DOCTYPE html> document that renders the chart client-side using
Plotly.js loaded from CDN. Python never imports plotly.
render_plotly_html
¶
Wrap a Plotly-format JSON string in a self-contained HTML document.
Substitutes dash_json and title into the module-level _TEMPLATE,
producing a complete <!DOCTYPE html> page. The page loads Plotly.js from CDN
and calls Plotly.newPlot with the supplied data and layout objects so the chart
renders entirely in the browser. No Python plotly dependency is required at runtime.
The returned string can be written directly to a .html file or served over HTTP
as text/html. It is typically used by Stats.plot() and
World.debug_stats_dashboard() to render live connectivity and performance charts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dash_json
|
str
|
A JSON string containing |
required |
title
|
str
|
The text placed in the HTML |
'World Overview'
|
Returns:
| Type | Description |
|---|---|
str
|
A complete |
str
|
rendered via Plotly.js 2.35.2 loaded from the official CDN. |
Note
The Plotly.js version is fixed at 2.35.2 in the embedded CDN URL. If the CDN is unreachable the page will load but the chart will not render.