terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
17.13k stars 422 forks source link

Question: replacing PlantUML with D2, limitations? #703

Closed rogeralsing closed 1 year ago

rogeralsing commented 1 year ago

I am building a tool for OpenTelemetry observability. I'm using PlantUML to visualize trace data. There are however some pretty bad limitations there, e.g. PlantUML cannot handle large sequence diagrams. And for component diagrams, the lines/arrows often look strange.

D2 looks like a very nice alternative, so I thought I'd ask before I start building anything. Are there any limitations in the size of the diagrams for D2? and maybe someone can give a hint if it would be possible to generate diagrams similar to the ones attached here?:

Skärmavbild 2023-01-21 kl  13 51 28 Skärmavbild 2023-01-21 kl  13 51 38
MariusAlbrecht commented 1 year ago

the component diagram should be quite easy: Take a look e.g. at my try to replicate your screenshot in the playground here image dark themes and more options in terms of theming should also come quite soon

with the sequence diagram I'm not sure. I dont really use them so I cant give you an opinion there

alixander commented 1 year ago

Are there any limitations in the size of the diagrams for D2?

for general D2 diagrams. it's not tested past the hundreds of nodes, so it depends on what you mean by large. dagre and elk should be able to handle it though (layout engines).

With sequence diagrams, it's rule based instead of search, so that has no limitations on size and will run fast. We're tuning the padding/font-sizes to make it more legible for this next release.

could you give an example of where plantuml gave you a suboptimal result? and then I can help replicate in D2 and see if it gives better.