Live data from Hacker News

Show HN: Line9 – A Mermaid rendering engine with its own layout

line9.ai

11–20 of 41 posts

Re: Show HN: Line9 – A Mermaid rendering engine with its own layout

#12

This solves my biggest gripe with Mermaid. It's an amazing tool, but I wish it were open source.

Is this not open source enough for your purposes?

https://github.com/mermaid-js/mermaid https://github.com/mermaid-js/mermaid-live-editor https://github.com/mermaid-js/mermaid-cli

OP's product is not open source btw

Re: Show HN: Line9 – A Mermaid rendering engine with its own layout

#13
post #8

FYI for any new or casual Mermaid users, it comes with a built-in alternate layout called `elk` that I find does a much cleaner job on complex flowcharts. See docs here: https://mermaid.ai/open-source/config/layouts.html

I'm trying some of the diagrams in elk and it seems to break the logical flow.

You can try it with Line9's first chart: https://mermaid.ai/live/edit#pako:eNpVVEtv2zAM_iuCTilgB1mbxq...

While it's nice and compact, it actually is rougher to grep.

Re: Show HN: Line9 – A Mermaid rendering engine with its own layout

#14

This solves my biggest gripe with Mermaid. It's an amazing tool, but I wish it were open source.

I’ve switched to D2 from mermaid after they removed ELK from the base. Dagre just doesn’t work for me. I wish there were better options.

Re: Show HN: Line9 – A Mermaid rendering engine with its own layout

#20
post #6

Graph layout is a very interesting, very hard problem. There's even a yearly competition - started in 1994 - whose results are announced at the yearly Symposium on Graph Drawing and Network Visualization. It's not a subject I'm versed in, but can you talk more about your solution? Do you use a larger constraint solver or is it hand-coded? -- Competition: https://mozart.diei.unipg.it/gdcontest/ The 34th International…

Neither, really — it's closer to hand-rolled local search.

My first three phases are based on Sugiyama to produce a seed layout (which is broadly what Dagre does). Then I've added my new phases driven by a penalty score that grades candidate layouts using fourteen factors that I devised from my experience laying out graphs manually. The refinement phase is where the bulk of my work is. It applies targeted move types iteratively within a budget, trying to lower the penalty score.

Finally, the result goes through my own embedding and rendering with the theme system on top.

Post reply on HN