TrueCommerce / MermaidJS.Blazor

A simple MermaidDiagram component for Blazor.
MIT License
24 stars 11 forks source link

Clickable nodes #10

Closed johankson closed 2 years ago

johankson commented 2 years ago

Hi!

Another question regarding making nodes clickable. I hade to tweak MermaidDiagramInterop.js to adjust the security level to make the click callback to work.

Is there another way that I'm missing? :)

function initializeGlobals() {
    window.mermaidDiagramBlazorOptions.securityLevel = "loose"; // <-- Had to add this
    console.log("initializeGlobals", window.mermaidDiagramBlazorOptions);
    function loadMermaid() {
        return new Promise((resolve) => { ...
DotJoshJohnson commented 2 years ago

You can set the security level when you call AddMermaidJS() on your service collection. See the demo project for an example.

johankson commented 2 years ago

Excellent! Makes a lot more sense than my fix!