From 58cd8d6922933325a40431226b4907c10e6144d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Mon, 5 Dec 2022 18:52:08 -0800 Subject: [PATCH 1/6] Fix page outer path --- lib/shape/shape_page.go | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/lib/shape/shape_page.go b/lib/shape/shape_page.go index 79d528ed2..af6576fb4 100644 --- a/lib/shape/shape_page.go +++ b/lib/shape/shape_page.go @@ -19,18 +19,29 @@ func NewPage(box *geo.Box) Shape { } func pageOuterPath(box *geo.Box) *svg.SvgPathContext { - pc := svg.NewSVGPathContext(box.TopLeft, box.Width/66, box.Height/79.0) + // base page size + const PAGE_WIDTH = 66. + const PAGE_HEIGHT = 79. + + pc := svg.NewSVGPathContext(box.TopLeft, 1., 1.) pc.StartAt(pc.Absolute(0.5, 0)) - pc.H(false, 45.1836) - pc.C(false, 46.3544, 0.0, 47.479, 0.456297, 48.3189, 1.27202) - pc.L(false, 64.6353, 17.12) - pc.C(false, 65.5077, 17.9674, 66.0, 19.1318, 66.0, 20.348) - pc.V(false, 78.5) - pc.C(false, 66.0, 78.7761, 65.7761, 79.0, 65.5, 79.0) - pc.H(false, 0.499999) - pc.C(false, 0.223857, 79.0, 0.0, 78.7761, 0.0, 78.5) - pc.V(false, 0.499999) - pc.C(false, 0.0, 0.223857, 0.223857, 0.0, 0.5, 0.0) + baseX := box.Width - PAGE_WIDTH + pc.H(false, baseX+45.1836) // = width-(66+45.1836) + pc.C(false, baseX+46.3544, 0.0, baseX+47.479, 0.456297, baseX+48.3189, 1.27202) + pc.L(false, baseX+64.6353, 17.12) + pc.C(false, baseX+65.5077, 17.9674, baseX+66., 19.1318, baseX+66., 20.348) + // baseY is not needed above because the coordinates start at 0 + baseY := box.Height - PAGE_HEIGHT + pc.V(false, baseY+78.5) + pc.C(false, baseX+66.0, baseY+78.7761, baseX+65.7761, baseY+79.0, baseX+65.5, baseY+79.0) + + // these are the corners and they should change as the shape grows + scaleX := box.Width / PAGE_WIDTH + scaleY := box.Height / PAGE_HEIGHT + pc.H(false, scaleX*.499999) + pc.C(false, scaleX*0.223857, baseY+79.0, 0.0, baseY+78.7761, 0.0, baseY+78.5) + pc.V(false, scaleY*0.499999) + pc.C(false, 0.0, scaleY*0.223857, scaleX*0.223857, 0.0, scaleX*0.5, 0.0) pc.Z() return pc } From 3db0afd9c7ed821a435f305b4626fe71159fc8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Mon, 5 Dec 2022 19:05:35 -0800 Subject: [PATCH 2/6] Change inner path base width to 66 --- lib/shape/shape_page.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/shape/shape_page.go b/lib/shape/shape_page.go index af6576fb4..b86ae4c05 100644 --- a/lib/shape/shape_page.go +++ b/lib/shape/shape_page.go @@ -47,20 +47,20 @@ func pageOuterPath(box *geo.Box) *svg.SvgPathContext { } func pageInnerPath(box *geo.Box) *svg.SvgPathContext { - pc := svg.NewSVGPathContext(box.TopLeft, box.Width/30.5, box.Height/36.5) - pc.StartAt(pc.Absolute(30, 36.5)) - pc.H(false, 0.5) - pc.C(true, -0.3, 0, -0.5, -0.2, -0.5, -0.5) + pc := svg.NewSVGPathContext(box.TopLeft, box.Width/66., box.Height/36.5) + pc.StartAt(pc.Absolute(64.91803, 36.5)) + pc.H(false, 1.08196) + pc.C(true, -0.64918, 0, -1.08196, -0.2, -1.08196, -0.5) pc.V(false, 0.5) - pc.C(true, 0, -0.3, 0.2, -0.5, 0.5, -0.5) - pc.H(true, 20.3) - pc.C(true, 0.3, 0, 0.5, 0.2, 0.5, 0.5) + pc.C(true, 0, -0.3, 0.43278, -0.5, 1.08196, -0.5) + pc.H(true, 43.27868) + pc.C(true, 0.64918, 0, 1.08196, 0.2, 1.08196, 0.5) pc.V(true, 7.9) - pc.C(true, 0, 0.6, 0.4, 1.1, 1.1, 1.1) - pc.H(false, 30) - pc.C(true, 0.3, 0, 0.5, 0.2, 0.5, 0.5) + pc.C(true, 0, 0.6, 0.86557, 1.1, 2.38032, 1.1) + pc.H(false, 64.91803) + pc.C(true, .64918, 0, 1.08196, 0.2, 1.08196, 0.5) pc.V(false, 36) - pc.C(false, 30.5, 36.3, 30.3, 36.5, 30, 36.5) + pc.C(false, 64.99999, 36.3, 65.56721, 36.5, 64.91803, 36.5) pc.Z() return pc } From 2cc9405a25f1dc3c18489f37c0f1448c36042e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Mon, 5 Dec 2022 19:16:45 -0800 Subject: [PATCH 3/6] Change inner path base height to 79 --- lib/shape/shape_page.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/shape/shape_page.go b/lib/shape/shape_page.go index b86ae4c05..e6dd0e92e 100644 --- a/lib/shape/shape_page.go +++ b/lib/shape/shape_page.go @@ -47,20 +47,20 @@ func pageOuterPath(box *geo.Box) *svg.SvgPathContext { } func pageInnerPath(box *geo.Box) *svg.SvgPathContext { - pc := svg.NewSVGPathContext(box.TopLeft, box.Width/66., box.Height/36.5) - pc.StartAt(pc.Absolute(64.91803, 36.5)) + pc := svg.NewSVGPathContext(box.TopLeft, box.Width/66., box.Height/79.) + pc.StartAt(pc.Absolute(64.91803, 79.)) pc.H(false, 1.08196) - pc.C(true, -0.64918, 0, -1.08196, -0.2, -1.08196, -0.5) - pc.V(false, 0.5) - pc.C(true, 0, -0.3, 0.43278, -0.5, 1.08196, -0.5) + pc.C(true, -0.64918, 0, -1.08196, -0.43287, -1.08196, -1.08219) + pc.V(false, 1.08219) + pc.C(true, 0, -0.64931, 0.43278, -1.08219, 1.08196, -1.08219) pc.H(true, 43.27868) - pc.C(true, 0.64918, 0, 1.08196, 0.2, 1.08196, 0.5) - pc.V(true, 7.9) - pc.C(true, 0, 0.6, 0.86557, 1.1, 2.38032, 1.1) + pc.C(true, 0.64918, 0, 1.08196, 0.43287, 1.08196, 1.08219) + pc.V(true, 17.09863) + pc.C(true, 0, 1.29863, 0.86557, 2.38082, 2.38032, 2.38082) pc.H(false, 64.91803) - pc.C(true, .64918, 0, 1.08196, 0.2, 1.08196, 0.5) - pc.V(false, 36) - pc.C(false, 64.99999, 36.3, 65.56721, 36.5, 64.91803, 36.5) + pc.C(true, .64918, 0, 1.08196, 0.43287, 1.08196, 1.08196) + pc.V(false, 77.91780) + pc.C(false, 64.99999, 78.56712, 65.56721, 79, 64.91803, 79) pc.Z() return pc } From 15f83d3b033d3b34c8b1cd2b8bc6ca8d9443020f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Mon, 5 Dec 2022 19:36:15 -0800 Subject: [PATCH 4/6] Fix page inner size --- lib/shape/shape_page.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/shape/shape_page.go b/lib/shape/shape_page.go index e6dd0e92e..ca55f71ac 100644 --- a/lib/shape/shape_page.go +++ b/lib/shape/shape_page.go @@ -18,49 +18,49 @@ func NewPage(box *geo.Box) Shape { } } -func pageOuterPath(box *geo.Box) *svg.SvgPathContext { - // base page size - const PAGE_WIDTH = 66. - const PAGE_HEIGHT = 79. +const PAGE_WIDTH = 66. +const PAGE_HEIGHT = 79. +func pageOuterPath(box *geo.Box) *svg.SvgPathContext { pc := svg.NewSVGPathContext(box.TopLeft, 1., 1.) - pc.StartAt(pc.Absolute(0.5, 0)) baseX := box.Width - PAGE_WIDTH + baseY := box.Height - PAGE_HEIGHT + pc.StartAt(pc.Absolute(0.5, 0)) pc.H(false, baseX+45.1836) // = width-(66+45.1836) pc.C(false, baseX+46.3544, 0.0, baseX+47.479, 0.456297, baseX+48.3189, 1.27202) pc.L(false, baseX+64.6353, 17.12) pc.C(false, baseX+65.5077, 17.9674, baseX+66., 19.1318, baseX+66., 20.348) // baseY is not needed above because the coordinates start at 0 - baseY := box.Height - PAGE_HEIGHT pc.V(false, baseY+78.5) pc.C(false, baseX+66.0, baseY+78.7761, baseX+65.7761, baseY+79.0, baseX+65.5, baseY+79.0) - // these are the corners and they should change as the shape grows - scaleX := box.Width / PAGE_WIDTH - scaleY := box.Height / PAGE_HEIGHT - pc.H(false, scaleX*.499999) - pc.C(false, scaleX*0.223857, baseY+79.0, 0.0, baseY+78.7761, 0.0, baseY+78.5) - pc.V(false, scaleY*0.499999) - pc.C(false, 0.0, scaleY*0.223857, scaleX*0.223857, 0.0, scaleX*0.5, 0.0) + pc.H(false, .499999) + pc.C(false, 0.223857, baseY+79.0, 0.0, baseY+78.7761, 0.0, baseY+78.5) + pc.V(false, 0.499999) + pc.C(false, 0.0, 0.223857, 0.223857, 0.0, 0.5, 0.0) pc.Z() return pc } func pageInnerPath(box *geo.Box) *svg.SvgPathContext { - pc := svg.NewSVGPathContext(box.TopLeft, box.Width/66., box.Height/79.) - pc.StartAt(pc.Absolute(64.91803, 79.)) + baseX := box.Width - PAGE_WIDTH + baseY := box.Height - PAGE_HEIGHT + + pc := svg.NewSVGPathContext(box.TopLeft, 1., 1.) + pc.StartAt(pc.Absolute(baseX+64.91803, baseY+79.)) pc.H(false, 1.08196) pc.C(true, -0.64918, 0, -1.08196, -0.43287, -1.08196, -1.08219) pc.V(false, 1.08219) pc.C(true, 0, -0.64931, 0.43278, -1.08219, 1.08196, -1.08219) - pc.H(true, 43.27868) + + pc.H(true, baseX+43.27868) pc.C(true, 0.64918, 0, 1.08196, 0.43287, 1.08196, 1.08219) pc.V(true, 17.09863) pc.C(true, 0, 1.29863, 0.86557, 2.38082, 2.38032, 2.38082) - pc.H(false, 64.91803) + pc.H(false, baseX+64.91803) pc.C(true, .64918, 0, 1.08196, 0.43287, 1.08196, 1.08196) - pc.V(false, 77.91780) - pc.C(false, 64.99999, 78.56712, 65.56721, 79, 64.91803, 79) + pc.V(false, baseY+77.91780) + pc.C(false, baseX+64.99999, baseY+78.56712, baseX+65.56721, baseY+79, baseX+64.91803, baseY+79) pc.Z() return pc } From c6e389ee9a13cc2eb1723445dd794cb168bdbe6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Mon, 5 Dec 2022 19:39:59 -0800 Subject: [PATCH 5/6] Set sequence diagrams note to shape: page --- d2layouts/d2sequence/sequence_diagram.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/d2layouts/d2sequence/sequence_diagram.go b/d2layouts/d2sequence/sequence_diagram.go index 277474be5..10230e8fb 100644 --- a/d2layouts/d2sequence/sequence_diagram.go +++ b/d2layouts/d2sequence/sequence_diagram.go @@ -115,8 +115,7 @@ func newSequenceDiagram(objects []*d2graph.Object, messages []*d2graph.Edge) *se // edge groups are children of actors with no edges and children edges if child.IsSequenceDiagramNote() { sd.verticalIndices[child.AbsID()] = getObjEarliestLineNum(child) - // TODO change to page type when it doesn't look deformed - child.Attributes.Shape = d2graph.Scalar{Value: shape.SQUARE_TYPE} + child.Attributes.Shape = d2graph.Scalar{Value: shape.PAGE_TYPE} sd.notes = append(sd.notes, child) sd.objectRank[child] = rank child.LabelPosition = go2.Pointer(string(label.InsideMiddleCenter)) From 835d657b3f508bb3b11a71fb5b5ed494be915549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Mon, 5 Dec 2022 19:40:51 -0800 Subject: [PATCH 6/6] Update tests --- e2etests/testdata/stable/all_shapes/dagre/board.exp.json | 4 ++-- e2etests/testdata/stable/all_shapes/dagre/sketch.exp.svg | 2 +- e2etests/testdata/stable/all_shapes/elk/sketch.exp.svg | 2 +- .../stable/all_shapes_multiple/dagre/board.exp.json | 4 ++-- .../stable/all_shapes_multiple/dagre/sketch.exp.svg | 2 +- .../stable/all_shapes_multiple/elk/sketch.exp.svg | 2 +- .../stable/all_shapes_shadow/dagre/board.exp.json | 4 ++-- .../stable/all_shapes_shadow/dagre/sketch.exp.svg | 2 +- .../testdata/stable/all_shapes_shadow/elk/sketch.exp.svg | 2 +- .../sequence_diagram_all_shapes/dagre/sketch.exp.svg | 2 +- .../stable/sequence_diagram_all_shapes/elk/sketch.exp.svg | 2 +- .../stable/sequence_diagram_groups/dagre/board.exp.json | 4 ++-- .../stable/sequence_diagram_groups/dagre/sketch.exp.svg | 2 +- .../stable/sequence_diagram_groups/elk/board.exp.json | 4 ++-- .../stable/sequence_diagram_groups/elk/sketch.exp.svg | 2 +- .../stable/sequence_diagram_note/dagre/board.exp.json | 8 ++++---- .../stable/sequence_diagram_note/dagre/sketch.exp.svg | 2 +- .../stable/sequence_diagram_note/elk/board.exp.json | 8 ++++---- .../stable/sequence_diagram_note/elk/sketch.exp.svg | 2 +- .../stable/sequence_diagram_real/dagre/board.exp.json | 2 +- .../stable/sequence_diagram_real/dagre/sketch.exp.svg | 2 +- .../stable/sequence_diagram_real/elk/board.exp.json | 2 +- .../stable/sequence_diagram_real/elk/sketch.exp.svg | 2 +- 23 files changed, 34 insertions(+), 34 deletions(-) diff --git a/e2etests/testdata/stable/all_shapes/dagre/board.exp.json b/e2etests/testdata/stable/all_shapes/dagre/board.exp.json index a86e092db..b9fae223a 100644 --- a/e2etests/testdata/stable/all_shapes/dagre/board.exp.json +++ b/e2etests/testdata/stable/all_shapes/dagre/board.exp.json @@ -748,11 +748,11 @@ "y": 420 }, { - "x": 85.4, + "x": 85.6, "y": 441.8 }, { - "x": 85, + "x": 86, "y": 489 } ], diff --git a/e2etests/testdata/stable/all_shapes/dagre/sketch.exp.svg b/e2etests/testdata/stable/all_shapes/dagre/sketch.exp.svg index 43a253d77..354d02711 100644 --- a/e2etests/testdata/stable/all_shapes/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/all_shapes/dagre/sketch.exp.svg @@ -14,7 +14,7 @@ width="1539" height="824" viewBox="-100 -100 1539 824">rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud rectanglesquarepageparallelogramdocumentcylinderqueuepackagestepcalloutstored_datapersondiamondovalcirclehexagoncloud abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note +abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note diff --git a/e2etests/testdata/stable/sequence_diagram_groups/elk/board.exp.json b/e2etests/testdata/stable/sequence_diagram_groups/elk/board.exp.json index d3b8d9c6a..8f015c85c 100644 --- a/e2etests/testdata/stable/sequence_diagram_groups/elk/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_groups/elk/board.exp.json @@ -311,7 +311,7 @@ }, { "id": "c.what would arnold say", - "type": "rectangle", + "type": "page", "pos": { "x": 386, "y": 1476 @@ -388,7 +388,7 @@ }, { "id": "d.this note", - "type": "rectangle", + "type": "page", "pos": { "x": 653, "y": 1862 diff --git a/e2etests/testdata/stable/sequence_diagram_groups/elk/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_groups/elk/sketch.exp.svg index 2998278f8..e680c91b3 100644 --- a/e2etests/testdata/stable/sequence_diagram_groups/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_groups/elk/sketch.exp.svg @@ -14,7 +14,7 @@ width="1057" height="2268" viewBox="-100 -50 1057 2268">abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note +abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note diff --git a/e2etests/testdata/stable/sequence_diagram_note/dagre/board.exp.json b/e2etests/testdata/stable/sequence_diagram_note/dagre/board.exp.json index 69036822a..b268b7645 100644 --- a/e2etests/testdata/stable/sequence_diagram_note/dagre/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_note/dagre/board.exp.json @@ -159,7 +159,7 @@ }, { "id": "a.explanation", - "type": "rectangle", + "type": "page", "pos": { "x": -17, "y": 436 @@ -198,7 +198,7 @@ }, { "id": "a.another explanation", - "type": "rectangle", + "type": "page", "pos": { "x": -45, "y": 692 @@ -237,7 +237,7 @@ }, { "id": "b.\"Some one who believes imaginary things\\n appear right before your i's.\"", - "type": "rectangle", + "type": "page", "pos": { "x": 106, "y": 1078 @@ -276,7 +276,7 @@ }, { "id": "d.The earth is like a tiny grain of sand, only much, much heavier", - "type": "rectangle", + "type": "page", "pos": { "x": 477, "y": 1480 diff --git a/e2etests/testdata/stable/sequence_diagram_note/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_note/dagre/sketch.exp.svg index 26ea65ebf..d902ca6c7 100644 --- a/e2etests/testdata/stable/sequence_diagram_note/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_note/dagre/sketch.exp.svg @@ -14,7 +14,7 @@ width="1238" height="1886" viewBox="-145 -50 1238 1886">abcd okayexplanationanother explanationSome one who believes imaginary things appear right before your i's.The earth is like a tiny grain of sand, only much, much heavier +abcd okayexplanationanother explanationSome one who believes imaginary things appear right before your i's.The earth is like a tiny grain of sand, only much, much heavier abcd okayexplanationanother explanationSome one who believes imaginary things appear right before your i's.The earth is like a tiny grain of sand, only much, much heavier +abcd okayexplanationanother explanationSome one who believes imaginary things appear right before your i's.The earth is like a tiny grain of sand, only much, much heavier How this is renderedCLId2astd2compilerd2layoutd2exporterd2themesd2rendererd2sequencelayoutd2dagrelayoutonly if root is not sequence 'How this is rendered: {...}'tokenized ASTcompile ASTobjects and edgesrun layout enginesrun engine on shape: sequence_diagram, temporarily removerun core engine on rest add back in sequence diagramsdiagram with correct positions and dimensionsexport diagram with chosen theme and rendererget theme stylesrender to SVGresulting SVGmeasurements also take place +How this is renderedCLId2astd2compilerd2layoutd2exporterd2themesd2rendererd2sequencelayoutd2dagrelayoutonly if root is not sequence 'How this is rendered: {...}'tokenized ASTcompile ASTobjects and edgesrun layout enginesrun engine on shape: sequence_diagram, temporarily removerun core engine on rest add back in sequence diagramsdiagram with correct positions and dimensionsexport diagram with chosen theme and rendererget theme stylesrender to SVGresulting SVGmeasurements also take place diff --git a/e2etests/testdata/stable/sequence_diagram_real/elk/board.exp.json b/e2etests/testdata/stable/sequence_diagram_real/elk/board.exp.json index a1170b628..63f1963e7 100644 --- a/e2etests/testdata/stable/sequence_diagram_real/elk/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_real/elk/board.exp.json @@ -315,7 +315,7 @@ }, { "id": "How this is rendered.d2compiler.measurements also take place", - "type": "rectangle", + "type": "page", "pos": { "x": 377, "y": 732 diff --git a/e2etests/testdata/stable/sequence_diagram_real/elk/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_real/elk/sketch.exp.svg index 58f501629..b48c6aaf3 100644 --- a/e2etests/testdata/stable/sequence_diagram_real/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_real/elk/sketch.exp.svg @@ -14,7 +14,7 @@ width="2374" height="2488" viewBox="-88 -88 2374 2488">How this is renderedCLId2astd2compilerd2layoutd2exporterd2themesd2rendererd2sequencelayoutd2dagrelayoutonly if root is not sequence 'How this is rendered: {...}'tokenized ASTcompile ASTobjects and edgesrun layout enginesrun engine on shape: sequence_diagram, temporarily removerun core engine on rest add back in sequence diagramsdiagram with correct positions and dimensionsexport diagram with chosen theme and rendererget theme stylesrender to SVGresulting SVGmeasurements also take place +How this is renderedCLId2astd2compilerd2layoutd2exporterd2themesd2rendererd2sequencelayoutd2dagrelayoutonly if root is not sequence 'How this is rendered: {...}'tokenized ASTcompile ASTobjects and edgesrun layout enginesrun engine on shape: sequence_diagram, temporarily removerun core engine on rest add back in sequence diagramsdiagram with correct positions and dimensionsexport diagram with chosen theme and rendererget theme stylesrender to SVGresulting SVGmeasurements also take place