From f3b7453c8a06ab15a945f5f9a19a4602627537dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Fri, 25 Nov 2022 22:41:11 -0800 Subject: [PATCH] Add comment to addLifelineEdges --- d2layouts/d2sequence/layout.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/d2layouts/d2sequence/layout.go b/d2layouts/d2sequence/layout.go index 2c182d3fe..606ab8302 100644 --- a/d2layouts/d2sequence/layout.go +++ b/d2layouts/d2sequence/layout.go @@ -72,6 +72,15 @@ func routeEdges(edgesInOrder []*d2graph.Edge, startY, yStep float64) { } } +// addLifelineEdges adds a new edge for each object in the graph that represents the +// edge below he object showing its lifespan +// ┌──────────────┐ +// │ object │ +// └──────┬───────┘ +// │ +// │ lifeline +// │ +// │ func addLifelineEdges(g *d2graph.Graph, objectsInOrder []*d2graph.Object, yStep float64) { endY := g.Edges[len(g.Edges)-1].Route[0].Y + yStep for _, obj := range objectsInOrder {