Live data from Hacker News

The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

jessems.com

51–60 of 113 posts

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#52

I guess it’s effective because it is similar to Markdown and other lightweight stuff: things like bullet items are just written like bullet items, with hyphens (or similar). You write it how you want it to be displayed. Granted for a diagram it’s more complicated since it’s a graph and not a tree, and you write it with declarative arrows rather than as ASCII art, but perhaps that in practice strikes a nice balance be…

OP here, did not know of the existence of “The Unreasonable Effectiveness of Mathematics in the Natural Sciences”! I agree, that's a whole other level.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#53
post #15

The article claims that sequence charts are the only useful thing in UML. What about: Entity diagrams, especially for database ERD Timing diagrams (think: Gantt) Interaction/flow diagrams Use case diagrams

I'll give those another look, thanks!

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#54

I can highly recommend PlantUML as a simple language for creating sequence diagrams. It also supports other UML diagram types, which, despite what the article says, are also useful sometimes (so long as you don't worry about every last silly detail that's specified in the standard). @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice…

It does look nice, and covers most things, except for life lines. Is there a way to add life lines?

And why do so many tools choose to ignore life lines and provide incomplete sequence diagrams? Perhaps it gets really complicated to express in such a simple way as the examples do?

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#55
post #47

Maybe I'm nuts because I've never found these useful. If you actually want to model a real-world scenario, you'll end with an arrow from every system to every other system to the point that it's meaningless as a visualization.

I think you’re nuts :) I find them super helpful for refreshing when I need to see the flow for protocol exchanges like SIP, FTP, TLS.

I don’t know how else you would model that. Words don’t communicate deeply enough.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#56

I can highly recommend PlantUML as a simple language for creating sequence diagrams. It also supports other UML diagram types, which, despite what the article says, are also useful sometimes (so long as you don't worry about every last silly detail that's specified in the standard). @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice…

I would like if PlantUML would be implemented in some lighter language. JVM size and startup time is atrocious. You can easily notice latency caused by it even on modern hardware when rendering diagrams locally. In CI/CD it takes too much time to install JRE and run PlantUML. Probably, I can optimize it to some extent, but if it were implemented in another language, I wouldn't have to spend my time on it. Everything Java related is a monstrosity in size and consumed resources (CPU, RAM).

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#57

I can highly recommend PlantUML as a simple language for creating sequence diagrams. It also supports other UML diagram types, which, despite what the article says, are also useful sometimes (so long as you don't worry about every last silly detail that's specified in the standard). @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice…

+1 for Plantuml. It has a great ecosystem, but there are certainly tradeoffs vs using mermaidjs, because of their different compilation models. Mermaidjs seems to look nicer out of the box as well, but usually that's not the point for a sequence diagram.

I'd use whichever works for your ecosystem and diagram lifecycle. The syntax is similar enough that I think the diagram creation constraints are often a bigger difference.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#58

The popularity of MermaidJS makes me wonder why I cannot have that natively in Confluence.

Confluence has a mermaid js plugin [0]. This is in fact why I switched from plantuml to mermaid.

0: https://marketplace.atlassian.com/apps/1214124/mermaid-plugi...

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#59

I can highly recommend PlantUML as a simple language for creating sequence diagrams. It also supports other UML diagram types, which, despite what the article says, are also useful sometimes (so long as you don't worry about every last silly detail that's specified in the standard). @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice…

I believe PlantUML was basically the inspiration for MermaidJS. A huge advantage of MermaidJS is that it can run in the browser, though.

And if you start a markdown codeblock like

    ```mermaid
    graph TD;
      A-->B
    ```
Many things that support markdown (e.g. github, gitlab, typora, ...) will render the resulting graph.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#60
Slight aside: does anyone know how mermaid/planutml layout functionality is implemented? I'd like to do something similar (but much simpler). I have a few entities (boxes) that are part of a DAG, and I'd like to lay them out somewhat optimally.

It's not the interesting problem that I'm trying to solve so I'd love to reuse something if I can.

Post reply on HN