Repository navigation
PlantUML Browser Rendering
Kronikol can render PlantUML sequence diagrams entirely in the browser — no remote server, no IKVM package, and no Java installation required. This uses the official PlantUML TeaVM JavaScript engine, which compiles the full PlantUML Java codebase to JavaScript via TeaVM.
Because this runs the complete PlantUML engine, all features are supported — including the Teoz layout engine (!pragma teoz true), all diagram types, and advanced sequence diagram features like parallel messages (&), nested boxes, and anchored durations. The exceptions are what the engine loads from a bundle a render worker cannot fetch: PlantUmlTheme, OpenIconic icons, emoji and stdlib !include modules. See PlantUML Options That Still Apply.
Set PlantUmlRendering = PlantUmlRendering.BrowserJs on your ReportConfigurationOptions or DiagramsFetcherOptions:
new ReportConfigurationOptions
{
PlantUmlRendering = PlantUmlRendering.BrowserJs,
// ... other options
}var fetcher = DefaultDiagramsFetcher.GetDiagramsFetcher(new DiagramsFetcherOptions
{
PlantUmlRendering = PlantUmlRendering.BrowserJs
});The default value is DiagramFormat.PlantUml, so existing configurations continue to work without changes.
- During report generation,
DefaultDiagramsFetcherruns the standard PlantUML text generation pipeline — the same pipeline used for server-side and IKVM rendering. - Instead of generating server URLs or rendering images, the raw PlantUML text is stored in the
CodeBehindproperty of eachDiagramAsCode, withImgSrcleft empty. - In the HTML report, each diagram is an empty placeholder
<div>:The PlantUML sources themselves ship in one<div class="plantuml-browser" id="puml-0" data-diagram-type="plantuml"></div>
<script id="puml-data" type="application/json">block: a JSON map of diagram id to gzip-compressed, base64-encoded source. Nothing is decompressed at page load. That is the plain page: a report written before 5.6.0, or the copykronikol decodewrites. From 5.6.0 the report is written compressed (Generated Reports › The compressed page), and there each value in the map is a token pointing into the diagram index: the sources themselves are in pieces of at most 16 MB, each a zstd frame, and a piece is decoded only when a diagram in it is first drawn. - Two JavaScript files are fetched from jsDelivr (
TrackingDefaults.PlantUmlJsCdnBase). From 5.0.0 that is a tag of the engine fork on jsDelivr's GitHub route,https://cdn.jsdelivr.net/gh/lemonlion/plantuml-js-plantuml_limit_size_98304@v1.2026.10beta1-f44b054-teavm0.17.0-dev-2: a stock build of PlantUML's master atf44b054d1(1.2026.10beta1, MIT flavor) compiled with TeaVM 0.17.0-dev-2, whose one change from PlantUML's own build is that TeaVM version. jsDelivr keeps a tag's files once it has served them, and every file is checked against its known hash (see Engine integrity), so a file that changed on the fork is refused, never drawn with. From 3.31.1 through 4.x it was the npm route,@plantuml/core@1.2026.8, and before that other tags of the same fork; every one stays published for the reports that point at it.-
viz-global.js(~1.4 MB) — the Graphviz layout engine, byte-identical to the one in@plantuml/core1.2026.8 - the engine, in one of two builds that draw the same SVG:
plantuml-wasm-bundle.js(~6.1 MB, PlantUML's Wasm GC engine with its module embedded) in the render workers of a browser that runs Wasm GC, andplantuml.js(~3.4 MB) everywhere else (see The Wasm engine). - Through 4.x the engine was
plantuml.js(~3.9 MB) alone,@plantuml/core1.2026.8's: a stock build of PlantUML's release commit149874a1(MIT flavor), nine commits past the0e4f452ebuild that 3.0.76 to 3.31.0 used, none of them reachable from a Kronikol diagram, on which every diagram Kronikol emits drew byte-identical; on the render ladder it was 4 % faster. Every build since carries the merged Teoz and Smetana performance work (#2834, #2866), which renders Kronikol-shaped sequence diagrams 4–8× faster than the 1.2026.6 build 3.0.76 replaced (real report diagram: 789 → 181 ms warm; 500-arrow: 5.8 → 0.8 s). Nothing is patched: the engine's default 8192 px canvas limit is raised at render time instead — every render call site passes{ maxSvgSize: 98304 }(before 3.0.76 the 4096 px limit of the stock build was patched to 98304 in the hosted file itself). Both engines are ES modules, which every consumer (worker host, main-thread fallback, the Node renderer) loads by rewriting orimport()ing the trailingexportstatement. - Both files are checked against their known hashes before anything runs them; see Engine integrity.
-
- An
IntersectionObserverwatches each diagram element. When a diagram scrolls within 200px of the viewport, the observer decompresses that diagram's entry from thepuml-datamap with the browser'sDecompressionStream, sets it on the element'sdata-plantumlattribute (so the attribute exists at runtime, not in the generated HTML), and triggerswindow.plantuml.render()to render it in-place as an inline SVG — in a Web Worker, never on the page's main thread (see the next section). On a compressed page (5.6.0) the observer reads the source from its piece instead of the map: the first time a diagram in a piece is drawn, the piece is decoded by the page's own zstd decoder, in a Web Worker of its own, or on the page itself where workers are refused.
Before 3.0.45 the engine was two <script defer> tags: the page was not interactive until 7 MB of JavaScript had compiled, every diagram rendered on the main thread one at a time, and a note toggle on a large diagram froze the page for seconds. The measured picture on a real 83-scenario report with 14 diagrams of 200–540 KB each: 1.7–5.6 s before the page responded, 28–46 s to render everything with the main thread blocked for 22–39 s of it, 4–7 s per note toggle.
Now the report page hosts the engine in Web Workers:
-
Bootstrap. A small shim in the report fetches
viz-global.js+ the engine (plantuml-wasm-bundle.jsorplantuml.js, see The Wasm engine) as text, inlines them with a worker host (plantuml-worker-host.js, a minimal DOM + SVG serializer the engine renders into) into one Blob, and creates workers from it. One worker starts immediately; up toBrowserRenderWorkers(default 4, capped by the viewer'snavigator.hardwareConcurrency) start lazily once the first diagram is done, so parallel engine compiles never delay the first picture.body.plantuml-readyis set as soon as the HTML is parsed — well under 300 ms regardless of engine size. -
Rendering.
window.plantuml.render(lines, targetId)keeps its old shape for every caller; the worker sends back the SVG string and the shim writes it withinnerHTML, which fires the callers'MutationObservers exactly as the engine's own DOM insertion did. The render queue keeps one fragment per worker in flight. Worker output is identical to main-thread output (same geometry, element and text counts — the worker measures text with anOffscreenCanvas, the same fonts as the page); the fidelity test inBrowserRenderWorkerTestspins that. -
Cache and prefetch. Every successful render goes into a per-page cache keyed by fragment source (
BrowserRenderCacheMegabytes, default 64, oldest-first eviction; a render that produced a failure is never cached). A note/assertion/step/database toggle re-splits the diagram and most fragments come out byte-identical to what is on screen: the toggle paths callwindow.plantuml.prefetch(fragments)so the workers render every new fragment in parallel and the sequential swap is a series of cache hits. Identical fragments across diagrams dedupe the same way. -
Failures. A worker error takes the same path as a synchronous engine throw used to: the too-large re-split retry, or the red block with the collapsed Raw PlantUML
<details>. The engine's text failures (see below) are detected in the worker and handed back as text, sodescribeEngineFailuredescribes them as before. -
Telemetry.
window.__kronikolRenderexposes{ mode, workers, workersRequested, workersTarget, renders, cacheHits, cacheEntries, cacheBytes, workerMs, injectMs, errors, inFlight, maxInFlight, engineFetchMs, engineReadyAt, fallbackReason, engineIntegrity, vizIntegrity, webAssembly, engine, engineProblem, workerCrashes }— useful when a report feels slow ("is it actually in worker mode?").modestarts as'starting'and settles to'worker'or'main-thread'once the shim has decided (on a page whose diagrams were drawn when it was written, underNodeJs,ServerorLocal, it is'idle'until a view first asks for the engine, since 3.31.8); it stays'starting'when the engine was refused (see Engine integrity), andfallbackReasonthen carries the refusal.webAssemblyisfalsewhere no WebAssembly module compiles, and Graphviz is then not loaded (see Without WebAssembly).engine(5.0.0) is'wasm'or'js',engineProblemsays why the page is not on the Wasm engine (nullwhile it is), andworkerCrashescounts the workers an error took down while they drew (see The Wasm engine).window.plantuml.cacheStats()returns the render cache's{ entries, bytes, limit, hits }on demand. Since 4.14.6errorscounts the engine's stack failures too, which are never cached (see Large Response and Diagram Handling › Statement-Length Limits (3.0.48+)).
file:// reports. Reports are usually opened straight from disk. Chrome refuses new Worker('file://…'), and a Blob worker created by a file:// page cannot load anything over the network (not even importScripts of the CDN). That is why the page fetches the engine text itself (jsDelivr sends Access-Control-Allow-Origin: *, so a file:// page may) and inlines it into the worker Blob. A host that sends no CORS header gives no engine at all in Chromium and Firefox: the fetch fails, and the fallback below needs the header too, because the engine is an ES module (always fetched with CORS) and its tags carry crossorigin for the integrity check. Only WebKit loaded the module without it. So anything that serves the engine URLs in jsDelivr's place, a corporate mirror for one, must send the header.
Browser support. Chrome/Edge 80+, Firefox 113+, Safari 16.4+. The worker path needs Blob workers, OffscreenCanvas 2D and DecompressionStream, and DecompressionStream came last in each engine (OffscreenCanvas 2D arrived in Chrome 69, Firefox 105 and Safari 16.4, the versions this paragraph gave as the floor until 3.31.3). It is the hard floor on both paths, because the diagram sources in puml-data are gzip-compressed and the main-thread fallback decompresses them the same way (so is the internal-flow segment map the popup opens, from 3.31.9), so a browser takes the fallback for its configuration (below), never for its version. WebAssembly, which Graphviz needs, is older than all of these, but a browser can run with it off: see Without WebAssembly. The Wasm engine needs more, Wasm GC (Chrome 119, Firefox 120, Safari 18.2): an older browser draws with plantuml.js, as fast as 4.x drew.
The compressed page (5.6.0). What the paragraph above says of DecompressionStream holds for a plain page, one written before 5.6.0 or by kronikol decode. On the compressed page 5.6.0 writes, neither the diagram sources nor the segment map is gzip: a diagram's source is read from its zstd piece by the page's own decoder, which uses the browser's DecompressionStream('zstd') where it has one (Firefox with dom.compression_streams.zstd.enabled), else libzstd's decoder built to WebAssembly, else fzstd in plain JavaScript where the page's policy refuses WebAssembly, and the segment map is stored as it is inside the page's frame (Generated Reports › The compressed page).
Fallback — the main-thread engine. When Workers, fetch, Blob URLs or OffscreenCanvas are unavailable, when BrowserRenderWorkers is 0, or when the engine cannot be fetched (offline with a cold browser cache, a corporate proxy, a CSP on a hosted report), the shim injects a script tag for viz-global.js (where WebAssembly compiles) and a module tag for the engine, then import()s the engine, and renders on the main thread, one diagram at a time — the pre-3.0.45 behaviour. The import() reuses the module the tag fetched and checked (the browser keys modules by URL), so this path runs verified bytes too, and it is written as plain import(), not through new Function, so a content security policy without unsafe-eval does not stop it. window.__kronikolRender.mode is 'main-thread' and fallbackReason says why. Offline-with-cached-engine is no worse than before: the browser serves the cached CDN responses to the fetch. The main thread always draws with plantuml.js, even where the browser runs Wasm GC (5.0.0, see The Wasm engine).
Options (ReportConfigurationOptions, see Report Configuration): BrowserRenderWorkers (default 4; 0 = main thread), BrowserRenderCacheMegabytes (default 64; 0 disables the cache), BrowserFragmentMaxHeight (default 12000 px, the fastest height measured on the current engine: at 4,000 px the full render took 56–66 % longer and a note toggle 41–77 % longer, on the E2E fixture and on a report of 20 diagrams of 80 steps, and every fragment seam repeats the participant boxes. The 1.2026.6 engine was faster at 4,000–6,000; this engine is not. Fragment splitting itself is covered in Large Response and Diagram Handling), PayloadScrollLines (default 40, 5.4.0: the most body lines a payload draws before it scrolls in its box; 0 draws every payload in full, see Large Response and Diagram Handling › A Long Payload Scrolls in Its Box (5.4.0+)). Only BrowserRenderWorkers has a CLI equivalent (kronikol ingest --browser-render-workers <n>); the cache, fragment-height and payload scroll options are library-only.
Measured (headless Chromium; tests/Kronikol.Tests.EndToEnd large-report fixture — 6 note-dominated diagrams, 40 request/DB/reply steps each with 2–8 KB JSON notes, ~10 fragments on the biggest; and the real 20-diagram report above):
| page interactive | full render | main thread blocked | worst task | note toggle | |
|---|---|---|---|---|---|
| fixture, main thread (≤ 3.0.44) | 4.1 s | 13.2 s | 11.4 s | 452 ms | 2.6 s |
| fixture, 4 workers + cache (3.0.45) | 0.44 s | 4.4 s | 0.0 s | 0 ms | 0.57 s |
fixture, 4 workers + cache, @plantuml/core engine (3.0.50) |
0.37 s | 3.7 s | 0.0 s | 0 ms | 0.47 s |
| real report, main thread | 1.7–5.6 s | 27.7–46.0 s | 22–39 s | 0.9–4.8 s | 3.9–7.1 s |
| real report, 4 workers + cache | 0.08 s | 8.5–9.2 s | 0.1–0.2 s | 71–76 ms | 0.88–0.93 s |
The measurement harness behind these numbers lives in tools/render-bench/ (reference material, not part of the build).
The page knows the SHA-256 of every engine file (internal constants beside PlantUmlJsCdnBase, in the Subresource Integrity form sha256-…: viz-global.js and, from 5.0.0, both engines) and hands them to the browser's own integrity check: the worker path's fetch carries integrity, and so do the fallback's two tags. The browser checks the whole file before the page sees a byte of it, so a file that does not match is never evaluated. Chromium, Firefox and WebKit all enforce it, on file://, on localhost and on a plain-http origin, on the page and in a worker.
On a pinned URL, the likely cause of a mismatch is something between the viewer and jsDelivr rewriting the response: a proxy that injects a script, a captive portal answering with its login page, a damaged cache entry. Before 3.31.1 the page evaluated whatever came back, usually as a syntax error, and the fallback then fetched the same bytes. Now:
-
A refused engine refuses every diagram. Each one says
Render error: PlantUML engine unavailable: engine integrity check failed: <file> from <url> does not match sha256-<expected>; the browser console names the hash it computed(Chromium and Firefox print the hash they computed, WebKit the byte counts), where<file>is the engine the page fetched:plantuml-wasm-bundle.jsin the render workers of a browser that runs Wasm GC,plantuml.jselsewhere. No worker starts, and there is no fallback, to the other engine either, since the same mirror serves both. -
A refused
viz-global.jscosts Graphviz only. The workers start without it and every sequence diagram draws, since sequence diagrams never use Graphviz. A component diagram draws too: without Graphviz the engine lays it out with its Smetana port (it saysfalling back to the Smetana layout engineon the console), so only its layout differs. The page console carriesengine integrity check failed: viz-global.js …andGraphviz is not loaded: the engine lays out what it can with its Smetana port instead, on the worker path and, since 3.31.7, on the main-thread path too. -
The telemetry.
window.__kronikolRender.engineIntegrityand.vizIntegrityread'verified'or'mismatch'. Each isnulluntil its file has been fetched, and staysnullwhen the file could not be fetched at all (the page then takes the fallback, as before). -
A file that cannot be fetched is not a failed check. A refusal fails the same way a network error does, so the page fetches the file once more without the hash: when that fails too, or answers with an error status such as a mirror's 404, the file is not there to check. The page takes the main-thread fallback as it always did (offline with a cold cache, a proxy that blocks the CDN), and if that cannot load the engine either, each diagram says
PlantUML engine unavailable: failed to load <url>and no diagram mentions the hash.
A mirror or proxy that serves the engine URLs must serve the tag's exact bytes, all three files. The check covers everything the shim loads. The engine's own loader (themes, stdlib includes, icons) is outside it: in the worker it loads nothing, and on the main thread it can only load a file served beside the report.
Graphviz, which lays out the component diagram, is WebAssembly: viz-global.js carries it. A browser can run with WebAssembly off: V8's --jitless mode (a hardened browser configuration), a content security policy without 'wasm-unsafe-eval' on a hosted report, or a browser setting such as Firefox's javascript.options.wasm. Until 3.31.3 the page loaded viz-global.js there anyway, the engine handed it the component diagram, and the diagram's place held the engine's error picture, An error has occurred! … For some reason, dot/GraphViz has crashed, in the worker and on the main thread alike. The engine lays a diagram out with its Smetana port when Graphviz is absent, not when it cannot run.
Now the page compiles the smallest WebAssembly module before it fetches Graphviz, and where that fails:
- Graphviz is not fetched, and the engine lays the component diagram out with Smetana: the same components and edges in a different layout. Sequence diagrams never use Graphviz and draw as before.
-
The console says why:
Kronikol: WebAssembly is not available here (<reason>), so Graphviz is not loaded: the engine lays diagrams out with its Smetana port instead.The reason isWebAssembly is not definedunder--jitlessor with the setting off, and the browser's own refusal under a policy. -
The telemetry:
window.__kronikolRender.webAssemblyisfalse, andvizIntegritystaysnull, since the file was never fetched. -
The engine is
plantuml.js(5.0.0): the Wasm engine cannot run where no module compiles, soengineis'js'andengineProblemcarries the same reason.
Measured on the pinned engine in Chromium and Firefox, in the worker and on the main thread: every component diagram measured draws in each of those configurations, and under --jitless so do 3.30.4's long linked labels. A long edge label is a different limit, the worker's stack, capped since 4.14.5 (see Large Response and Diagram Handling › Statement-Length Limits (3.0.48+)). A component diagram of 40 services and 120 edges took 1.2 s through Smetana under --jitless. The Node renderer makes the same check (see Node.js rendering).
From 5.0.0 the engine tag holds two builds of one engine that draw the same SVG: plantuml.js, and PlantUML's Wasm GC engine packed into one script, plantuml-wasm-bundle.js, which inlines into the worker Blob as plantuml.js does. On BreakfastProvider's report of 425 diagrams, an earlier build of the same engine (2026-10-17) took 49 % less of the workers' time than plantuml.js in Chrome, and 43 % less in Firefox.
-
Which engine draws. Before it fetches an engine, the page asks three things: does a WebAssembly module compile, does a Wasm GC type validate (Chrome 119, Firefox 120, Safari 18.2), and may a script build a function from text, which the Wasm engine's runtime does and a content security policy without
'unsafe-eval'refuses. Where all three hold, the render workers draw with the Wasm engine; elsewhere they draw withplantuml.js, and the console says why (Kronikol: the PlantUML Wasm engine cannot run here (<reason>), so the page draws with its JavaScript build.). The question about functions built from text is the only place the page builds one, inside atry; under such a policy the browser reports the refusal as a violation, once per page. -
The main thread draws with
plantuml.js. The Wasm engine takes any error that reaches the page's global scope while a diagram waits for its own crash, and starts again, which in a worker is right (every such error is the engine's) and on a page is not. So the fallback that draws on the main thread loadsplantuml.js, andengineProblemreadsthe page draws on its main thread. -
A Wasm engine that does not start gives way. One that passes its hash check and fails to start in a worker is replaced by
plantuml.js: the workers start again on it and draw what they held. The console saysKronikol: the PlantUML Wasm engine did not start (<reason>), so the page draws with its JavaScript build., andengineProblemcarries the reason. A Wasm engine that fails its hash check is refused like any engine file, with no fallback. -
A worker that crashes is replaced. An error that reaches the page from a worker while it draws means the engine in it may never answer again: in Firefox a stack overflow inside the Wasm engine reaches no handler in the worker, only the page. The page lets that worker go, starts another, and draws the diagram it held once more; a diagram that takes a second worker down fails alone, as
Render error: the PlantUML engine crashed drawing this diagram: <the error>, and every other diagram draws. A crash that names a stack overflow fails its diagram at once, since drawn again it would overflow again, and the report describes it as the engine's stack failure.workerCrashescounts the crashes. -
The Node renderer runs
plantuml.jsof the same tag (see Node.js rendering). -
What still runs it out of stack is nesting, blocks or markup inside one another: from about 1,000 groups the Wasm engine crashes its worker, and the diagram fails at once with the overflow named; the JavaScript engine writes its
RangeErroras text. Either way the report describes it as the engine's stack failure, now saying that something is nested too deeply. -
What the engine draws differently from 4.x's: each element group carries its source line (
data-source-line), a participant's groups its qualified name, and an internal-flow link is an<a>round each line of its label, as the Java engine draws it, which the report binds by its address: it takes off the titles that name the link's segment (a browser shows them as the tooltip and reads them as the link's name), names the first anchor from the whole label and leaves it the link's one Tab stop. Its TeaVM no longer runs the engine out of stack on a long label, name or block opener (see Large Response and Diagram Handling › Statement-Length Limits (3.0.48+)).
Diagrams are lazily rendered using IntersectionObserver, equivalent to <img loading="lazy"> for traditional image-based diagrams. This is critical for large test suites:
- Diagrams outside the viewport are neither decompressed nor rendered until the user scrolls near them (on a compressed page, 5.6.0, a source is decoded with its whole piece the first time a diagram in that piece is drawn, and the others in it are still drawn only as they come near)
- With 1,500 diagrams, only the visible ones render on page load — the rest render on demand as the user scrolls
- The
rootMargin: '200px'setting pre-renders diagrams 200px before they enter the viewport, so they appear ready when scrolled into view
Since 3.0.45 rendering runs on Web Workers, so lazy rendering no longer exists to protect the main thread: it bounds the worker queue depth and the page's memory (decompressed sources and rendered SVG), not main-thread time. The pre-worker motivation was starker: each diagram rendered in roughly 300 ms on the main thread, so 1,500 diagrams would have blocked the page for around 7 minutes on load.
A report-level control (Databases, Events, Setup, Steps, Headers, Assertions, the Details choice, and the payload format, length and width) draws again every diagram the page has drawn, so none shows its old state when it is reached:
- The diagram on screen goes first, then the rest, nearest the screen first. One the reader scrolls to while others wait goes next.
- A diagram the change leaves as it was is not drawn again: an activity diagram under every filter, a sequence diagram with no database calls under Databases.
- The next drawings start on the workers once the current one has gone to the engine, so the queue does not wait for each drawing in turn.
- The page stays usable while it draws: the drawings give it a turn every 10 ms, so scrolling and clicking go on.
- A diagram far from the screen gets its note buttons, hover areas, assertion tooltips and zoom slider as it comes near, or as the pointer reaches it. Its picture, its card colours and its zoom are new at once.
- No frame shows a diagram in the engine's own colours (5.9.1). The engine draws yellow square notes with folds and narrow black step bars, and the page makes them the report's cards and bars. A note's own button or double-click redrawing a diagram in parts, a first drawing whose later part landed before an earlier one, and a picture that got its box late (a Sequence view drawn behind another tab, a scenario far down the page) were shown for a frame before that, the last of them until it came into view. Each is now coloured before the frame that shows it. The pictures drawn aside to line up a diagram's parts, which nobody sees, are not coloured at all.
On a report of 750 payload-heavy scenarios with ten of them open, switching a control back runs no task over about 130 ms and shows the diagram on screen changed within about 90 ms (up to 469 ms and 449 ms in 5.1.0).
A long diagram on screen answers quickly too (5.5.1). A diagram of many payload notes holds thousands of drawn words, and the work after drawing it again used to cost more than the drawing:
- Its new picture is painted first. Its note buttons, assertion tooltips and zoom slider follow in tasks of their own, before the next diagram's turn, and are in place by the time the control stops showing it is busy. A pointer that reaches the diagram first gets them at once. If placing them fails, the failure is reported in the browser's console and the control still finishes (5.5.3).
- Its notes are measured once, before any button is written. Writing each note's buttons before measuring the next made the browser lay the whole picture out again for every note.
- Its zoom slider reads the picture's natural width from the width the engine writes on it, rather than drawing the picture at that size and back. A picture in a box that is not laid out (a hidden panel, or a scenario closed in Firefox) reads 0, as it measured before, so its slider is made once it shows (5.5.3).
On a consumer's diagram of 88 payload notes and about 7,300 words, drawn in two parts, Assertions, Steps, Databases and Setup show it changed within 73 to 258 ms (1.1 to 1.5 s in 5.5.0), with no task over 156 ms (0.9 to 1.1 s).
From 5.4.0 these drawings are smaller where payloads are long. A payload longer than PayloadScrollLines body lines (40 by default) is drawn that many lines tall with a scroll box over it that holds its body, so Expanded, and a Payload length of 50 or more, no longer send the engine every line of it: a test of 40 calls with every payload expanded, four of them 1,500 lines long and twelve 150, is drawn in 3 parts and 1.2 s, where in full it took 17 parts and 2.5 s (see Large Response and Diagram Handling › A Long Payload Scrolls in Its Box (5.4.0+)).
Every drawn diagram has a zoom slider, at the top left of its box. It shows while the pointer is over the diagram and stays shown while the diagram is selected (a click selects it, a second click takes it off). Its range depends on whether the diagram fits its box:
| The diagram is | Its slider runs | It starts at |
|---|---|---|
| wider than its box's content | from its fit level, the level at which it fits, to 100% | its fit level |
| no wider than its box's content | from 50% to 100% | 100% |
- Ctrl and the mouse wheel, or a trackpad pinch in Chromium and Firefox, over a drawn diagram zoom that diagram, and never the page, at either end of its range too. Ctrl and + or - zoom the selected diagram, except while typing in a field such as the search's (5.7.3). Ctrl with a sideways wheel, a tilt wheel or a sideways swipe, is left to the browser (5.7.3; it zoomed the diagram out). Tab reaches a diagram's slider before the diagram's links, and the slider shows while it has the focus (the arrow keys then move it). A step is 5% of the slider's range, at least 1 point. Over the rest of the report, and through the browser's own zoom (its menu, Ctrl and 0), the page zooms as before. In Safari a pinch is a gesture of its own and zooms the page.
- The point under the pointer stays where it is, across and down the page: zooming a long diagram no longer slides what is under the pointer up or down by the height the picture gains or loses above it.
- A diagram zoomed past its fit level scrolls across in its box and pans when dragged, with the grab cursor over its picture. A drag does not select or unselect it.
- A diagram zoomed out below 100% stands in the middle of its box at its natural size times the level. It has no scroll and no pan, and its text can be selected.
- The slider follows the window down a tall diagram, below the report's bar and below a scenario's open settings bar, while the pointer is over the diagram, it is selected, or the slider has the keyboard's focus (5.9.1: it could sit under the bar's edge or behind open settings, and a slider reached by Tab kept its place as the window moved).
- Copy and Save as PNG or SVG give the diagram at its own size whatever its level, a PNG at twice it (a very large picture at the largest scale a browser's canvas holds).
- The internal-flow popup's activity diagrams have a slider too, and a zoom there keeps the reader's place by scrolling the popup, not the report behind it (5.7.3). A zoom out there goes on zooming out; until 5.7.3 the popup, as wide as what it holds, narrowed with the picture, and every other notch drew the picture whole again. A popup opened on its flame chart gives its activity diagram a slider once that tab is shown (5.7.3). The controls are hidden at 768 px wide and below.
The fit is measured against the box's width less its padding, the width a picture is drawn in. Until 5.7.0 only a diagram wider than its box had a slider, and the fit was measured against the whole box, so a picture a little wider than the content was drawn smaller with no slider. When the window's width changes, a diagram at its fit level is fitted to its box again: one near the screen at once, the rest as they come near (5.7.3; until then a diagram drawn in parts kept the width of the box it was sized in). A diagram a hair wider than its box, whose fit level rounds to 100%, is drawn to fit it, with no scrollbar (5.7.3).
A diagram taller than BrowserFragmentMaxHeight is drawn in parts, one picture under the other. Since 5.7.0 it acts as one diagram:
- One slider and one level, on the diagram's box. It is wide when any part is wider than the box's content, and its fit level is then the one that lets its widest part fit, so parts drawn at full size until 5.6.1 can be drawn smaller. Its parts zoom and pan together. A notch resizes the parts within a window's height of the screen at once and the rest one a frame after, keeping the reader's place.
-
Its parts stand in line. The engine lays each part out on its own, so a participant stood at a different place in each part. The page first draws an outline of the whole diagram (its participants and, for each kind of message, the one with the widest label and the one with the widest note), then draws every part with one row of hidden messages after the participants, each labelled with a space exactly as wide as its gap needs, and places each part across by its first lifeline. The row draws nothing and stops the numbering around it, so every message keeps its number; each part is about 23 px taller. Once every part is drawn the page checks that their gaps agree to a pixel, and draws them again from their own gaps where they do not. A diagram lined up is as wide as the same diagram drawn whole, which can be wider than its widest part was. A diagram drawn again (a note expanded, a toggle) shows its new parts in line from their first frame (5.7.3; until then they showed as the engine drew them for a frame). A participant declared partway, with
createor after the first message, is declared in every later part too (5.7.3; until then a later part drew one the engine made up, named by the alias), and stands in line with the rest; in the part that makes it, it takes no gap from the row. - A click on any part selects the whole diagram, and the ring goes round all of it.
-
Copy, Save and Open as PNG or SVG give the whole diagram as one picture, each part placed as the page places it, with the diagram's own source in one
<?plantuml-src ...?>. A PNG is drawn at the largest scale up to 2 that a browser's canvas holds; a diagram too long even at its own size gives the part under the click, and its menu says so ("Copy part 3 of 15 as PNG"). Until every part is drawn these items are left out; when a part will never draw (a render error, or too large), they act on the part under the click and say so ("Copy part 1 of 3 as SVG"), as before 5.7.0 (5.7.3; from 5.7.0 such a diagram had no picture items). - It ends once. Every part but the last is drawn without its footbox (the participants drawn again under its last message), and each part keeps its heads.
- One placeholder: only the first part not yet drawn shows "Rendering diagram", and the parts after it take no room until drawn.
The lines the page adds to draw the parts (hide footbox, the row) go only to the engine: the menu's Copy and Open source items, a note's current text, the search and a copied picture's source read the diagram as written. Participants declared in a box are declared in every part; until 5.7.0 a box ended the part's header, so every part after the first declared no participant.
From 5.2.2 to 5.6.1 each part zoomed, and was selected, on its own, so one diagram could be drawn at several text sizes; before 5.2.2 every zoom on such a diagram went to its first part.
A long payload's scroll box (5.4.0) keeps its place in its note at every zoom. Inside the box the wheel scrolls the box, not the page; a drag selects its text and does not pan; and a click places the caret without selecting or unselecting the diagram (see Large Response and Diagram Handling › A Long Payload Scrolls in Its Box (5.4.0+)).
A note's buttons (expanding or folding it, its format, its width) and the report's controls draw a diagram again with a new picture. A zoomed diagram keeps the level it was zoomed to and its place across the picture, in its own direction (5.7.0): a level above its fit level only while its new picture is still wider than its box, and a level below 100% only while it still fits; otherwise it starts where a new diagram starts. A diagram that comes back drawn in parts, because an expanded note made it that tall, keeps its zoom and its selection on its box. One drawn again while it is not shown, its scenario closed or its panel hidden, gets its zoom back when it shows.
Since 5.2.5 a diagram drawn again to fit its box, a wide note of it folded, comes back at full size: it pans no more, and its text can be selected. The Components tab's diagram keeps its zoom, level and place, when the filters draw it again.
Before 5.2.3 the page kept only whether a diagram was zoomed: a diagram zoomed partway came back at full size and at its left edge, and one that came back in parts came back at its fit.
A control that draws diagrams again keeps what you were reading where it was: the report's toggles and selects in its bar (Headers, Steps, Assertions, Databases, Events, Setup, the payload buttons, the line limit, the note format and width), a scenario's own in its settings, and the Components tab's. The drawn text nearest the middle of the window, below the bar, stands where it stood once the diagrams are drawn again, in every browser, however many diagrams above it grow, are zoomed or are cut by the window's edge. A zoomed diagram's new picture is drawn at its level from the start, so putting its zoom back moves nothing. Among notes that draw the same words again and again (each JSON field's name, each brace), the text you read is told apart by the words near it that the diagram draws once, so a filter that takes rows away keeps your row. If you scroll the window, follow a link or go Back while the diagrams are still being drawn, the page goes where you go; a wheel across a diagram or inside a box of its own, and a tap, keep your place. On a report whose CSS scrolls smoothly (scroll-behavior: smooth in its CustomCss), keeping your place is never animated, here or when you zoom a diagram.
Before 5.34.2 the page left a redraw to the browser's scroll anchoring, which keeps what is at the top of the window, and on a report with zoomed diagrams a toggle could throw the diagram you were reading off the screen (#227): putting a zoomed diagram's zoom back scrolled the page by a place read on its picture at fit size, by all the height its zoom gives back for a diagram far above the window, and a redraw of the diagram at the top of the window moved everything below it by its change of height. Safari has no scroll anchoring at all. A note's own buttons keep their own rule: a note folded from its lower half brings its new bottom to where you clicked.
Hovering a diagram note whose body is JSON shows a Y button in the note's top-right button cluster (beside −). Clicking it re-renders the note's payload as YAML; the button becomes J and clicking again restores the original JSON view. The payoff is strings containing \n escapes — SQL queries, stack traces, scripts — which the JSON view shows as one soft-wrapped line but the YAML view renders as a literal block scalar with the original line breaks and indentation:
query: |-
SELECT o.id,
o.total
FROM orders o
WHERE o.status = 'open'The toggle is entirely client-side: nothing extra is embedded in the report, and already-generated reports gain the feature once they use the updated script asset. It is listed alongside the rest of the report features in Generated Reports › Report Features.
From 5.0.0 a compact JSON/YAML dropdown with no label sits in the display settings, between the Payloads radio and the Headers, Assertions, Steps, Databases, Events and Setup toggles: once for the report, and once in each scenario's settings, behind its gear. Screen readers name it "Payload format", and the same words head its options while it is open. From 3.0.66 to 4.x it sat beside the Headers/Assertions/Steps/Databases toggles, at report level and on each scenario's diagram toolbar, with "Note payload format" as its tooltip. The two levels act differently:
- Report-level dropdown — converts every eligible note in every scenario, syncs all scenario dropdowns to the same value, and becomes the default for diagrams that have not rendered yet (a scenario opened later renders straight into the chosen format).
- Scenario-level dropdown — converts only that scenario's notes, including its not-yet-rendered diagrams. It deliberately does not move the report-level dropdown or affect other scenarios.
- Ineligible notes (plain text, GraphQL, truncated JSON, …) are untouched by bulk commands; per-note
Y/Jbuttons still work afterwards for fine control.
Reports start in YAML from 4.0.0: every eligible JSON payload renders as YAML from the first paint, the dropdowns start on YAML, and every toggle still works to go back. To start in JSON, as 3.x did, set ReportConfigurationOptions.NotePayloadFormat = NotePayloadFormat.Json (or kronikol ingest --note-format json). See Report Configuration.
The JSON is recovered from the note text in the browser by reversing the generation-time transforms (header lines dropped (the gray tag of reports before 3.30.0 and the computed ink tag after), focus markup stripped, creole escapes removed and code points decoded, wrap breaks re-joined), then gated by JSON.parse. Since 3.0.62 the note source carries the payload's backslash bytes verbatim — PlantUML block notes render backslash sequences literally, so a wire \n escape now displays as \n (older releases doubled every backslash, showing \\n); the one exception is \t, which PlantUML always renders as a real tab:
- Parses → the note is eligible and the button appears on hover.
-
Doesn't parse → no button. This automatically excludes capture-truncated JSON prefixes, GraphQL-formatted bodies, form-urlencoded and plain-text bodies, the
[binary content]placeholder, server-side chunked continuation notes, and requests whose note carries a[Full path]block. The failure mode is "toggle unavailable", never wrong output.
Row-capped responses (3.0.83). A database response capped at MaxResponseRows used to be excluded by that same gate, but for a reason that did not really apply: its ... (N more rows not shown) footnote is not part of the JSON, yet everything above the footnote is a complete document. The footnote is now split off before the gate and re-attached under the emitted YAML, so these notes toggle like any other and the reader is never shown a row list that silently claims to be the whole result. The split is deliberately narrow — only the generator's own wordings (... (N more rows not shown), ... (N more documents not shown), ... (N more)), and only as the last payload line — so a payload line that merely resembles one is never eaten. Applies to the per-note button, the bulk dropdowns, and the zero-click NotePayloadFormat.Yaml default alike.
Eligibility is computed lazily on the note's first hover and cached — nothing runs at page load or per render.
YAML is emitted from the reconstructed JSON text's tokens, never from a parsed JavaScript value, so three things a JS object cannot represent pass through verbatim: int64s beyond 2^53 (e.g. 9007199254740993), duplicate keys, and the original order of integer-like keys. JSON \uXXXX escapes decode to their characters (the same readability choice the .NET side makes with UnsafeRelaxedJsonEscaping). Strings a block scalar cannot faithfully represent — containing control characters, or whitespace-free runs over 120 characters (measured on each line after the client-side creole escape, not on the raw payload, since the escape can lengthen a run past the limit) — fall back to a double-quoted scalar, never worse than the JSON view. Two classes of invisible bytes are knowingly traded away from multiline strings so the block scalar wins (the same trade in both cases: the YAML view drops them, the JSON view stays exact, and quoted fallbacks always show the original bytes). First, CRLF breaks (3.0.61+): when every line break in the string is exactly \r\n — the shape of every Windows-captured payload — the YAML view displays it as a block scalar with the \r dropped. Mixed or lone \r still takes the quoted fallback — with one carve-out (3.0.73+): bare \ns at the very start of the string (the "\n" + query shape BigQuery job bodies often have, combined with CRLF breaks in the Windows-authored query itself) don't count as mixing, since leading breaks render as empty block-scalar lines either way; only the breaks after the first non-newline character must be uniformly \r\n. Second, trailing whitespace (3.0.79+): ASCII space/tab runs immediately before a line break, and an all-whitespace tail after the final break — SQL authored in C# raw/verbatim strings routinely carries both (a SELECT line, and the raw string's closing indentation) — are stripped from the display instead of forcing the quoted fallback, since the SVG note text renders them as nothing anyway. Single-line strings are never normalised, and only ASCII space/tab is stripped (not NBSP or other Unicode whitespace). The SVG copy-text feature yields the YAML lines exactly as displayed.
The block scalar header records the trailing newline: | when the string ends with exactly one newline, |- when it ends without one; a string ending in two or more newlines takes the quoted fallback (a literal block cannot show how many there were). These are judged on the normalised display, so the trailing-whitespace tail-strip can turn a string that ends without a newline ("x\n ") into a keep-clip | block — the stripped tail leaves exactly one trailing \n. Since 3.0.63 a string that starts with newlines unfolds too (the shape of SQL written as a C# raw string or heredoc): the block opens with the corresponding empty lines, indentation is anchored on the first non-empty line, and when that line itself starts with spaces an explicit indentation indicator is emitted (e.g. |2). A string consisting only of newlines has nothing to anchor indentation on and stays double-quoted, as does a string whose indicator would sit inside a sequence item, where the indicator counts from the parent node's indent and the arithmetic is too fragile to emit.
One narrow caveat, for reports generated before 3.30.1: a payload containing a literal ~ directly before characters the creole escaper protects (e.g. ~/ before a second // on the same line) is indistinguishable from an escape and reconstructs one character off; if the result still parses, the YAML view can show subtly wrong bytes. The JSON view is always exact. From 3.30.1 a payload's own ~ is written as the code point <U+007E>, so it reconstructs exactly.
The format is per-note state, exactly like expand/truncate: it survives expand/truncate/collapse, the headers toggle, the assertion/step/database filters, and client-side fragment splitting. Truncation and the long-note arrows count the displayed lines — a 3-line JSON note whose SQL unfolds to 50 YAML lines becomes a "long" note in YAML view. The collapsed one-line preview always uses the original JSON text — a collapsed note in a YAML-mode diagram previews its JSON until expanded (the preview is a content hint, and the per-note format button is hidden while collapsed). Notes with FocusFields emphasis lose the emphasis markup in YAML view (the JSON view keeps it).
The dropdowns show the last bulk command (initially the report's configured default); per-note Y/J clicks do
not move them, the same contract as per-note +/− not moving the Payloads radio (the Details radio before
5.0.0).
A page refresh resets the dropdowns to the report's configured default, together with the notes they describe. Firefox restores form-control state across a plain reload (Chromium does not), which used to bring a scenario dropdown back reading YAML over notes the freshly-loaded report had rendered as JSON — and re-picking YAML on an already-YAML <select> fires no change, so the view could not be reconciled. Since 3.0.68 every report control (the format and truncate-lines dropdowns, the search's fields and the duration threshold) opts out of that restoration, so what a control reads is always what the report is doing. Filter state you want to keep across reloads belongs in the URL hash, which the report writes and restores itself.
The context menu's copy entries follow the displayed format: on a YAML-toggled note, Copy box text (and Copy full/current box text on a truncated note) yields the YAML exactly as displayed — "full box text" means the un-truncated current view, not the raw JSON — and Copy Highlighted Text normalises the selection against the displayed YAML. Creole ~ escapes from the render source never reach the clipboard in either view (both fixed in 3.0.66; before that, Copy box text on a YAML note returned the original JSON). On a long payload drawn with its scroll box (5.4.0), current reads the box's text, in the view it shows, never the 40 rows drawn under it.
Some payloads are hard to read rather than hard to parse: a wide analytics SQL query, an XML body,
tabular text. The width control is for them, beside the Y/J format toggle in a note's hover
cluster. 4.0.0 removed the opt-in monospace control that sat beside it (see Migrating to v4).
It is BrowserJs-only: it re-renders the diagram in the browser, which no other rendering mode
can do. For Server, Local and NodeJs the generation-time
DiagramNoteWrapWidth is the equivalent knob.
| Glyph | Does |
|---|---|
↔ / →←
|
Widens this note to fill the diagram's container, and back. |
A compact dropdown does the same for every note at once, report-wide or per scenario. From 5.0.0 it sits in the
display settings, after the format dropdown (before 5.0.0, beside the filter toggles). It reads Wrap (the state a
report starts in: notes wrap at the report's DiagramNoteWrapWidth) and Wide (notes widen to fill the diagram),
under a Payload width heading that shows when the dropdown is open (Note width before 5.0.0). Before 3.22.0 the
two options read Fit and Full.
ReportConfigurationOptions.TestRunReportToggleDefaults.NoteWidth starts the whole report in either
state.
svg { max-width: 100% } scales a diagram wider than its container down rather than scrolling
it, so past the container wider text is smaller text. "Full width" therefore means fill the
container exactly: the target is computed from the drawn diagram's slack when you use the control,
with up to two correction passes after the re-render (widening a left-anchored request note pushes the
participants right rather than extending the canvas, so the relation is not quite linear; the second pass
takes the slope the first one measured). Since 5.2.4 the passes measure the widest part of a diagram drawn
in parts and wait for its drawings in flight, so a diagram in parts, and a report that starts Wide, come
within 24 px of the container; one pass, measured on the first part, could leave them short.
The ↔ glyph appears only where widening would change something — a note whose text does not wrap
does not offer it. The dropdown cannot be gated the same way, because diagrams render lazily and a
scenario's notes are not all drawn when its settings are (its toolbar, before 5.0.0). Wide changes only notes that
wrap; a note that
already fits stays as it is, so on a scenario of short payloads the control appears to do nothing. Window resizes are deliberately not tracked: re-rendering every widened diagram on
a resize costs far more than it returns, and using the control again recomputes the target.
It rides the only per-note width handle PlantUML has: a
.className { … } style block plus a stereotype on the note's header line
(note<<eventNote>><<kronNoteWide>> left). Measured on the shipped engine and on real Java
PlantUML, the element selectors — note { … }, note<<x>> { … }, sequenceDiagram { note { … } } —
all silently ignore MaximumWidth; only the class selector carries it.
Nothing is emitted at generation time: the class and the style block exist only in the client-side re-render source, the way the YAML view's spliced lines do. The copied PlantUML source carries them, so a widened note renders the same way if you paste it into plantuml.com.
MaximumWidth is a maximum, so one class per diagram set from the widest note's slack leaves
narrower notes exactly where they were. It is also not a bound in the other direction: a note's floor
is its longest unbreakable run, because MaximumWidth, like wrapWidth, only breaks at spaces.
Right-click a note for Copy box text and Open box text in new tab (each split into full and
current when the note is collapsed or truncated), and right-click the diagram for Copy all caller
request payloads. All of them hand back the payload as it was captured, not as it is drawn.
Before 3.29.6 the last one was offered only with SequenceDiagramArrowColors off: it looked for a
plain caller -> arrow, and arrows are coloured by default.
Copying a long payload drawn with its scroll box (5.4.0) gives what it gave when the payload was drawn
in full: current is what the note shows, its headers and the text its box holds, never the 40 rows
drawn under the box. Before 5.4.0 the text of a payload drawn with FocusFields emphasis came back with
Kronikol's markup in it, as in <color:lightgray>"id": 1,</color>, and so did a form body's fields, as in
a=1<font color="lightgray">&; both now come back as they read.
That distinction is the whole point of this section. Kronikol writes real line breaks into a note
body so the diagram stays inside its width budget — skinparam wrapWidth only breaks at spaces, and
the text that gets long (tokens, connection strings, base64, minified bodies) has none, so the breaks
have to be in the source. Those breaks are a display decision. Before 3.0.86 the copy paths read
the note's source lines and joined them with a newline, so a token cut mid-way came back in two
pieces and did not parse.
Each break the generator inserts now carries an invisible marker, and the copy paths undo exactly those, leaving every newline the payload really had. Two markers, because the assertion-note wrapper breaks two ways: between words, where it consumes the space that was there, and inside a word, where it does not — one marker would reassemble one of them wrong.
The marker is the PlantUML escape <U+200B> rather than a literal zero-width space, and that is
deliberate. Kronikol escapes a payload's own <, so a payload that literally contains the text
<U+200B> reaches the source as ~<U+200B>; an unescaped marker is therefore provably
Kronikol's own. A literal character would be indistinguishable from one in the captured bytes.
It costs nothing to draw: measured on real Java PlantUML, a note carrying markers and one without
draw at exactly the same size (668 x 145 either way). You will see <U+200B> in Copy PlantUML
source — that is the source, and the breaks are genuinely part of it. Paste it into plantuml.com and
it renders identically.
| Aspect |
PlantUml + Server (default) |
PlantUml + Local
|
PlantUml + BrowserJs
|
|---|---|---|---|
| Diagram syntax | PlantUML | PlantUML | PlantUML |
| Rendering | Server-side (remote URL) | In-process .NET via IKVM | Client-side (browser JavaScript) |
| HTML embedding | <img src="..."> |
<img src="..."> |
Empty <div> + compressed source map, rendered via IntersectionObserver |
| External dependencies | PlantUML server | IKVM NuGet package | None (JS loaded from CDN on page open) |
| Teoz support | Yes | Yes | Yes |
Themes (PlantUmlTheme) |
Applied by the engine, unvalidated | Applied by the engine, unvalidated |
No effect: the engine runs without its theme bundle and draws the diagram unthemed (see below); from 3.30.0 the run records an OptionNotApplied diagnostic |
| Offline/self-contained | No (needs server) | Yes with Base64 | Requires internet for CDN scripts |
| Download cost | 0 (images are pre-rendered) | 0 (images are pre-rendered) | ~8 MB JS on first page load (cached) |
| Lazy loading | <img loading="lazy"> |
<img loading="lazy"> |
IntersectionObserver |
| NuGet package needed | None | Kronikol.PlantUml.Ikvm |
None |
The fourth mode runs the same TeaVM engine as BrowserJs, but at report-generation time in a local Node.js process, so the report carries pre-rendered diagrams (<img> with a data:image/svg+xml;base64 source, or inline SVG when InlineSvgRendering is on) and needs no engine at viewing time.
- On first use the renderer downloads
plantuml.js(the JavaScript build, from 5.0.0 also where the page draws with the Wasm engine) andviz-global.jsfrom the engine CDN and caches them under%LOCALAPPDATA%/Kronikol/plantuml-js/<engine-tag>/(the directory carries the CDN tag, so an engine upgrade re-downloads instead of silently reusing the old build). The render script (an embedded resource) is written beside them asplantuml-render.<hash>.js, named for its own bytes, and the engine's V8 code cache (plantuml.js.v8cache) is kept there too, so only the first render pays for compiling the engine. Every Kronikol version on one engine shares the directory, thekronikoltool beside a test project included, so each version runs its own script, and a copy already in place is never rewritten while another process may be running it. Until 3.31.7 each process rewrote oneplantuml-render.json its first render and ran whichever version had written it last.- Checked (3.31.1). Both files are checked against the same known hashes the report page uses, once per process and on every download. A file that does not match is replaced; a download is written under a temporary name of its own and renamed into place only once it matched, so a process killed mid-download, or two processes sharing the directory, never leave a torn file under the real name. A download that does not match is tried once more, and a second mismatch stops the render with the URL, both hashes, the byte count and what to do (look for a proxy rewriting JavaScript, or delete the directory). A file another process holds open and that does not match either stops it the same way, naming the file and the directory (3.31.7). Before, whatever the CDN answered was written straight to the final name and trusted by every later run.
-
Looked for again before each render (3.32.2). After its first full check a process only checks that each file is still there, and checks in full again when one is gone: deleting the directory, the remedy the messages above name, now takes effect at the next render of a process that is still running, such as an IDE's test host or a long
kronikolrun, where every later render used to fail until the process ended. A temporary file a killed process left behind, a download or node's code cache (up to 4 MB each), is deleted once it is an hour old. -
The code cache checks itself. The file holds a SHA-256 of the V8 data ahead of the data, and a cache that does not match is reported
rejectedand rebuilt. A release node checks a code cache's header and never its payload: one damaged byte crashed node before any output, and since the crash left the file in place, every later render on that machine crashed too. The cache is also deleted whenever the engine file is replaced, because V8 checks a cache against the source's length, not its bytes.NodeJsPlantUmlRenderer.LastCodeCacheStatusreportshit,missorrejectedfor the last process.
- Every diagram of the report goes through one
nodeprocess (NodeJsPlantUmlRenderer.RenderMany, NDJSON in and out, since 3.0.45): node start, engine compile and warm-up are paid once per report, not once per diagram. - A diagram the engine refuses gets a placeholder note, rendered in a second small batch, so an image-based report still shows it. If
nodeis not onPATHor the engine cannot be downloaded, every diagram falls back to its PlantUML source as code-behind.
Requirements: node on PATH. It is pre-installed on the hosted runners of GitHub Actions, Azure DevOps, GitLab CI and CircleCI. WebAssembly is not required: under node --jitless, which NODE_OPTIONS can carry, the script leaves Graphviz out as the page does, the engine lays component diagrams out with Smetana, and stderr says [plantuml-render] layout: smetana (…). Until 3.31.3 the process stopped before its first diagram there, and every diagram of the report stood as a placeholder.
What the page still draws (3.31.8). With internal-flow tracking on (the default), the Activity tab and the internal-flow popups are drawn in the browser, as under BrowserJs: there is one per scenario and one per call, too many to draw when the report is written. The page carries the engine on demand, fetches nothing when it opens, and fetches the engine from the CDN the first time a reader opens one of those views; offline, the view says the engine could not be loaded. The page binds each diagram's internal-flow links when the diagram comes into view, since this engine draws a link as text. The embedded component diagram is drawn when the report is written, as ComponentDiagram.html is, from the plain component syntax (the Node renderer cannot load the C4 library). Until 3.31.8 those views were blank and the links opened nothing.
Diagram splitting uses the same 8,000-character limit as BrowserJs and Local, not the 2,000-character limit of server URLs.
Use PlantUmlRendering.BrowserJs when you want:
- No server dependency — Reports work without access to a PlantUML server (public or private)
- No IKVM overhead — No 30 MB NuGet package, no in-process Java rendering during test execution
- Full PlantUML feature set — Including Teoz and all diagram types (themes, icons, emoji and stdlib includes excepted, see below)
- Local browsing — Open the HTML report file directly in a browser and diagrams render on the spot
- Fast test execution — Diagram rendering is deferred to report viewing time, not test execution time
Consider other options when:
-
No internet at viewing time — The CDN scripts need to be fetched on first page load. Use
PlantUmlRendering.LocalwithBase64Png/Base64Svgfor fully offline reports -
You need pre-rendered images — Use
PlantUmlRendering.ServerorPlantUmlRendering.Localfor<img>tags that don't require JavaScript
Note:
PlantUmlRenderingcontrols how PlantUML diagrams are rendered in the HTML report. The CI job summary is separate from this choice: its diagrams are always PlantUML server URLs with the source alongside, whateverPlantUmlRenderingis. See CI Summary Integration › Where the Diagram Images Come From.
These configuration options work with PlantUmlRendering.BrowserJs because the same PlantUML text generation pipeline is used:
-
PlantUmlTheme— not yet. The option writes!theme <name>into the diagram text, and the directive does reach the engine in the render worker. The engine then asks for its theme bundle (themes.js) by adding a script element to its page, which a render worker cannot load, so from 3.29.6 the worker answers at once with a load failure and the engine draws the diagram unthemed, with a console warning (themes.js could not be loaded). From 3.30.0 the run also records anOptionNotApplieddiagnostic saying so. From 3.0.76 to 3.29.5 nothing answered: a themed diagram was never drawn, and neither was anything after it, so a report with a theme set showed no diagrams. The engine loads OpenIconic icons (<&name>), emoji (<:name:>) and stdlib!includemodules the same way; from 3.29.6 such a diagram fails on its own: an icon or emoji with a message saying so, a stdlib include with the engine's error picture. Kronikol escapes the icon and emoji forms (and a sprite reference,<$name>) in the text it copies in from payloads and tests from 3.29.6, and a payload line opening with!from 3.30.1. UnderServerandLocalthe engine applies the theme, and underNodeJsthe same engine runs without its theme bundle, so expect no theme there either. Where a theme does render it was never designed for Kronikol's notes and page: measured in August 2026 with the theme text reaching the browser engine, 30 of the 43 bundled themes fail contrast on the report page and 4 lose the note controls. Making the option work for every bundled theme, notes included, is planned (THEME_PLAN.mdunderplans/in the repository). -
SeparateSetup/HighlightSetup— Setup separation boxes are part of the PlantUML syntax -
FocusEmphasis/FocusDeEmphasis— Field highlighting is applied to the PlantUML text -
ExcludedHeaders— Header filtering happens during text generation - All formatting processors (
RequestPreFormattingProcessor,RequestPostFormattingProcessor, etc.)
These options are ignored when using PlantUmlRendering.BrowserJs:
| Option | Reason |
|---|---|
PlantUmlServerBaseUrl |
No server is used — rendering happens in the browser |
PlantUmlImageFormat |
The browser engine always renders SVG |
LocalDiagramRenderer |
No local rendering — diagrams are rendered in the browser |
LocalDiagramImageDirectory |
No image files are produced |
Note:
LazyLoadDiagramImagesis also not applicable in the traditional sense — lazy rendering is always enabled viaIntersectionObserverand cannot be disabled forBrowserJs.
plantuml.js reports these failures by writing into the diagram's place instead of throwing:
-
java.lang.RuntimeException: Diagram too large for browser rendering: 413164x3671 (max 98304; override via the maxSvgSize option, or set it to 0 to disable this check)— the rendered image is wider or taller than the engine's canvas (since 3.0.76 the limit is passed as themaxSvgSizerender option — the stock default is 8192 px; earlier releases shipped an engine with the limit patched into the file, and builds before 3.0.50 printed the unpatched(max 4096)in this message even though the enforced limit was already 98304). The report shows it as a red Diagram too large for client-side rendering block with the engine's text and a collapsed Raw PlantUML<details>. The usual cause is one unbreakable line in a note (PlantUML'swrapWidthwraps at spaces only); the library now breaks whitespace-free runs longer than 120 characters and re-indents capture-truncated JSON (see Content Formatting › Formatting Pipeline), so this should not recur for captured bodies — if it does, the raw source tells you which line. -
Syntax Error? (Assumed diagram type: class)— the engine could not parse the source, or (for a sequence diagram) there was nothing to draw: a source with no participants and no arrows answers exactly this way, at the last header line. The report never sends an empty body to the engine (the "nothing to draw with the current filters" message stands in, on the initial render and on every re-render), and a real syntax error gets the same Raw PlantUML<details>under the error image. -
A bundle the engine could not load (3.29.6+) — the engine adds a script element to its page to load OpenIconic icons (
<&name>) or emoji (<:name:>), and the render worker answers with a load failure. The report shows a red This diagram uses PlantUML icons (or emoji) , which this report's renderer does not load block namingPlantUmlRendering.ServerandPlantUmlRendering.Local, which draw them, with the same Raw PlantUML<details>. Before 3.29.6 nothing answered the engine, and neither that diagram nor any after it was drawn. -
An error has occurred! … For some reason, dot/GraphViz has crashedis the engine's picture for a Graphviz failure, drawn in the diagram's place. Until 3.31.3 every component diagram drew it where WebAssembly was off; the page now leaves Graphviz out there (see Without WebAssembly). With WebAssembly on, Graphviz failed on that diagram, and the browser console carries its message.
Over-long statements are diagnosed by name (3.0.48+). A single statement past the engine's parse limits also answers Syntax Error?, with no hint from the engine about why: the statement matches no parse rule, so the parser abandons the entire fragment, which is why every other statement in it disappears too. The failure block now classifies the raw source itself and, when it finds a statement over its limit, names the offending line number, its kind and its length alongside the limit. Since 4.14.5 it knows every capped kind (message statement, block label, coloured note bar, component edge label, participant name or alias, swimlane name, activity action) and takes each limit from Kronikol's own constants. A second, nastier failure mode exists for several statement forms: a coloured hnote bar past its limit overflows the engine's own JavaScript stack (RangeError: Maximum call stack size exceeded) and yields no SVG at all, and a component edge's label, a participant's name, a swimlane, a block opener or an activity action past its length draws the engine's stack-overflow or Syntax Error? picture in place of the diagram, earliest in the Web Worker BrowserJs renders in. From 5.0.0 the engine draws those statements at any length Kronikol writes, and what still runs it out of stack is deep nesting (see The Wasm engine). Since 4.14.6 a stack failure is reported as one: the page puts a line above the engine's picture (or in place of its text) naming the cause and the statement past its cap, with its kind, length and cap, or else the longest statement; counts it in window.__kronikolRender.errors; and does not cache it, so the same source asked for again is drawn again. The internal-flow popup does the same, and since 4.14.10 it also names an over-long statement under the engine's Syntax Error? picture, as the report's own diagrams do: an activity action past its length fails that way. Under NodeJs the diagram fails instead of showing the engine's picture: a sequence diagram gets the placeholder note, a component diagram the failed panel and a RenderFailure diagnostic, each naming the line the engine stopped at. Kronikol caps every statement it emits below these limits at generation time; the measured caps and constants are in Large Response and Diagram Handling › Statement-Length Limits (3.0.48+).
Neither failure stalls the page: both render paths treat any engine output as completion (with a 15 s per-fragment timeout as the backstop), never cache a failure as a result, and move on to the next diagram. Earlier versions waited for an <svg> on re-render, so one too-large fragment left window._plantumlRendering stuck and, after the 15 s force-reset, let renders overlap in the engine's shared state — diagrams after that point came out blank, stale or wrong.
The Teoz layout engine is a newer PlantUML layout engine that supports:
-
Parallel messages — Use
&to show messages sent simultaneously - Nested boxes — Group participants in hierarchical boxes
- Anchors and durations — Label time spans between diagram events
To use Teoz, include the pragma in your PlantUML text. You can inject it globally using a formatting processor:
new ReportConfigurationOptions
{
PlantUmlRendering = PlantUmlRendering.BrowserJs,
RequestResponsePostProcessor = content => content // your post-processing
}Or use TrackingDiagramOverride.InsertPlantUml("!pragma teoz true") at the start of a test to enable it per-scenario. See Diagram Customisation › InsertPlantUml for details.
Teoz is fully supported by the browser engine because the complete PlantUML codebase is compiled to JavaScript.
Home · 🔍 Search this wiki Full-text search across every page. The “Pages” list above matches page and heading names, not page content.
Getting Started
- Quick Start (xUnit)
- Project Templates
- AI Integration Prompt
- Framework Integration Guides
- Migrating to v5
- Migrating to v4
Common Tasks
Integration Guides
- Integration xUnit3
- Integration xUnit2
- Integration NUnit
- Integration MSTest
- Integration TUnit
- Integration BDDfy xUnit3
- Integration LightBDD xUnit2
- Integration LightBDD xUnit3
- Integration LightBDD TUnit
- Integration ReqNRoll xUnit2
- Integration ReqNRoll xUnit3
- Integration ReqNRoll TUnit
- Integration Playwright
Uninstrumentable / polyglot backends
- Integration ProxyTap Extension
- Integration TcpTap Extension
- Integration Otlp Extension
- Exporting to OpenTelemetry
- Ingesting External Captures
- Ingesting from Jest
- Integration Cucumber Messages
- Capture-Time Redaction
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage Extension
- Integration ClickHouse Extension
- Integration CloudStorage Extension
- Integration CosmosDB Extension
- Integration Dapper Extension
- Integration DynamoDB Extension
- Integration EF Core Relational Extension
- Integration Elasticsearch Extension
- Integration EventBridge Extension
- Integration EventHubs Extension
- Integration Grpc Extension
- Integration Kafka Extension
- Integration MassTransit Extension
- Integration MongoDB Extension
- Integration MySqlConnector Extension
- Integration Npgsql Extension
- Integration Oracle Extension
- Integration PubSub Extension
- Integration Redis Extension
- Integration S3 Extension
- Integration ServiceBus Extension
- Integration SNS Extension
- Integration Spanner Extension
- Integration SqlClient Extension
- Integration Sqlite Extension
- Integration SQS Extension
- Integration StorageQueues Extension
- Integration OpenTelemetry Extension
- Integration DispatchProxy Extension
- Integration MediatR Extension
- Integration PlantUML IKVM
Configuration
- Tracking Dependencies
- Tracking Custom Dependencies
- HTTP Tracking Setup
- Report Configuration
- Diagram Customisation
- Phase-Aware Tracking
- Content Formatting
- PlantUML Server Configuration
Features
- Generated Reports
- Report Themes
- Search and Filter Syntax
- Component Diagrams
- PlantUML Browser Rendering
- Inline SVG Rendering
- Internal Flow Tracking
- Tags and Attributes
- Excluding Requests
- Excluded Headers
- Multi-Host Test Architectures
- Event-Driven Architecture Testing
- Service Bus Tracking Patterns
- Background Thread Correlation
- Parallel-Safe Background Correlation
- Event & Message Tracking
- Assertion Tracking
- Step Tracking
- Tabular Attributes
- Large Response and Diagram Handling
- Querying Reports
- Service Card
- Cross-Run History
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
- Merging Parallel Reports
Reference