by alixanderwang · 4y ago · 0 comments
We also put up a site for you to compare D2 with MermaidJS, Graphviz, and PlantUML: https://text-to-diagram.com.
Full disclosure, we're a for-profit company. The open-core part is that we make an alternative layout engine which we sell (Jetbrains model, i.e. your copy is your's forever if you've paid for 12+ months). It's not packaged with D2, so you won't see it if you don't want it. D2 is perfectly usable without it, and integrates with multiple free open source layout engines (e.g. the one that Mermaid uses, "dagre", is D2's default). If you want to read more about our plans for D2: https://d2lang.com/tour/future.
Hope you can check it out! It's got an easy install (and uninstall) process.
I really like the comparison site that you have created - it's great for learning these languages. I would love to see a plugin for Obsidian for the times where I need to add a custom drawing to my notes. It looks like there already are plugins for PlantUML[1] and graphviz[2] today.
(created a Github Discussion to track. https://github.com/terrastruct/d2/discussions/138 . if there's enough demand, we'll do it ourselves)
edit: guessing URL found https://d2lang.com/tour/intro/ which covers it, perhaps worth linking to there from the GitHub page
edit2: ok it is linked, just above the section I was looking at:
Reference
A more formal reference specification is in the works.
Any examples of larger diagrams (1000+s of nodes) and how does that perform in layout?
In my experience graphviz handles up to thousands of nodes and tens of thousands of edges without really breaking a sweat.
edit: I've done the same thing with extracting AWS diagrams from aws describe* calls, with good results.
I also love graphviz but had a project to create an app for legible quality management, and it was a headache to shoehorn some concepts into "nodes in an edge connected graph" way of thinking (ended up programatically scripting LaTeX).
With so many visualisation concepts there's room for niche approaches (same in plotting; Matlab/Octave vs Gnuplot vs Pyplot vs R and so on)
It's an ~100 node DAG. Graphviz struggles a bit with it, particularly with edge layout.
(Though really, the layout I want for it is a Gnatt chart style layout.)
[1] https://www.rw.cdl.uni-saarland.de/people/sander/private/htm...
Then there's generally the problem of larger graphs, which tend to devolve into a tangled mess and hairballs, simply because they often tend to be well-connected. If there's no way of pruning them beforehand, or perhaps grouping, aggregating or clustering (in a way that makes sense to the viewer, not necessarily only structurally), then it can be hard to get good result.
As an example your tree is laid or left-to-right. The GraphViz one in comparison is top down. It’s not clear to me as a user if that’s forced or a choice (in either case).
Are you able to clarify that sort of difference by either making the diagrams similarly laid out or adding a note if something isn’t possible?
The comparison website is neat. I don't like to draw the architectural diagrams which graphical tools for my Open-source projects, I'll try D2 for my next project.
The project looks to be deprecated: https://github.com/dagrejs/dagre
The folks at ELK are doing fantastic work in public as an academic team out of Germany.
https://www.eclipse.org/elk/documentation/algorithmdeveloper... https://www.rtsys.informatik.uni-kiel.de/en/team/soren-domro...
Graphviz's papers are also must-reads (for hierarchical layouts): https://graphviz.org/theory/
In general they are surprisingly readable even without an academic background. Sometimes they go into proofs of correctness like method X really results in minimal edge crossings, and those are gnarly math, but skippable. The bad part is that a lot of these research papers have code that's just broken or wrong, or is NP-hard.
Can't wait for an Obsidian plugin! :D