I know that Polyglot notebooks support Mermaid diagrams. But it doesn't support veriable sharing. Suppose I have diagram code in C# string variable. Are there any possibility to display that string as diagram?
Example:
// below diagram code was generated via some method
var mermaidCode = """
flowchart TD
A --> B
""";
// here I would like to display mermaidCode as diagram
mermaidCode
Its litle late, but you can do this.
1 - generate a "mermaid" cell with
using Microsoft.DotNet.Interactive;
using Microsoft.DotNet.Interactive.Commands;
await Kernel.Root.SendAsync(new SendEditableCode("mermaid", <yourMarkdown>));
2 - run the new generated cell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With