Live data from Hacker News

The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

jessems.com

81–90 of 113 posts

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#81

I prefer D2 lang over MermaidJS for diagrams because the diagrams just "look" better and you have more ability to customise the look. And after all if the purpose is visualisation the visual matter. (Shameless plug: Intro to D2 https://victorbjorklund.com/build-diagrams-as-code-with-d2-d... )

https://play.d2lang.com/?script=qlDQtVOo5AIEAAD__w%3D%3D&ske...

I was going to ask why you don't have a web version but you already do. I'm going to play with this more today.

Have you thought about an "auto compile"/live mode where it changes as you edit the text? I think this adds a level of intuitiveness that would help new users explore.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#82

Earlier quoted context omitted.

D2 lang ( https://d2lang.com ) can do that. My guide: https://victorbjorklund.com/build-diagrams-as-code-with-d2-d...

Curious if anyone has experience with large diagrams (100K+ elements) using D2 or something similar?

I've had a lot of luck with Graphviz and ridiculous numbers of nodes. Have you tried that?

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#84
post #32

Earlier quoted context omitted.

Does it do it without needing to have npm and puppeteer installed at all?

I'm one of the maintainers of the mermaid-cli project, and unfortunately, no. Mermaid needs a browser's layout engine to run properly [1], but I haven't yet seen a library that will help us without puppeteer. And yep, NPM (or another Node.JS package manager) is still needed for installation. I was working on trying to bundle all of mermaid-cli's dependencies (aka Node.JS, puppeteer) into one massive single-file exe l…

Why is it so difficult to do the layout yourself and generate SVG directly?

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#85

Earlier quoted context omitted.

Curious if anyone has experience with large diagrams (100K+ elements) using D2 or something similar?

I've had a lot of luck with Graphviz and ridiculous numbers of nodes. Have you tried that?

A little bit, I'm just not a fan of the way it looks.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#86
post #69

I've used MermaidJS to create sequence diagrams for the project I'm working on and it helped tremendously in discovering what a heap of steaming manure I wrought.

Likewise. I also really like being able to quickly diff diagram versions to quickly see what is new since the last version.

That’s been so convenient to me, I now strongly prefer mermaidjs over more featured tools like lucid or Visio or draw.io.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#87

Earlier quoted context omitted.

I've had a lot of luck with Graphviz and ridiculous numbers of nodes. Have you tried that?

A little bit, I'm just not a fan of the way it looks.

That's a perfectly fair issue. Mermaid and friends are soooo much prettier.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#88
post #18

I really like using Mermaid to create state diagrams. I'd been looking for a tool like it for quite some time, and I think it slipped under my radar because it's more focused on sequence / flow diagrams and doesn't hype its state diagram capabilities as much. Using a text-based tool for this is so much better than my previous workflow of Visio or Powerpoint.

Last time I tried this it unnecessarily crossed a lot of the arrows between states. Turned a diagram of a moderately complex real world SM into an incomprehensible tangle even to developers familiar with the actual implementation. Does it still do that?

I haven't run into that, but maybe that's just because I haven't tried anything too complex yet.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#89
I've had a good time with sequence diagrams in college. It is really pleasing to build them.

I entertain the idea that AI [CNN + TNN] can finally fulfill the ultimate UML promise: build code from diagrams. In a certain way, it's easy to see AI trained to ingest diagrams as logical sequences of prompts. With a little effort it is already doable with current tech.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#90
post #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.

A fine example of a meme spreading untethered from its source.

Can I ask why you chose that title template?

Post reply on HN