cleanup
This commit is contained in:
parent
d651c3eb63
commit
f4b153d059
2 changed files with 4 additions and 3 deletions
|
|
@ -123,7 +123,5 @@ func (gd *gridDiagram) cleanup(obj *d2graph.Object, graph *d2graph.Graph) {
|
||||||
restore(obj, child)
|
restore(obj, child)
|
||||||
child.IterDescendants(restore)
|
child.IterDescendants(restore)
|
||||||
}
|
}
|
||||||
for _, e := range gd.edges {
|
graph.Edges = append(graph.Edges, gd.edges...)
|
||||||
graph.Edges = append(graph.Edges, e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,9 @@ func withoutGridDiagrams(ctx context.Context, g *d2graph.Graph, layout d2graph.L
|
||||||
sort.SliceStable(obj.ChildrenArray, func(i, j int) bool {
|
sort.SliceStable(obj.ChildrenArray, func(i, j int) bool {
|
||||||
return objectOrder[obj.ChildrenArray[i].AbsID()] < objectOrder[obj.ChildrenArray[j].AbsID()]
|
return objectOrder[obj.ChildrenArray[i].AbsID()] < objectOrder[obj.ChildrenArray[j].AbsID()]
|
||||||
})
|
})
|
||||||
|
sort.SliceStable(g.Edges, func(i, j int) bool {
|
||||||
|
return edgeOrder[g.Edges[i].AbsID()] < edgeOrder[g.Edges[j].AbsID()]
|
||||||
|
})
|
||||||
|
|
||||||
for _, o := range tempGraph.Objects {
|
for _, o := range tempGraph.Objects {
|
||||||
toRemove[o] = struct{}{}
|
toRemove[o] = struct{}{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue