-
Notifications
You must be signed in to change notification settings - Fork 1
Inline SVG Rendering
Inline SVG Rendering embeds PlantUML sequence diagrams directly into the HTML report as <svg> elements instead of using <img> tags pointing to rendered image URLs. This is a prerequisite for Internal Flow Tracking (clickable arrows) and can also be used independently for better SVG integration.
Set InlineSvgRendering = true on your ReportConfigurationOptions:
new ReportConfigurationOptions
{
InlineSvgRendering = true,
PlantUmlImageFormat = PlantUmlImageFormat.Svg, // Required for Server/Local
// ... other options
}Note:
InternalFlowTrackingdefaults totrue, which automatically forcesInlineSvgRenderingtotruefor Server/Local rendering — you don't need to set it explicitly.
The behaviour depends on your PlantUmlRendering mode:
- During report generation,
DefaultDiagramsFetcherfetches the SVG from the PlantUML server usingHttpClient(instead of generating an<img src="https://github.com/...">URL). - The XML declaration is stripped from the SVG response.
- The raw SVG markup is embedded directly in the HTML report inside a
<div class="plantuml-inline-svg" data-diagram-type="plantuml">container.
- During report generation,
DefaultDiagramsFetcherrenders SVG bytes in-process via IKVM usingLocalDiagramRenderer. - The XML declaration is stripped and the SVG markup is embedded inline, same as the server path.
Browser rendering already produces inline SVG (the PlantUML JS engine renders <svg> elements directly into the DOM). InlineSvgRendering has no additional effect in this mode.
| Use case | Recommended |
|---|---|
| You want Internal Flow Tracking | Automatic — InternalFlowTracking defaults to true and forces it |
| You want SVGs responsive to CSS styling | Yes — inline SVGs inherit page styles |
| You want to manipulate diagram SVGs with JavaScript | Yes — inline SVGs are part of the DOM |
You want pre-rendered <img> tags for simplicity |
No — use default rendering |
You want loading="lazy" on images |
No — inline SVGs are part of the page content |
| Property | Type | Default | Description |
|---|---|---|---|
InlineSvgRendering |
bool |
false |
When true, embeds SVG diagrams inline in the HTML instead of using <img> tags. Requires PlantUmlImageFormat.Svg for Server/Local rendering. Automatically enabled when InternalFlowTracking is true. |
With inline SVG rendering enabled, the report emits:
<div class="plantuml-inline-svg" data-diagram-type="plantuml">
<svg xmlns="http://www.w3.org/2000/svg" ...>
<!-- Full SVG content -->
</svg>
</div>Instead of the default:
<img src="https://plantuml.com/plantuml/svg/..." loading="lazy" />The data-diagram-type attribute is used by DiagramContextMenu to locate diagram containers for right-click context menus and other interactive features.
Right-clicking on any diagram container with a data-diagram-type attribute opens a custom context menu. The menu adapts its items based on the content type of the container.
data-diagram-type |
Content | Menu items |
|---|---|---|
plantuml |
SVG diagram (inline or browser-rendered) | Full menu — PNG, PNG (no transparency), SVG, source, open in tab |
flamechart |
HTML flame chart bars | PNG only — Copy as PNG, Save as PNG |
calltree |
HTML call tree list | PNG only — Copy as PNG, Save as PNG |
For SVG-based diagrams (plantuml):
- Copy as PNG — Renders SVG to a 2× canvas and copies to clipboard (transparent background)
-
Copy as PNG (no transparency) — Renders SVG to a 2× canvas with the diagram's background colour filled first. Background is detected from the first
<rect>element'sfillattribute. - Copy as SVG — Copies the serialised SVG markup to clipboard
- Copy PlantUML source — Copies the raw diagram source code
- Save as PNG / Save as PNG (no transparency) — Downloads the PNG
- Save as SVG — Downloads the SVG file
- Open as image in new tab — Opens the SVG in a new browser tab
- Open source in new tab — Opens the raw source in a new tab
- Show default browser menu — Displays a toast instruction to right-click outside the diagram
For HTML-based content (flamechart, calltree):
- Copy as PNG — Renders the HTML element to a canvas via foreignObject and copies to clipboard
- Save as PNG — Downloads the rendered PNG
- Show default browser menu — Displays a toast instruction
The context menu renders at z-index: 20001 to appear above internal flow popup overlays (z-index: 20000).
Getting Started
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
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage 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
- Search 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
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
Reference