d2 icon indicating copy to clipboard operation
d2 copied to clipboard

The connections are stretched by the size of block that is at its level

Open pleshevskiy opened this issue 3 years ago • 5 comments

I want to use d2 as a mindmap to make it easy to structure documentation.

But I encountered a difficulty in perceiving the information that renders d2.

The connections are stretched by the size of the block that is at its level. It's the same story with blocks. It would be great if they didn't depend on other branches.

image

I expect something like the following but with description for connections

image

pleshevskiy avatar Nov 29 '22 13:11 pleshevskiy

If you make shape: none then the connection is too far from the block.

image

pleshevskiy avatar Nov 29 '22 14:11 pleshevskiy

i don't think the layout algorithms are good for mindmaps. Maybe TALA can handle it, but dagre and elk are by nature hierarchical whereas mindmaps are... idk, combination of radial and hierarchical, like it's got a specific structure. can you open a Github Discussion for a feature request on mind maps? If there's enough interest, we'll include a layout engine for it

alixander avatar Nov 29 '22 16:11 alixander

https://github.com/terrastruct/d2/discussions/261

pleshevskiy avatar Nov 29 '22 20:11 pleshevskiy

@alixander What about this?

a -> b: very long way to do something like that

image

Can we stretch connection if the description too long?

pleshevskiy avatar Nov 30 '22 11:11 pleshevskiy

This is relevant for the horizontal direction. Considering that now we can change it manually.

pleshevskiy avatar Nov 30 '22 11:11 pleshevskiy

@pleshevskiy i know it's been a while but do you still happen to have the script for that render in the original issue?

the followup label bug has been fixed: https://play.d2lang.com/?script=ggeflUIRyPdciQq6dgpJVgplqUWVCjn5eekK5YmVCiX5Cin5CsX5uaklGZl56Qo5mdmpCiUZiSVcgAAAAP__&layout=dagre

alixander avatar Dec 24 '22 21:12 alixander

@alixander Great! Thank you!

pleshevskiy avatar Dec 24 '22 21:12 pleshevskiy