Live data from Hacker News

Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

github.com

101–110 of 110 posts

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#102
post #60

Earlier quoted context omitted.

Documentation is a tool for creating shared understanding. If you don’t need to share your understanding, don’t write docs. Note however that sharing understanding works on the people axis and on the time axis. Docs allow you to share your current understanding with your future self. They’d better be general enough to be true then, though. Nowadays I find Gemini pro to be able to accurately document a complex workflo…

I write and read lots of documentation. Diagrams are not a common feature of that.

I'd rather have a single concept diagram than a thousand words of docs. To each their own I guess.

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#103

Earlier quoted context omitted.

If it's sqlite compatible, then there a many solutions. In general it's trickier. plug: https://github.com/dgoffredo/sqliteviz Not web based, though.

This is based on graphviz, and with the available layout algorithms, any schema with more than 5 tables and a few foreign key relation becomes a jumbled, unreadable mess.

Here's one with 16 tables: https://raw.githubusercontent.com/dgoffredo/sqliteviz/refs/h...>.

Not the prettiest, but workable.

I wouldn't try it on 100 tables.

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#104

I use Mermaid in my app[0] to generate books story relationships. [0] https://github.com/herol3oy/austen

Your app looks interesting. Am curious about how is AI being used. Assuming that to discover character relationships, how is that done? Thanks.

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#105

All I really want is something that can diagram out 30+ microservices and interconnections without getting ugly. graphviz does okay, but I kinda want some extra levels of grouping to keep services in the same k8s namespace close together.

Are clusters not enough? They can be nested. https://graphviz.org/Gallery/directed/cluster.html https://github.com/ReneNyffenegger/about-Graphviz/blob/maste...

Hmm. I thought I'd tried that but perhaps I didnt' read the documentation close enough. Even after reading your reply it took me about 20 minutes to realize the subgraph has to have a name prefix of "cluster." And after more digging I see now that cluster=true will do it as well.

It's not exactly what I was hoping for, but is an improvement on the randomization I had going on before!

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#106
post #24

Earlier quoted context omitted.

Obsidian also supports inline mermaid charts in markdown code blocks. One of those features I don't see mentioned much.

LLMs (I use ChatGPT) can take a generic process description, spit out the result in mermaid, which can then be imported and refined in something like draw.io. Yes, you’ll have to correct a few things by hand, but it drastically speeds things up. Last time I check draw.io is supported in obsidian.

I recently tried this, but the import to draw.io did not go well. It imported as a single static image rather an editable diagram. Maybe I did something wrong?

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#107
post #86

Earlier quoted context omitted.

They were working on a wasm version some time ago I believe [0]. Not sure how usable this is insofar, but it may be of interest. [0]: https://github.com/terrastruct/d2/pull/436/files

https://play.d2lang.com/ loads https://play.d2lang.com/d2.wasm so presumably "all done"

I have the impression this is still using api.d2lang.com/render/svg as the primary source for its renders. So to me it seems that - although wasm is being loaded/used - this is maybe more for client-side processing steps, rather than the full rendering being done in wasm.

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#108

Earlier quoted context omitted.

Are clusters not enough? They can be nested. https://graphviz.org/Gallery/directed/cluster.html https://github.com/ReneNyffenegger/about-Graphviz/blob/maste...

Hmm. I thought I'd tried that but perhaps I didnt' read the documentation close enough. Even after reading your reply it took me about 20 minutes to realize the subgraph has to have a name prefix of "cluster." And after more digging I see now that cluster=true will do it as well. It's not exactly what I was hoping for, but is an improvement on the randomization I had going on before!

IIRC, you have the have the cluster prefix and cluster=true to make it work. I also found clusters to be quite tricky to work with (especially when you have an arrow between a regular node and cluster node).

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#109

Earlier quoted context omitted.

Hmm. I thought I'd tried that but perhaps I didnt' read the documentation close enough. Even after reading your reply it took me about 20 minutes to realize the subgraph has to have a name prefix of "cluster." And after more digging I see now that cluster=true will do it as well. It's not exactly what I was hoping for, but is an improvement on the randomization I had going on before!

IIRC, you have the have the cluster prefix and cluster=true to make it work. I also found clusters to be quite tricky to work with (especially when you have an arrow between a regular node and cluster node).

I seem to be getting by with just the prefix ^_^

Fortunately, I don't intend to add arrows into clusters, I just want stuff in the same k8s namespace to be near each other.

Re: Mermaid: Generation of diagrams like flowcharts or sequence diagrams from text

#110

Earlier quoted context omitted.

LLMs (I use ChatGPT) can take a generic process description, spit out the result in mermaid, which can then be imported and refined in something like draw.io. Yes, you’ll have to correct a few things by hand, but it drastically speeds things up. Last time I check draw.io is supported in obsidian.

I recently tried this, but the import to draw.io did not go well. It imported as a single static image rather an editable diagram. Maybe I did something wrong?

Usually in such cases either copy and paste the error message from draw.io, or screenshot it and upload to chatGPT. It will debug it for you.

There’s also a specific sequence of steps to import mermaid scripts, I don’t remember the menu location by heart, ChatGPT can also give you the steps needed to do this.

Post reply on HN