One slight oddity I’m noticing is that the widget renders as you would expect at runtime, but if you export a single tiddler to static HTML, the rendered output is not included. If you look at the resulting html it includes the container div, but no svg at all.
If you run dev tools, you can see that wrapper.js catches an exception (line 48) that reads:
TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
at M0 ($:/plugins/mermaid-tw5/mermaid.min.js:1226:19753)
at eval ($:/plugins/mermaid-tw5/mermaid.min.js:1229:4295)
at Array.forEach (<anonymous>)
at k3 ($:/plugins/mermaid-tw5/mermaid.min.js:1229:4017)
at Object.draw ($:/plugins/mermaid-tw5/mermaid.min.js:1230:1320)
at Object.SY [as render] ($:/plugins/mermaid-tw5/mermaid.min.js:1281:799)
at MermaidWidget.render ($:/plugins/mermaid-tw5/wrapper.js:45:31)
at Widget.renderChildren ($:/core/modules/widgets/widget.js:476:15)
at ElementWidget.render ($:/core/modules/widgets/element.js:78:7)
at Widget.renderChildren ($:/core/modules/widgets/widget.js:476:15)
Unfortunately, the minified source without a sourcemap makes it hard to trace into Mermaid itself.
If I dump the SVG into a standalone SVG tiddler and transclude it, it works. I suspect the problem lies somewhere in the rendering lifecycle, but it’s hard to be sure.