This commit is contained in:
Alexander Wang 2023-02-14 11:34:18 -08:00
parent 33c9de569f
commit ffea3c9ab2
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
6 changed files with 3316 additions and 1 deletions

View file

@ -350,7 +350,8 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
return true
}
// Edge should only move if it's not connected to the bottom side of the shrinking container
return p.Y != obj.TopLeft.Y+obj.Height
// Give some margin for error
return !(obj.TopLeft.Y+obj.Height-1 <= p.Y && obj.TopLeft.Y+obj.Height+1 >= p.Y && p.X != obj.TopLeft.X && p.X != (obj.TopLeft.X+obj.Width))
}
for _, e := range g.Edges {
if _, ok := movedEdges[e]; ok {

View file

@ -489,6 +489,32 @@ group: {
}
&foo
&&bar
`,
},
{
name: "dagre-disconnect",
script: `a: {
k.t -> f.i
f.g -> _.s.n
}
k
k.s <-> u.o
h.m.s -> a.f.g
a.f.j -> u.s.j
u: {
c -> _.s.z.c
}
s: {
n: {
style.stroke: red
f
}
}
s.n -> y.r: {style.stroke-width: 2; style.stroke: red}
y.r -> a.g.i: 1\n2\n3\n4
`,
},
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 802 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 801 KiB