Optional MSAGL-based layout engine for Mermaider. Provides higher-fidelity graph layout using Microsoft Automatic Graph Layout at the cost of higher allocations.
$ dotnet add package Mermaider.Layout.MsaglOptional Microsoft MSAGL layout provider for Mermaider.
Mermaider ships with a fast, zero-dependency Sugiyama layout engine by default. This package provides an alternative backed by Microsoft's Automatic Graph Layout library, which may produce higher-fidelity edge routing on very complex graphs at the cost of significantly higher allocations (~70x) and latency (~120x).
dotnet add package Mermaider.Layout.Msagl
using Mermaider;
using Mermaider.Layout.Msagl;
// Register globally:
MermaidRenderer.SetLayoutProvider(new MsaglLayoutProvider());
// Or per-call:
var svg = MermaidRenderer.RenderSvg(input, new RenderOptions
{
LayoutProvider = new MsaglLayoutProvider(),
});
For most use cases, the built-in layout engine is recommended.