3 ms·
Like Markdown, Mermaid could use a universal way to add some things to nodes. In sequence diagrams there seems to be no way to add classes to nodes. https://dev
by benatkin 4y ago
Like Markdown, Mermaid could use a universal way to add some things to nodes. In sequence diagrams there seems to be no way to add classes to nodes. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/class https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/c...
- alexisread 4y agoIs this what you're looking for? https://mermaid.js.org/syntax/sequenceDiagram.html https://mermaid.js.org/syntax/sequenceDiagram.html Works fine in VSCode, with the markdown preview mermaid support extension.
- benatkin 4y agoThat's just a link to the page about sequence diagrams. I know about sequence diagrams - what I don't know how to do is to add a class to a node on there.
- alexisread 4y agoSorry that should have been https://mermaid.js.org/syntax/sequenceDiagram.html#classes-used https://mermaid.js.org/syntax/sequenceDiagram.html#classes-u... The section where you can add styling by using css classes.
- benatkin 4y agoNo, that's not what I'm talking about at all. I'm talking about adding a custom css class to a particular node so I can attach behaviors to it with JavaScript.
- alexisread 4y agoAh I see, I guess you're going to be generating the mermaid diagrams? Depending upon how heavyweight you want to go, something like https://www.npmjs.com/package/vue-mermaid https://www.npmjs.com/package/vue-mermaid can work. I've not looked at how it attaches the behavior to the node, there is a way to do it though.