fix: cr, a clean spilit for temp graph
This commit is contained in:
parent
ad515e6110
commit
a3268f2fd1
2 changed files with 7 additions and 0 deletions
|
|
@ -155,6 +155,10 @@ func WithoutConstantNears(ctx context.Context, g *d2graph.Graph) (constantNearGr
|
|||
tempGraph := d2graph.NewGraph()
|
||||
tempGraph.Root.ChildrenArray = []*d2graph.Object{obj}
|
||||
tempGraph.Root.Children[obj.ID] = obj
|
||||
|
||||
for _, descendantObj := range descendantObjects {
|
||||
descendantObj.Graph = tempGraph
|
||||
}
|
||||
tempGraph.Objects = descendantObjects
|
||||
tempGraph.Edges = edges
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ func compile(ctx context.Context, g *d2graph.Graph, opts *CompileOptions) (*d2ta
|
|||
return nil, err
|
||||
}
|
||||
nearObject.Parent = g.Root
|
||||
for _, obj := range tempGraph.Objects {
|
||||
obj.Graph = g
|
||||
}
|
||||
}
|
||||
|
||||
err = d2sequence.Layout(ctx, g, coreLayout)
|
||||
|
|
|
|||
Loading…
Reference in a new issue