diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 90d54bc6d..593c139d9 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1553,13 +1553,45 @@ dst.id <-> src.dst_id text: `x: { shape: sequence_diagram - a + a } b -> x.a `, expErr: `d2/testdata/d2compiler/TestCompile/leaky_sequence.d2:5:1: connections within sequence diagrams can connect only to other objects within the same sequence diagram `, }, + { + name: "sequence_scoping", + + text: `x: { + shape: sequence_diagram + a;b + group: { + a -> b + a.t1 -> b.t1 + b.t1.t2 -> b.t1 + } +} +`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, 7, len(g.Objects)) + tassert.Equal(t, 3, len(g.Objects[0].ChildrenArray)) + }, + }, + { + name: "sequence_grouped_note", + + text: `shape: sequence_diagram +a;d +choo: { + d."this note" +} +`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, 4, len(g.Objects)) + tassert.Equal(t, 3, len(g.Root.ChildrenArray)) + }, + }, { name: "root_direction", diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index b7af9f2a3..838ffe6d7 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -20,6 +20,8 @@ import ( "oss.terrastruct.com/d2/lib/textmeasure" ) +const INNER_LABEL_PADDING int = 5 + // TODO: Refactor with a light abstract layer on top of AST implementing scenarios, // variables, imports, substitutions and then a final set of structures representing // a final graph. @@ -525,6 +527,22 @@ func (obj *Object) HasEdge(mk *d2ast.Key) (*Edge, bool) { } func ResolveUnderscoreKey(ida []string, obj *Object) (resolvedObj *Object, resolvedIDA []string, _ error) { + if len(ida) > 0 && !obj.IsSequenceDiagram() { + objSD := obj.OuterSequenceDiagram() + if objSD != nil { + referencesActor := false + for _, c := range objSD.ChildrenArray { + if c.ID == ida[0] { + referencesActor = true + break + } + } + if referencesActor { + obj = objSD + } + } + } + resolvedObj = obj resolvedIDA = ida @@ -867,7 +885,7 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler } var dims *d2target.TextDimensions - var innerLabelPadding = 5 + var innerLabelPadding = INNER_LABEL_PADDING if obj.Attributes.Shape.Value == d2target.ShapeText { if obj.Attributes.Language == "latex" { width, height, err := d2latex.Measure(obj.Text().Text) diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index 77214ce3f..2af505713 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -22,6 +22,7 @@ import ( "oss.terrastruct.com/util-go/go2" + "oss.terrastruct.com/d2/d2graph" "oss.terrastruct.com/d2/d2renderers/d2fonts" "oss.terrastruct.com/d2/d2renderers/d2latex" "oss.terrastruct.com/d2/d2target" @@ -337,11 +338,11 @@ func pathData(connection d2target.Connection, idToShape map[string]d2target.Shap return strings.Join(path, " ") } -func makeLabelMask(connection d2target.Connection, labelTL, tl, br *geo.Point) string { +func makeLabelMask(labelTL *geo.Point, width, height int) string { return fmt.Sprintf(``, labelTL.X, labelTL.Y, - connection.LabelWidth, - connection.LabelHeight, + width, + height, ) } @@ -408,7 +409,7 @@ func drawConnection(writer io.Writer, connection d2target.Connection, markers ma br.X = math.Max(br.X, labelTL.X+float64(connection.LabelWidth)) br.Y = math.Max(br.Y, labelTL.Y+float64(connection.LabelHeight)) - labelMask = makeLabelMask(connection, labelTL, tl, br) + labelMask = makeLabelMask(labelTL, connection.LabelWidth, connection.LabelHeight) } } @@ -582,7 +583,7 @@ func render3dRect(targetShape d2target.Shape) string { return borderMask + mainRect + renderedSides + renderedBorder } -func drawShape(writer io.Writer, targetShape d2target.Shape) error { +func drawShape(writer io.Writer, targetShape d2target.Shape) (labelMask string, err error) { fmt.Fprintf(writer, ``, escapeText(targetShape.ID)) tl := geo.NewPoint(float64(targetShape.Pos.X), float64(targetShape.Pos.Y)) width := float64(targetShape.Width) @@ -620,11 +621,11 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) error { case d2target.ShapeClass: drawClass(writer, targetShape) fmt.Fprintf(writer, ``) - return nil + return labelMask, nil case d2target.ShapeSQLTable: drawTable(writer, targetShape) fmt.Fprintf(writer, ``) - return nil + return labelMask, nil case d2target.ShapeOval: if targetShape.Multiple { fmt.Fprint(writer, renderOval(multipleTL, width, height, style)) @@ -706,19 +707,19 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) error { case d2target.ShapeCode: lexer := lexers.Get(targetShape.Language) if lexer == nil { - return fmt.Errorf("code snippet lexer for %s not found", targetShape.Language) + return labelMask, fmt.Errorf("code snippet lexer for %s not found", targetShape.Language) } style := styles.Get("github") if style == nil { - return errors.New(`code snippet style "github" not found`) + return labelMask, errors.New(`code snippet style "github" not found`) } formatter := formatters.Get("svg") if formatter == nil { - return errors.New(`code snippet formatter "svg" not found`) + return labelMask, errors.New(`code snippet formatter "svg" not found`) } iterator, err := lexer.Tokenise(nil, targetShape.Label) if err != nil { - return err + return labelMask, err } svgStyles := styleToSVG(style) @@ -748,15 +749,15 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) error { if targetShape.Language == "latex" { render, err := d2latex.Render(targetShape.Label) if err != nil { - return err + return labelMask, err } fmt.Fprintf(writer, ``, box.TopLeft.X, box.TopLeft.Y, targetShape.Opacity) - fmt.Fprintf(writer, render) + fmt.Fprint(writer, render) fmt.Fprintf(writer, "") } else { render, err := textmeasure.RenderMarkdown(targetShape.Label) if err != nil { - return err + return labelMask, err } fmt.Fprintf(writer, ``, box.TopLeft.X, box.TopLeft.Y, targetShape.Width, targetShape.Height, @@ -772,7 +773,7 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) error { fontColor = targetShape.Color } textStyle := fmt.Sprintf("text-anchor:%s;font-size:%vpx;fill:%s", "middle", targetShape.FontSize, fontColor) - x := labelTL.X + float64(targetShape.LabelWidth)/2 + x := labelTL.X + float64(targetShape.LabelWidth)/2. // text is vertically positioned at its baseline which is at labelTL+FontSize y := labelTL.Y + float64(targetShape.FontSize) fmt.Fprintf(writer, `%s`, @@ -781,10 +782,13 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) error { textStyle, renderText(targetShape.Label, x, float64(targetShape.LabelHeight)), ) + if targetShape.Blend { + labelMask = makeLabelMask(labelTL, targetShape.LabelWidth, targetShape.LabelHeight-d2graph.INNER_LABEL_PADDING) + } } } fmt.Fprintf(writer, ``) - return nil + return labelMask, nil } func escapeText(text string) string { @@ -996,9 +1000,11 @@ func Render(diagram *d2target.Diagram) ([]byte, error) { labelMasks = append(labelMasks, labelMask) } } else if s, is := obj.(d2target.Shape); is { - err := drawShape(buf, s) + labelMask, err := drawShape(buf, s) if err != nil { return nil, err + } else if labelMask != "" { + labelMasks = append(labelMasks, labelMask) } } else { return nil, fmt.Errorf("unknow object of type %T", obj) diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 230528899..a7e7d93e3 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -1363,25 +1363,25 @@ d."The earth is like a tiny grain of sand, only much, much heavier" a;b;c;d a -> b ggg: { - _.a -> _.b: lala + a -> b: lala } group 1: { - _.b -> _.c - _.c -> _.b: ey + b -> c + c -> b: ey nested guy: { - _._.c -> _._.b: okay + c -> b: okay } - _.b.t1 -> _.c.t1 - _.b.t1.t2 -> _.c.t1 - _.c.t1 -> _.b.t1 + b.t1 -> c.t1 + b.t1.t2 -> c.t1 + c.t1 -> b.t1 } group b: { - _.b -> _.c - _.c."what would arnold say" - _.c -> _.b: okay + b -> c + c."what would arnold say" + c -> b: okay } choo: { - _.d."this note" + d."this note" } `, }, @@ -1389,17 +1389,19 @@ choo: { name: "sequence_diagram_nested_groups", script: `shape: sequence_diagram +a; b; c + this is a message group: { - _.a -> _.b + a -> b and this is a nested message group: { - _._.a -> _._.b + a -> b what about more nesting: { - _._._.a -> _._._.b + a -> b crazy town: { - _._._._.a."a note" - _._._._.a -> _._._._.b + a."a note" + a -> b whoa: { - _._._._._.a -> _._._._._.b + a -> b } } } @@ -1408,16 +1410,16 @@ this is a message group: { alt: { case 1: { - _._.b -> _._.c + b -> c } case 2: { - _._.b -> _._.c + b -> c } case 3: { - _._.b -> _._.c + b -> c } case 4: { - _._.b -> _._.c + b -> c } } @@ -1431,7 +1433,7 @@ c: "just an actor" script: `How this is rendered: { shape: sequence_diagram - CLI; d2ast; d2compiler; d2layout; d2exporter; d2themes; d2renderer + CLI; d2ast; d2compiler; d2layout; d2exporter; d2themes; d2renderer; d2sequencelayout; d2dagrelayout CLI -> d2ast: "'How this is rendered: {...}'" d2ast -> CLI: tokenized AST @@ -1441,7 +1443,7 @@ c: "just an actor" CLI -> d2layout.layout: run layout engines d2layout.layout -> d2sequencelayout: run engine on shape: sequence_diagram, temporarily remove only if root is not sequence: { - _.d2layout.layout -> _.d2dagrelayout: run core engine on rest + d2layout.layout -> d2dagrelayout: run core engine on rest } d2layout.layout <- d2sequencelayout: add back in sequence diagrams d2layout -> CLI: diagram with correct positions and dimensions diff --git a/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg index c4dc8c3e4..faac36d1f 100644 --- a/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg @@ -20,6 +20,11 @@ width="1147" height="2268" viewBox="-76 -26 1147 2268">abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note + + + + + 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 c4dc8c3e4..faac36d1f 100644 --- a/e2etests/testdata/stable/sequence_diagram_groups/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_groups/elk/sketch.exp.svg @@ -20,6 +20,11 @@ width="1147" height="2268" viewBox="-76 -26 1147 2268">abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note + + + + + diff --git a/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/board.exp.json b/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/board.exp.json index d025d92a5..efc84c172 100644 --- a/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/board.exp.json @@ -1,6 +1,126 @@ { "name": "", "shapes": [ + { + "id": "a", + "type": "", + "pos": { + "x": 24, + "y": 74 + }, + "width": 150, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "", + "pos": { + "x": 337, + "y": 74 + }, + "width": 150, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "c", + "type": "", + "pos": { + "x": 629, + "y": 74 + }, + "width": 190, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "just an actor", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 90, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, { "id": "this is a message group", "type": "", @@ -157,46 +277,6 @@ "zIndex": 3, "level": 4 }, - { - "id": "a", - "type": "", - "pos": { - "x": 24, - "y": 74 - }, - "width": 150, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "a", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 12, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 1 - }, { "id": "a.a note", "type": "page", @@ -471,46 +551,6 @@ "zIndex": 3, "level": 2 }, - { - "id": "b", - "type": "", - "pos": { - "x": 337, - "y": 74 - }, - "width": 150, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "b", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 13, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 1 - }, { "id": "b.note", "type": "page", @@ -590,46 +630,6 @@ "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 5, "level": 2 - }, - { - "id": "c", - "type": "", - "pos": { - "x": 629, - "y": 74 - }, - "width": 190, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "just an actor", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 90, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 1 } ], "connections": [ diff --git a/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/sketch.exp.svg index c723094ed..04d15eb6e 100644 --- a/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_nested_groups/dagre/sketch.exp.svg @@ -18,7 +18,19 @@ width="1116" height="2458" viewBox="-197 -26 1116 2458">abjust an actorthis is a message groupaltand this is a nested message groupcase 1case 2case 3case 4what about more nestingcrazy townwhoa a notea note here to remember that padding must consider notes toojustalongnotehereabjust an actorthis is a message groupaltand this is a nested message groupcase 1case 2case 3case 4what about more nestingcrazy townwhoa a notea note here to remember that padding must consider notes toojustalongnotehere + + + + + + + + + + + +abjust an actorthis is a message groupaltand this is a nested message groupcase 1case 2case 3case 4what about more nestingcrazy townwhoa a notea note here to remember that padding must consider notes toojustalongnotehereabjust an actorthis is a message groupaltand this is a nested message groupcase 1case 2case 3case 4what about more nestingcrazy townwhoa a notea note here to remember that padding must consider notes toojustalongnotehere + + + + + + + + + + + +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 e8a6c5233..0f9eb51ae 100644 --- a/e2etests/testdata/stable/sequence_diagram_real/elk/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_real/elk/board.exp.json @@ -321,6 +321,86 @@ "zIndex": 0, "level": 2 }, + { + "id": "How this is rendered.d2sequencelayout", + "type": "", + "pos": { + "x": 1752, + "y": 122 + }, + "width": 229, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "d2sequencelayout", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 129, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "How this is rendered.d2dagrelayout", + "type": "", + "pos": { + "x": 2031, + "y": 122 + }, + "width": 204, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "d2dagrelayout", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 104, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, { "id": "How this is rendered.d2compiler.measurements also take place", "type": "page", @@ -439,86 +519,6 @@ "zIndex": 2, "level": 3 }, - { - "id": "How this is rendered.d2sequencelayout", - "type": "", - "pos": { - "x": 1752, - "y": 122 - }, - "width": 229, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "d2sequencelayout", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 129, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 2 - }, - { - "id": "How this is rendered.d2dagrelayout", - "type": "", - "pos": { - "x": 2031, - "y": 122 - }, - "width": 204, - "height": 126, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#EDF0FD", - "stroke": "#0D32B2", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": null, - "label": "d2dagrelayout", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 104, - "labelHeight": 26, - "labelPosition": "INSIDE_MIDDLE_CENTER", - "zIndex": 0, - "level": 2 - }, { "id": "How this is rendered.d2exporter.export", "type": "rectangle", 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 71a413236..1bb494e3d 100644 --- a/e2etests/testdata/stable/sequence_diagram_real/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_real/elk/sketch.exp.svg @@ -20,6 +20,7 @@ width="2447" height="2536" viewBox="-88 -88 2447 2536">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/todo/sequence_diagram_actor_padding_nested_groups/dagre/sketch.exp.svg b/e2etests/testdata/todo/sequence_diagram_actor_padding_nested_groups/dagre/sketch.exp.svg index 45f3f9430..9357326e5 100644 --- a/e2etests/testdata/todo/sequence_diagram_actor_padding_nested_groups/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/sequence_diagram_actor_padding_nested_groups/dagre/sketch.exp.svg @@ -18,7 +18,14 @@ width="921" height="1242" viewBox="-147 -26 921 1242">bacthis is a message groupand this is a nested message groupwhat about more nestingyoyo bacthis is a message groupand this is a nested message groupwhat about more nestingyoyo + + + + + + +bacthis is a message groupand this is a nested message groupwhat about more nestingyoyo bacthis is a message groupand this is a nested message groupwhat about more nestingyoyo + + + + + + +