Live data from Hacker News

D2: A new declarative language to turn text into diagrams

d2-lang.com

81–90 of 130 posts

Re: D2: A new declarative language to turn text into diagrams

#81
post #4

The last question in the FAQ makes it clear that this can only be used in the context of their account-based online tool. Their free offering literally says "3 diagrams". Above this, the FAQ tries to compare their tool to Mermaid, Graphviz, PlantUML which are all open source, locally runnable, etc. Their comparison totally skips the fact that, because D2 can only be used in their service, a broad number of use cases…

Yikes. This looks like an amazing idea, but the online limitation kneecaps it.

When I want to make diagrams graphically, I use diagrams.net. when I want to make diagrams from code, I use PIC. What else do people use? PIC works pretty well, but it has its limits and it's ancient.

Re: D2: A new declarative language to turn text into diagrams

#83

A problem with semantic markup is when it doesn't do what you want, and you need to wig-wam it. Does this mean you actually wanted presentation markup? Or, since you are trying to convey meaning, does it mean that the semantics aren't rich enough to describe what you mean? In this D2 example ( https://d2-lang.com/assets/images/intro-example-a917149ff3b7... ), the diagram is nicely designed to be centered on the nexus…

before introducing anything, I'd like to see more instances where something needs to be on one side of something else, which I haven't found to be the case in software architecture diagrams.

Re: D2: A new declarative language to turn text into diagrams

#84

Does this use Stable Diffusion?

Excellent question.

Hoping the community will work more on declarative 2D diagramming methods and tools.

Is this project basically the New Mermaid? Why not go in a new direction. People want diagrams, not just networks, not just series-parallel graphs. Anyway, ML is changing everything. Can Stable Diffusion make crossings at right angles? Just wondering.

Re: D2: A new declarative language to turn text into diagrams

#85
post #80

> D2 has no diagram types. In other tools, you specify "this is a class diagram", or "this is a state diagram". One of the goals of D2's design is to have minimal syntax that you compose with. I think this can be really difficult...? I was fiddling with RDF and N-ary relationships some time ago, but the easiest way to express a complex relationship is to pre-define the whole relationship as an entity, and relate it t…

indeed, i don't know if it's a principle that can be maintained as we scale features. for example, even sequence diagrams, i'd like to just be automatically detected, e.g. if you have connections numbered in order that looks like the structure of sequence diagrams, it'll render as sequence diagram. we're testing to see if there's any blocking scenarios where inference just cannot get it right

Re: D2: A new declarative language to turn text into diagrams

#86

I've used Plantuml extensively, and still use it a bit, now and then. I don't remember ever needing or even wanting bi-directional editing. There's a lot of interesting things in terms of syntax and semantics here, but I really do not see WHY they are tackling a very hard problem on top of an already not easy one.

a low-hanging motivation: how do you choose colors for nodes?

Re: D2: A new declarative language to turn text into diagrams

#87
post #77

Earlier quoted context omitted.

How is this different/better than, say, Mermaid?

For one thing, the output looks lightyears better.

You can fully modify styles in mermaid using CSS and style attributes. You can also load it as a JS library, attach events to chart components, programmatically render charts plus way more.

Re: D2: A new declarative language to turn text into diagrams

#88

Hi all, creator of D2 here. I posted this on Reddit to get some feedback but was hoping to improve the docs and offer a playground environment before posting on HackerNews. Ah well. I wanted to clarify some things: 1. D2 will be open source and usable outside of Terrastruct. Terrastruct will remain the best interface to D2, with bidirectional updates from GUI, but we already have vscode and vim plugins ready for loca…

The syntax reminds me a bit of PIC. Is that coincidence, or intentional?

Re: D2: A new declarative language to turn text into diagrams

#89

Hi all, creator of D2 here. I posted this on Reddit to get some feedback but was hoping to improve the docs and offer a playground environment before posting on HackerNews. Ah well. I wanted to clarify some things: 1. D2 will be open source and usable outside of Terrastruct. Terrastruct will remain the best interface to D2, with bidirectional updates from GUI, but we already have vscode and vim plugins ready for loca…

The syntax reminds me a bit of PIC. Is that coincidence, or intentional?

coincidental, i actually thought i'd researched all the available options before embarking. can you share a link to an example? I found the wikipedia but haven't found what the syntax looks like

Re: D2: A new declarative language to turn text into diagrams

#90

Earlier quoted context omitted.

The syntax reminds me a bit of PIC. Is that coincidence, or intentional?

coincidental, i actually thought i'd researched all the available options before embarking. can you share a link to an example? I found the wikipedia but haven't found what the syntax looks like

Okay, maybe it's not as close as I remember it!

PIC is designed to be embedded inside of TROFF, so it's... not pretty, to say the least. It does have the -> arrow thing, and the label: value syntax, though. For as hideous as it is, it's surprisingly easy to use.

https://yingtongdiddleipo.ee.wits.ac.za/help/gpic.pdf

Post reply on HN