d2 icon indicating copy to clipboard operation
d2 copied to clipboard

Add padding around edge labels

Open i-am-the-slime opened this issue 1 year ago • 3 comments

In #2030 there's an example of a somewhat good-looking diagram. It has padding around edge labels. The same goes for #920 . The current padding is so tight, that with certain fonts and settings (#1099) the text becomes unreadable. I was hoping that as a workaround it'd be possible to just prefix and suffix the labels with a space character but that also doesn't work.

Rather, the opposite is true as can be witnessed in this example:

image

i-am-the-slime avatar Sep 15 '24 12:09 i-am-the-slime

Okay, this is so annoying, are there any pointers on how to fix this, with some initial guidance, I'd take a step.

i-am-the-slime avatar Mar 10 '25 08:03 i-am-the-slime

D2 should add line-height amount of padding horizontally so that the vertical and horizontal padding are equal. Thanks for filing.

alixander avatar Mar 10 '25 15:03 alixander

Hmm, I was hoping for configurable padding for aesthetic reasons.

i-am-the-slime avatar Aug 08 '25 12:08 i-am-the-slime