From 6b467095ae2b49aacf4e316da85b561e17d1f040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Fri, 2 Dec 2022 13:59:12 -0800 Subject: [PATCH] lifelines --- d2layouts/d2sequence/constants.go | 4 ++++ d2layouts/d2sequence/sequence_diagram.go | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/d2layouts/d2sequence/constants.go b/d2layouts/d2sequence/constants.go index 62a8132ec..12d591f3e 100644 --- a/d2layouts/d2sequence/constants.go +++ b/d2layouts/d2sequence/constants.go @@ -19,3 +19,7 @@ const SPAN_DEPTH_GROWTH_FACTOR = 8. // when a span has a single messages const MIN_SPAN_HEIGHT = 80. + +const LIFELINE_STROKE_WIDTH int = 2 + +const LIFELINE_STROKE_DASH int = 8 diff --git a/d2layouts/d2sequence/sequence_diagram.go b/d2layouts/d2sequence/sequence_diagram.go index 9a20692e0..d49f657c9 100644 --- a/d2layouts/d2sequence/sequence_diagram.go +++ b/d2layouts/d2sequence/sequence_diagram.go @@ -134,9 +134,8 @@ func (sd *sequenceDiagram) addLifelineEdges() { sd.lifelines = append(sd.lifelines, &d2graph.Edge{ Attributes: d2graph.Attributes{ Style: d2graph.Style{ - StrokeDash: &d2graph.Scalar{Value: "10"}, - Stroke: actor.Attributes.Style.Stroke, - StrokeWidth: actor.Attributes.Style.StrokeWidth, + StrokeDash: &d2graph.Scalar{Value: fmt.Sprintf("%d", LIFELINE_STROKE_DASH)}, + StrokeWidth: &d2graph.Scalar{Value: fmt.Sprintf("%d", LIFELINE_STROKE_WIDTH)}, }, }, Src: actor,