Readit News logoReadit News
alixanderwang · 3 years ago
hi HN, I'm Alex, my team and I made D2.

The biggest new thing since last time D2 was here is that we now have a playground for folks to easily check it out without installing: https://play.d2lang.com.

Also just to preface the top discussion points that arise when D2 is shared:

> "What's the difference between this and--"

https://text-to-diagram.com. We made it. The maintainers of Mermaid themselves have contributed to it.

> "The name!"

I like this guy's reply: https://news.ycombinator.com/item?id=33704960

> Is there a proprietary aspect?

Yes, we're a for-profit company. D2 is 100% FOSS, and 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 a separate install, 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).

oftenwrong · 3 years ago
The license for the proprietary layout engine (TALA), was quoted to me as US$240 for 12 months of updates. For comparison, a personal license for IntelliJ IDEA Ultimate is US$169 (for the first year; less for subsequent years). As an active user and proponent of text-to-diagram tools, and as someone who isn't shy about paying for software (including my personal IntelliJ IDEA Ultimate license), I'm keen on buying a better layout engine, but IMO this price-point is a bit much.
Yahivin · 3 years ago
If it saves you at least 15 minutes a month then it sounds like a bargain.
ranting-moth · 3 years ago
Looks nice!

I have an improvement suggestion for the playground: have some pre-defined examples I can open from a menu and mess around with.

sendfoods · 3 years ago
Congrats on the release! I gave it a spin before the launch of the playground, and really liked it

Did I understand correctly that, in order to use custom fonts, one has to recompile the code with appropriate .tff files? It's shortly mentioned [1].

[1] https://github.com/terrastruct/d2/tree/master/d2renderers/d2...

alixanderwang · 3 years ago
Thanks! We actually released a couple weeks ago, and since then it's been almost 100% fixing/improving things the community's surfaced. Long list of stuff here: https://github.com/terrastruct/d2/releases.

Re fonts: that README is for contributing fonts. I'm not sure what the best solution is for custom fonts -- whether to just specify the name of a system font, a google font, point to a directory of local TTFs. Some discussion going on here: https://github.com/terrastruct/d2/discussions/132

Mikhail_K · 3 years ago
I feel it is misleading to call d2 "an open-source alternative", when it is developed to support proprietary rendering engine, the diagram examples given in documentation were rendered by that engine and the reason given is that the free alternative is inferiour.
alixanderwang · 3 years ago
It's completely open source. The majority of users are using it with other layout engines. We put in work to make those look good and fix bugs around the integrations with those layout engines. The proprietary layout engine is a completely separate install. I also preface it in every post I do for D2 (https://news.ycombinator.com/item?id=33704381). There's nothing misleading.
adontz · 3 years ago
alixanderwang · 3 years ago
porker · 3 years ago
Where's the pricing for your layout engine TALA? I detest the results from dagre so interested in this.

I followed the submission link but found no details of pricing on that site.

alixanderwang · 3 years ago
https://github.com/terrastruct/TALA

(apologies for this hidden path. trying to strike the balance of making it findable for those who search for it while hidden to those who just want free.)

maeln · 3 years ago
PlantUML is also open-source. The title make it look as if it is not.
froh · 3 years ago
The PlantUML license is slightly chaotic though, it's provided under several licenses, and each bundle has subtle differences in behavior which are not spelled out.

https://plantuml.com/download

Deleted Comment

Zardoz84 · 3 years ago
Seriously, no body do a little research before naming his public projects to see if some other public project had the same name that are you about to use ?

I'm talking about that D , aka D2, aka DLang has been using this name for a lot of years. This would create a lot of awful confusion!

byteware · 3 years ago
is D2 another name for the D language? there is also a D3 project
pjmlp · 3 years ago
Yes D2 is what current D version used to be called when D1 was still around, about 10 years ago.

D3 is the mythical version that would fix all D shortcomings, keeps being talked about when we have those long community rants, but that is about it, there is no project going on.

samuell · 3 years ago
Nice! I like the default aesthetics!

Btw, is there a succinct comparison to GraphViz?

GraphViz is perheps a little tedious to write, and takes some work to make look good (which makes me appreciate the D2 style), but is also definitely possible in my experience.

E.g. SciPipe (https://scipipe.org) outputs pipeline diagrams in this style:

https://www.researchgate.net/profile/Samuel-Lampa/publicatio...

justusw · 3 years ago
I think one advantage in GraphViz is the ability to output EPS. I use this often for embedding into PDF via XeLaTeX and Pandoc filters. I also saw that D2 offers some kind of LaTeX output, but was not able to dig into the docs there further.
alixanderwang · 3 years ago
Yeah it's just Mathjax equations. E.g. https://play.d2lang.com/?script=PNCxCsJADIfxPU_xH1uk4NzBJwlI...

I'm not familiar with EPS. Will investigate, ty. https://github.com/terrastruct/d2/issues/489

taink · 3 years ago
Here's a website with a list of comparisons made by them: https://text-to-diagram.com/

GraphViz is included.

samuell · 3 years ago
This is great, thanks!
nine_k · 3 years ago
I suppose converting SVG to EPS should be relatively straightforward; some converters exist.
smusamashah · 3 years ago
I have a list of more tools like this here https://xosh.org/text-to-diagram/
alixanderwang · 3 years ago
We link to this in the README for text-to-diagram.com, and it was a starting point for us when we were researching what's out there when designing D2. Thank you for maintaining this.
genezeta · 3 years ago
Nice list. Thanks :)

The URL for PlantText returns a 404. You might want to update that to just planttext.com

wongarsu · 3 years ago
So far, for our diagraming needs we've used MermaidJS, embedded as code blocks into our Markdown documentation (github and mdbook for us, but support is pretty wide).

D2 seems like a nice upgrade:

- it has an even more intuitive syntax (which is really important for something used on-and-off by any individual developer).

- it seems to have better graph routing

However there are two things keeping us from trying it:

- not supported in our tools, most notably no mdbook plugin yet. I imagine this will change over time

- readability: node labels are tiny compared to nodes, meaning you have to zoom in much more and lose view of the larger structure

alixanderwang · 3 years ago
thank you!

Re support: yeah it's a long queue we're making our way through. We have VSCode, Vim, Obsidian, about to roll out Slack, Discord, working on Github, etc. Somewhere down the line, mdbook will be on the chopping block. (community has also contributed plugins for TreeSitter and Emacs)

Re node labels. Yeah this has come up a few times now. We'll have something that addresses it in the next release. For now, you can change font-size:

https://play.d2lang.com/?script=cspPUtC1U3DMyUxOtVKo5lJQAPvX...

darkteflon · 3 years ago
Hi there, I’ve been following the Obsidian plugin development and noticed that it appears to be done but not yet listed in the Community Plugins? Is it likely to be available soon, do you know?
alixanderwang · 3 years ago
looks like someone saw this and made an mdbooks plugin: https://github.com/danieleades/mdbook-d2
lf-non · 3 years ago
I don't have anything against the text to diagram tools, however as someone who has to create/tweak diagrams only 2-3 times in a month, I always find myself forgetting the syntax and needing to refer the docs for these utils.

I have since settled on just using excalidraw, with the vscode plugin it is easy to save/version the diagrams alongside my projects and embed them as ordinary image files in docs.

alixanderwang · 3 years ago
same. even I refer to our docs sometimes. This helps: https://d2lang.com/tour/cheat-sheet
mcqueenjordan · 3 years ago
This is great, we need more tools like this -- diagrams that can be version controlled, iterated/edited on alongside the code, etc. I think there's so much room for innovation in the area of declarative diagramming.
tragomaskhalos · 3 years ago
I am working on a project where all documentation is in markdown and plantuml for precisely these reasons, and honestly I'm surprised at how seamless the transition has been from the usual world of Word docs plus ad-hoc diagramming tools (cough PowerPoint cough). Easy diffability is another big benefit.