Home

Can not Render MermaidJS on Result panel

I'm use FluentMermaid Library to generate mermaid syntax but can not render on result panel

http://share.linqpad.net/6d6x9h.linq

var chart = FlowChart.Create(Orientation.TopToBottom);
var cat = chart.TextNode("Cat", Shape.Circle);
var dog = chart.TextNode("Dog", Shape.Trapezoid);
chart.Link(cat, dog, Link.Open, "hates");
string mermaidSyntax = chart.Render();
Util.HtmlHead.AddScriptFromUri("https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js");
new renderMermaid(mermaidSyntax).Dump("Render Mermaid");

class renderMermaid : Control
{
public renderMermaid(string vstr) : base("div")
{
HtmlElement.InnerHtml = vstr;
CssClass = "mermaid";
}
protected override void OnRendering(EventArgs e)
{
base.OnRendering(e);
}
}

When Export as HTML file output is render

Sign In or Register to comment.