//! Self-contained HTML graph viewer assembly (C9: read-only render path). //! //! `render_html` walks the blueprint into the deterministic JSON model //! (`aura_engine::model_to_json`) and inlines it, the vendored Graphviz-WASM, the //! pan-zoom helper, and the ported viewer JS into one standalone `.html`. The //! emitted page fetches nothing at view time. No `eval`/build is on this path //! (C9); the model is hand-rolled JSON (C14, owned by `model_to_json`). use aura_engine::Composite; /// The prototype's `` shell + body skeleton (header, stage, tooltip, error /// pane), verbatim from `docs/design/prototypes/graph-render/index.html` lines /// 1-38 — minus the two `\n\n\n\n\n\n"); html } #[cfg(test)] mod tests { use super::*; use crate::sample_blueprint; /// `aura graph`'s page is self-contained (no remote fetch), embeds the /// deterministic model as the viewer's data source, carries the Graphviz-WASM /// bootstrap, and keeps the C4 four-colour palette. Structural, not pixel: /// the DOT/SVG are Graphviz-version-dependent and are exercised by hand /// against the prototype (spec Testing strategy). #[test] fn render_html_is_self_contained_and_embeds_the_model() { let html = render_html(&sample_blueprint()); // a complete HTML document assert!(html.starts_with(""), "not an HTML doc"); assert!(html.trim_end().ends_with(""), "HTML doc not closed"); // self-contained: every asset is inlined, no remote