d2
d2 copied to clipboard
control padding more
e.g. a common use case is container around image. but padding makes it too big
another use case for gap-size
? (https://github.com/terrastruct/d2/issues/1738)
its not impossible.
grid-columns: 3
grid-gap: 0
c1: "" {
style.opacity: 0
grid-rows: 3
grid-gap: 0
l1: "" {
style.opacity: 0
grid-rows: 1
grid-gap: 0
a
s1: {width: 10; style.opacity: 0}
b
s2: {width: 10; style.opacity: 0}
c
}
s3: {height: 10; style.opacity: 0}
d
}
s4: {width: 10; style.opacity: 0}
e
***: {style.border-radius: 10}
its not impossible.
grid-columns: 3 grid-gap: 0 c1: "" { style.opacity: 0 grid-rows: 3 grid-gap: 0 l1: "" { style.opacity: 0 grid-rows: 1 grid-gap: 0 a s1: {width: 10; style.opacity: 0} b s2: {width: 10; style.opacity: 0} c } s3: {height: 10; style.opacity: 0} d } s4: {width: 10; style.opacity: 0} e ***: {style.border-radius: 10}
Great! Achive it by 2 steps:
- Make grid-gap: 0
- Make spacer unvisible.
cf.
z{
x->y
***{width:1; height:1}
}
>d2.exe --dagre-nodesep 0 --dagre-edgesep 0