Hacker News new | ask | show | jobs
by fzeindl 300 days ago
1. how does this add value over mermaid? I like how it looks and works, but is there any real reason to switch over.

2. in my opinion, what all these tools are missing is the ability to add a manual „corrective“ layer, meaning to be able to adjust the automatically created output by moving and resizing boxes by a certain x/y amount.

5 comments

1. It depends on what you value =). For some, those 2 you mentioned are enough. For others, it can be something like the our CLI doesn't require a chromium browser to render SVGs (https://news.ycombinator.com/item?id=31275754). It doesn't cover every difference, but we made a little comparison site if it helps: https://text-to-diagram.com

2. I'm not trying to advertise our paid product in this post about the open source product, but since you mentioned it, we make an IDE that adds the ability to lock in positions and dimensions: https://docs.terrastruct.com/tour/freehand

By the way, it looks like the MermaidJS implementation of the WiiU example is broken due to subgraphs not creating namespaces. That is, the `rom` node in the `amd` subgraph is overwriting the one in the `ibm` subgraph.
> how does this add value over mermaid?

As a longtime Mermaid user that just started trying out D2 recently:

* D2's syntax is much less cumbersome to write and, from the features provided, I would expect maintain because of better abstractions.

* While D2 supports fewer canned diagram types out-of-the-box (a big advantage for Mermaid), D2 has better composition support (via layers and scenarios, particularly) than Mermaid, which is a killer feature for lots of use cases. If I need a Sankey diagram, obviously, Mermaid wins; if I want to do a leveled DFD, while I could in theory use either, D2 is much better.

* D2 has more freedom for mixing elements, because instead of being oriented around diagram types, it uses some special shapes within what amounts to a single universal diagram type ("sequence diagrams" work a bit like a diagram type, but the diagram itself is a shape that can be used like other shapes, and tables [as used in ERDs] and classes [as used in UML class diagrams] are also just shapes, not a construct available in particular diagram types.)

> in my opinion, what all these tools are missing is the ability to add a manual „corrective“ layer, meaning to be able to adjust the automatically created output by moving and resizing boxes by a certain x/y amount.

Technically, I think you can do that in Mermaid (by attaching CSS classes to the nodes that do the actual nudging) if you really want to.

> 2. in my opinion, what all these tools are missing is the ability to add a manual „corrective“ layer, meaning to be able to adjust the automatically created output by moving and resizing boxes by a certain x/y amount.

Something like Struturizr? https://structurizr.com/

It's a diagramming tool

> I like how it looks and works

Those are "real reasons".

I like that it seems to support inline latex formulas, which seems like a great feature