d2
d2 copied to clipboard
can I set all node label in the bottom?
I have tested d2 with my figures, and I am confused I can not control the node label position (specially for shape: image).
In d2 output, label set in bottom / right side and top which follows the layout strategy automatically.
Can we have any possible to force all label in the top or in the bottom to confirm consistence for some figures?
the official case is just a good example
are you using dagre/elk layout engines? If so, there's a ticket to track automatic layout placement so you won't need to specify. https://github.com/terrastruct/d2/issues/203
@alixander thanks for your replay. The automatic layout is a good feature in d2, and future related features must be exciting.
But my core question is how to set alll icon labels on the same side (aka. shape:image icon: xxx with label).
In most cases (maybe for myself only), the general node label can be free, but the icon only node must have a consistent label position (usually, just bellow the icon).
you could see the image in issue -
twitter iconlabeled on theleft, andservice iconlabeld on thetop.
ah i see. in that case, this is indeed a different issue.
i'd be curious to know if this is generally desirable. E.g. if you had arrows coming into icon x from the bottom, wouldn't you want that icon's label to be positioned at the top?
ah i see. in that case, this is indeed a different issue.
i'd be curious to know if this is generally desirable. E.g. if you had arrows coming into icon x from the bottom, wouldn't you want that icon's label to be positioned at the top?
in my case, the answer is no.
no mater which node slot linked by an edge, the icon only node always has a label on the bottom.
I think my issue may not general enough, and I want to do some discuss if possible.
In fact, I have collected a group of figures as ref in my daily work , and many of them use the style as I say, so I feel strage when the icon label place in different sides (especially in one figure).
