StellaOps.Workflow.Renderer.Svg
Renders laid-out workflow diagrams as SVG and PNG.
| Package | StellaOps.Workflow.Renderer.Svg |
| Component | Workflow |
| Licence | BUSL-1.1 (Workflow licence) |
| Package kind | Library |
| Target framework | net10.0 |
To add the package to a project, see Installing Stella Ops packages.
Namespaces
| Namespace | Types |
|---|---|
StellaOps.Workflow.Renderer.Svg | 4 |
StellaOps.Workflow.Renderer.Svg namespace
| Type | Kind | Description |
|---|---|---|
WorkflowRenderPngExporter | class | Exports SVG workflow diagrams as PNG images. |
WorkflowRenderSvgDocument | record | A rendered SVG workflow diagram and its size. |
WorkflowRenderSvgRenderer | class | Renders positioned workflow diagrams as SVG, with a legend and the licence notice. |
WorkflowRenderSvgServiceCollectionExtensions | class | Registers the SVG renderer of workflow diagrams. |
WorkflowRenderPngExporter class
public sealed class WorkflowRenderPngExporter
Exports SVG workflow diagrams as PNG images.
WorkflowRenderPngExporter() constructor
public WorkflowRenderPngExporter()
Creates an instance of WorkflowRenderPngExporter.
ExportAsync(WorkflowRenderSvgDocument, string, float, CancellationToken) method
public Task ExportAsync(WorkflowRenderSvgDocument document, string pngPath, float scale = 2, CancellationToken cancellationToken = default)
Draws an SVG diagram on a white background and writes it as a PNG file, creating its directory.
Parameters
document: The SVG diagram.pngPath: The PNG file to write.scale: The scale of the image against the diagram size; 2 by default.cancellationToken: Cancels the operation.
Returns
A task that completes when the file is written.
Exceptions
InvalidOperationException: The SVG cannot be loaded.
WorkflowRenderSvgDocument record
public sealed record WorkflowRenderSvgDocument
A rendered SVG workflow diagram and its size.
WorkflowRenderSvgDocument() constructor
public WorkflowRenderSvgDocument()
Creates an instance of WorkflowRenderSvgDocument.
Height property
public required double Height { get; init; }
The diagram height, in SVG user units.
Svg property
public required string Svg { get; init; }
The SVG markup.
Width property
public required double Width { get; init; }
The diagram width, in SVG user units.
WorkflowRenderSvgRenderer class
public sealed class WorkflowRenderSvgRenderer : IWorkflowRenderSvgRenderer
Renders positioned workflow diagrams as SVG, with a legend and the licence notice.
WorkflowRenderSvgRenderer() constructor
public WorkflowRenderSvgRenderer()
Creates an instance of WorkflowRenderSvgRenderer.
NoLicenceRecordNotice constant
public const string NoLicenceRecordNotice = "No local licence record is loaded. See the applicable LICENSE and Order for permitted use."
The licence notice for a renderer host that loads no licence file, such as a build-time export: the component licence notice when no licence record is loaded. A host that runs the engine passes the notice of its latest licence evaluation instead (WorkflowLicenceSnapshot.NoticeHeadline).
Render(WorkflowRenderLayoutResult, string, string) method
public WorkflowRenderSvgDocument Render(WorkflowRenderLayoutResult layout, string title, string licenceNotice)
Renders layout as an SVG document titled title. Every diagram carries licenceNotice as visible text along its bottom edge (data-licence-notice), XML-escaped.
RenderSvg(WorkflowRenderLayoutResult, string, string) method
public string RenderSvg(WorkflowRenderLayoutResult layout, string title, string? licenceNotice)
Renders layout titled title. Every diagram carries a licence notice: licenceNotice when the host has one, otherwise the renderer’s notice for a host without a loaded licence record.
WorkflowRenderSvgServiceCollectionExtensions class
public static class WorkflowRenderSvgServiceCollectionExtensions
Registers the SVG renderer of workflow diagrams.
AddWorkflowSvgRenderer(IServiceCollection) extension method
public static IServiceCollection AddWorkflowSvgRenderer(this IServiceCollection services)
Registers WorkflowRenderSvgRendereras the host’s IWorkflowRenderSvgRenderer, which turns on the server-side SVG of the definition render graph (IncludeSvg).
