elk: don't grow node if there is a width/height input
This commit is contained in:
parent
ca754aefdc
commit
9ab1971d54
1 changed files with 17 additions and 15 deletions
|
|
@ -202,6 +202,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
|
||||||
}
|
}
|
||||||
|
|
||||||
walk(g.Root, nil, func(obj, parent *d2graph.Object) {
|
walk(g.Root, nil, func(obj, parent *d2graph.Object) {
|
||||||
|
if obj.Attributes.WidthAttr == nil || obj.Attributes.HeightAttr == nil {
|
||||||
incoming := 0.
|
incoming := 0.
|
||||||
outgoing := 0.
|
outgoing := 0.
|
||||||
for _, e := range g.Edges {
|
for _, e := range g.Edges {
|
||||||
|
|
@ -220,6 +221,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
|
||||||
obj.Width = math.Max(obj.Width, math.Max(incoming, outgoing)*port_spacing)
|
obj.Width = math.Max(obj.Width, math.Max(incoming, outgoing)*port_spacing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
width, height := adjustDimensions(obj)
|
width, height := adjustDimensions(obj)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue