d2 icon indicating copy to clipboard operation
d2 copied to clipboard

control padding more

Open alixander opened this issue 1 year ago • 5 comments

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)

alixander avatar Nov 21 '23 06:11 alixander

Screen Shot 2023-11-23 at 8 22 20 AM

alixander avatar Nov 23 '23 16:11 alixander

Screenshot 2024-01-31 at 8 14 15 PM

alixander avatar Feb 01 '24 04:02 alixander

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}

bo-ku-ra avatar Feb 02 '24 13:02 bo-ku-ra

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:

  1. Make grid-gap: 0
  2. Make spacer unvisible. image

Jasper-Li avatar Feb 03 '24 10:02 Jasper-Li

Screen Shot 2023-11-23 at 8 22 20 AM

cf.

z{
x->y
***{width:1; height:1}
}

>d2.exe --dagre-nodesep 0 --dagre-edgesep 0 image

bo-ku-ra avatar Feb 03 '24 14:02 bo-ku-ra