diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index fa5f12f07..90d54bc6d 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1347,10 +1347,23 @@ y -> x.style if len(g.Objects) != 1 { t.Fatal(g.Objects) } + assert.String(t, `"b\nb"`, g.Objects[0].ID) assert.String(t, `b b`, g.Objects[0].Attributes.Label.Value) }, }, + { + name: "unescaped_id_cr", + + text: `b\rb`, + assertions: func(t *testing.T, g *d2graph.Graph) { + if len(g.Objects) != 1 { + t.Fatal(g.Objects) + } + assert.String(t, "b\rb", g.Objects[0].ID) + assert.String(t, "b\rb", g.Objects[0].Attributes.Label.Value) + }, + }, { name: "class_style", diff --git a/d2exporter/export.go b/d2exporter/export.go index 7d9dd313b..ec90854eb 100644 --- a/d2exporter/export.go +++ b/d2exporter/export.go @@ -99,6 +99,10 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape { shape.Italic = text.IsItalic shape.FontSize = text.FontSize + if obj.IsSequenceDiagram() { + shape.StrokeWidth = 0 + } + if obj.IsSequenceDiagramGroup() { shape.StrokeWidth = 0 shape.Blend = true diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 448ca8ff6..cc3eae38f 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -308,18 +308,6 @@ func (s *Style) Apply(key, value string) error { type ContainerLevel int -func (l ContainerLevel) Fill() string { - // Darkest (least nested) to lightest (most nested) - if l == 1 { - return "#E3E9FD" - } else if l == 2 { - return "#EDF0FD" - } else if l == 3 { - return "#F7F8FE" - } - return "#FFFFFF" -} - func (l ContainerLevel) LabelSize() int { // Largest to smallest if l == 1 { @@ -342,6 +330,26 @@ func (obj *Object) GetFill(theme *d2themes.Theme) string { return theme.Colors.B5 } + // fill for spans + sd := obj.OuterSequenceDiagram() + if sd != nil { + level -= int(sd.Level()) + if level == 1 { + return theme.Colors.B3 + } else if level == 2 { + return theme.Colors.B4 + } else if level == 3 { + return theme.Colors.B5 + } else if level == 4 { + return theme.Colors.Neutrals.N6 + } + return theme.Colors.Neutrals.N7 + } + + if obj.IsSequenceDiagram() { + return theme.Colors.Neutrals.N7 + } + shape := obj.Attributes.Shape.Value if shape == "" || strings.EqualFold(shape, d2target.ShapeSquare) || strings.EqualFold(shape, d2target.ShapeCircle) || strings.EqualFold(shape, d2target.ShapeOval) || strings.EqualFold(shape, d2target.ShapeRectangle) { diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 3b6885bf8..def678ee0 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -256,15 +256,23 @@ func setGraphAttrs(attrs dagreGraphAttrs) string { ) } +func escapeID(id string) string { + id = strings.ReplaceAll(id, `\n`, `\\n`) + // avoid an unescaped \r becoming a \n in the layout result + id = strings.ReplaceAll(id, "\r", `\r`) + return id +} + func generateAddNodeLine(id string, width, height int) string { + id = escapeID(id) return fmt.Sprintf("g.setNode(`%s`, { id: `%s`, width: %d, height: %d });\n", id, id, width, height) } func generateAddParentLine(childID, parentID string) string { - return fmt.Sprintf("g.setParent(`%s`, `%s`);\n", childID, parentID) + return fmt.Sprintf("g.setParent(`%s`, `%s`);\n", escapeID(childID), escapeID(parentID)) } func generateAddEdgeLine(fromID, toID, edgeID string) string { // in dagre v is from, w is to, name is to uniquely identify - return fmt.Sprintf("g.setEdge({v:`%s`, w:`%s`, name:`%s` });\n", fromID, toID, edgeID) + return fmt.Sprintf("g.setEdge({v:`%s`, w:`%s`, name:`%s` });\n", escapeID(fromID), escapeID(toID), escapeID(edgeID)) } diff --git a/d2layouts/d2sequence/layout.go b/d2layouts/d2sequence/layout.go index 33e82a0a4..7940e13b1 100644 --- a/d2layouts/d2sequence/layout.go +++ b/d2layouts/d2sequence/layout.go @@ -32,6 +32,9 @@ func Layout(ctx context.Context, g *d2graph.Graph, layout func(ctx context.Conte for len(queue) > 0 { obj := queue[0] queue = queue[1:] + if len(obj.ChildrenArray) == 0 { + continue + } if obj.Attributes.Shape.Value != d2target.ShapeSequenceDiagram { queue = append(queue, obj.ChildrenArray...) continue @@ -43,7 +46,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, layout func(ctx context.Conte } obj.Children = make(map[string]*d2graph.Object) obj.ChildrenArray = nil - obj.Box = geo.NewBox(nil, sd.getWidth(), sd.getHeight()) + obj.Box = geo.NewBox(nil, sd.getWidth()+GROUP_CONTAINER_PADDING*2, sd.getHeight()+GROUP_CONTAINER_PADDING*2) obj.LabelPosition = go2.Pointer(string(label.InsideTopCenter)) sequenceDiagrams[obj.AbsID()] = sd @@ -141,14 +144,26 @@ func cleanup(g *d2graph.Graph, sequenceDiagrams map[string]*sequenceDiagram, obj obj.LabelPosition = go2.Pointer(string(label.InsideTopCenter)) sd := sequenceDiagrams[obj.AbsID()] - // shift the sequence diagrams as they are always placed at (0, 0) - sd.shift(obj.TopLeft) + // shift the sequence diagrams as they are always placed at (0, 0) with some padding + sd.shift( + geo.NewPoint( + obj.TopLeft.X+GROUP_CONTAINER_PADDING, + obj.TopLeft.Y+GROUP_CONTAINER_PADDING, + ), + ) obj.Children = make(map[string]*d2graph.Object) + obj.ChildrenArray = make([]*d2graph.Object, 0) for _, child := range sd.actors { obj.Children[child.ID] = child + obj.ChildrenArray = append(obj.ChildrenArray, child) + } + for _, child := range sd.groups { + if child.Parent.AbsID() == obj.AbsID() { + obj.Children[child.ID] = child + obj.ChildrenArray = append(obj.ChildrenArray, child) + } } - obj.ChildrenArray = sd.actors g.Edges = append(g.Edges, sequenceDiagrams[obj.AbsID()].messages...) g.Edges = append(g.Edges, sequenceDiagrams[obj.AbsID()].lifelines...) diff --git a/d2layouts/d2sequence/sequence_diagram.go b/d2layouts/d2sequence/sequence_diagram.go index 942b08b65..69a767c63 100644 --- a/d2layouts/d2sequence/sequence_diagram.go +++ b/d2layouts/d2sequence/sequence_diagram.go @@ -142,6 +142,9 @@ func newSequenceDiagram(objects []*d2graph.Object, messages []*d2graph.Edge) *se nextActorHW := actors[rank+1].Width / 2. sd.actorXStep[rank] = math.Max(actorHW+nextActorHW+HORIZONTAL_PAD, MIN_ACTOR_DISTANCE) sd.actorXStep[rank] = math.Max(maxNoteWidth/2.+HORIZONTAL_PAD, sd.actorXStep[rank]) + if rank > 0 { + sd.actorXStep[rank-1] = math.Max(maxNoteWidth/2.+HORIZONTAL_PAD, sd.actorXStep[rank-1]) + } } } @@ -538,6 +541,8 @@ func (sd *sequenceDiagram) getHeight() float64 { func (sd *sequenceDiagram) shift(tl *geo.Point) { allObjects := append([]*d2graph.Object{}, sd.actors...) allObjects = append(allObjects, sd.spans...) + allObjects = append(allObjects, sd.groups...) + allObjects = append(allObjects, sd.notes...) for _, obj := range allObjects { obj.TopLeft.X += tl.X obj.TopLeft.Y += tl.Y diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index 38cd1d304..b4eb32107 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -638,7 +638,7 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) (labelMask string, targetShape.Pos.X, targetShape.Pos.Y, targetShape.Width, targetShape.Height, style) // TODO should standardize "" to rectangle - case d2target.ShapeRectangle, "": + case d2target.ShapeRectangle, d2target.ShapeSequenceDiagram, "": if targetShape.ThreeDee { fmt.Fprint(writer, render3dRect(targetShape)) } else { diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go index d2ec37c80..8170bc359 100644 --- a/e2etests/regression_test.go +++ b/e2etests/regression_test.go @@ -5,7 +5,30 @@ import ( ) func testRegression(t *testing.T) { - tcs := []testCase{} + tcs := []testCase{ + { + name: "dagre_id_with_newline", + script: ` +ninety\nnine +eighty\reight +seventy\r\nseven +`, + }, + { + name: "empty_sequence", + script: ` +A: hello { + shape: sequence_diagram +} + +B: goodbye { + shape: sequence_diagram +} + +A->B +`, + }, + } runa(t, tcs) } diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 22d6b86ec..230528899 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -1451,7 +1451,8 @@ c: "just an actor" d2exporter.export -> CLI: resulting SVG } `, - }, { + }, + { name: "sequence_diagram_actor_distance", script: `shape: sequence_diagram a: "an actor with a really long label that will break everything" diff --git a/e2etests/testdata/regression/dagre_id_with_newline/dagre/board.exp.json b/e2etests/testdata/regression/dagre_id_with_newline/dagre/board.exp.json new file mode 100644 index 000000000..32a3c26fe --- /dev/null +++ b/e2etests/testdata/regression/dagre_id_with_newline/dagre/board.exp.json @@ -0,0 +1,129 @@ +{ + "name": "", + "shapes": [ + { + "id": "\"ninety\\nnine\"", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 151, + "height": 142, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ninety\nnine", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 51, + "labelHeight": 42, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + }, + { + "id": "eighty\reight", + "type": "", + "pos": { + "x": 211, + "y": 8 + }, + "width": 151, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "eighty\reight", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 51, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + }, + { + "id": "\"seventy\r\\nseven\"", + "type": "", + "pos": { + "x": 422, + "y": 0 + }, + "width": 162, + "height": 142, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "seventy\r\nseven", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 62, + "labelHeight": 42, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/regression/dagre_id_with_newline/dagre/sketch.exp.svg b/e2etests/testdata/regression/dagre_id_with_newline/dagre/sketch.exp.svg new file mode 100644 index 000000000..89f85e41d --- /dev/null +++ b/e2etests/testdata/regression/dagre_id_with_newline/dagre/sketch.exp.svg @@ -0,0 +1,28 @@ + +ninetynineeighty eightseventy seven \ No newline at end of file diff --git a/e2etests/testdata/regression/dagre_id_with_newline/elk/board.exp.json b/e2etests/testdata/regression/dagre_id_with_newline/elk/board.exp.json new file mode 100644 index 000000000..6e9700a96 --- /dev/null +++ b/e2etests/testdata/regression/dagre_id_with_newline/elk/board.exp.json @@ -0,0 +1,129 @@ +{ + "name": "", + "shapes": [ + { + "id": "\"ninety\\nnine\"", + "type": "", + "pos": { + "x": 194, + "y": 12 + }, + "width": 151, + "height": 142, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ninety\nnine", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 51, + "labelHeight": 42, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + }, + { + "id": "eighty\reight", + "type": "", + "pos": { + "x": 365, + "y": 20 + }, + "width": 151, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "eighty\reight", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 51, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + }, + { + "id": "\"seventy\r\\nseven\"", + "type": "", + "pos": { + "x": 12, + "y": 12 + }, + "width": 162, + "height": 142, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "seventy\r\nseven", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 62, + "labelHeight": 42, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/regression/dagre_id_with_newline/elk/sketch.exp.svg b/e2etests/testdata/regression/dagre_id_with_newline/elk/sketch.exp.svg new file mode 100644 index 000000000..3f5b214b7 --- /dev/null +++ b/e2etests/testdata/regression/dagre_id_with_newline/elk/sketch.exp.svg @@ -0,0 +1,28 @@ + +ninetynineeighty eightseventy seven \ No newline at end of file diff --git a/e2etests/testdata/regression/empty_sequence/dagre/board.exp.json b/e2etests/testdata/regression/empty_sequence/dagre/board.exp.json new file mode 100644 index 000000000..74bcf0c0a --- /dev/null +++ b/e2etests/testdata/regression/empty_sequence/dagre/board.exp.json @@ -0,0 +1,137 @@ +{ + "name": "", + "shapes": [ + { + "id": "A", + "type": "sequence_diagram", + "pos": { + "x": 13, + "y": 0 + }, + "width": 140, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "hello", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 40, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + }, + { + "id": "B", + "type": "sequence_diagram", + "pos": { + "x": 0, + "y": 226 + }, + "width": 166, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "goodbye", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(A -> B)[0]", + "src": "A", + "srcArrow": "none", + "srcLabel": "", + "dst": "B", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 83, + "y": 126 + }, + { + "x": 83, + "y": 166 + }, + { + "x": 83, + "y": 186 + }, + { + "x": 83, + "y": 226 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/empty_sequence/dagre/sketch.exp.svg b/e2etests/testdata/regression/empty_sequence/dagre/sketch.exp.svg new file mode 100644 index 000000000..688d32c63 --- /dev/null +++ b/e2etests/testdata/regression/empty_sequence/dagre/sketch.exp.svg @@ -0,0 +1,28 @@ + +hellogoodbye \ No newline at end of file diff --git a/e2etests/testdata/regression/empty_sequence/elk/board.exp.json b/e2etests/testdata/regression/empty_sequence/elk/board.exp.json new file mode 100644 index 000000000..026c88023 --- /dev/null +++ b/e2etests/testdata/regression/empty_sequence/elk/board.exp.json @@ -0,0 +1,128 @@ +{ + "name": "", + "shapes": [ + { + "id": "A", + "type": "sequence_diagram", + "pos": { + "x": 25, + "y": 12 + }, + "width": 140, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "hello", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 40, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + }, + { + "id": "B", + "type": "sequence_diagram", + "pos": { + "x": 12, + "y": 238 + }, + "width": 166, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "goodbye", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 66, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "maskLabel": false, + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(A -> B)[0]", + "src": "A", + "srcArrow": "none", + "srcLabel": "", + "dst": "B", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 95, + "y": 138 + }, + { + "x": 95, + "y": 238 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/empty_sequence/elk/sketch.exp.svg b/e2etests/testdata/regression/empty_sequence/elk/sketch.exp.svg new file mode 100644 index 000000000..34c98543a --- /dev/null +++ b/e2etests/testdata/regression/empty_sequence/elk/sketch.exp.svg @@ -0,0 +1,28 @@ + +hellogoodbye \ No newline at end of file diff --git a/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/board.exp.json b/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/board.exp.json index 81d295fb4..e7035195e 100644 --- a/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/board.exp.json +++ b/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/board.exp.json @@ -5,8 +5,8 @@ "id": "a", "type": "", "pos": { - "x": 0, - "y": 210 + "x": 24, + "y": 234 }, "width": 487, "height": 126, @@ -46,8 +46,8 @@ "id": "c", "type": "", "pos": { - "x": 578, - "y": 50 + "x": 602, + "y": 74 }, "width": 177, "height": 286, @@ -87,8 +87,8 @@ "id": "d", "type": "", "pos": { - "x": 1014, - "y": 210 + "x": 1038, + "y": 234 }, "width": 150, "height": 126, @@ -128,8 +128,8 @@ "id": "e", "type": "", "pos": { - "x": 1460, - "y": 210 + "x": 1484, + "y": 234 }, "width": 180, "height": 126, @@ -169,8 +169,8 @@ "id": "b", "type": "", "pos": { - "x": 1718, - "y": 210 + "x": 1742, + "y": 234 }, "width": 163, "height": 126, @@ -210,8 +210,8 @@ "id": "f", "type": "", "pos": { - "x": 1931, - "y": 210 + "x": 1955, + "y": 234 }, "width": 561, "height": 126, @@ -275,12 +275,12 @@ "labelPercentage": 0, "route": [ { - "x": 243.5, - "y": 466 + "x": 267.5, + "y": 490 }, { - "x": 1799.5, - "y": 466 + "x": 1823.5, + "y": 490 } ], "animated": false, @@ -314,12 +314,12 @@ "labelPercentage": 0, "route": [ { - "x": 243.5, - "y": 596 + "x": 267.5, + "y": 620 }, { - "x": 1799.5, - "y": 596 + "x": 1823.5, + "y": 620 } ], "animated": false, @@ -353,12 +353,12 @@ "labelPercentage": 0, "route": [ { - "x": 666.5, - "y": 726 + "x": 690.5, + "y": 750 }, { - "x": 1089, - "y": 726 + "x": 1113, + "y": 750 } ], "animated": false, @@ -392,12 +392,12 @@ "labelPercentage": 0, "route": [ { - "x": 243.5, - "y": 856 + "x": 267.5, + "y": 880 }, { - "x": 1089, - "y": 856 + "x": 1113, + "y": 880 } ], "animated": false, @@ -431,12 +431,12 @@ "labelPercentage": 0, "route": [ { - "x": 1089, - "y": 986 + "x": 1113, + "y": 1010 }, { - "x": 1550, - "y": 986 + "x": 1574, + "y": 1010 } ], "animated": false, @@ -470,12 +470,12 @@ "labelPercentage": 0, "route": [ { - "x": 243.5, - "y": 1116 + "x": 267.5, + "y": 1140 }, { - "x": 2211.5, - "y": 1116 + "x": 2235.5, + "y": 1140 } ], "animated": false, @@ -509,12 +509,12 @@ "labelPercentage": 0, "route": [ { - "x": 243.5, - "y": 336 + "x": 267.5, + "y": 360 }, { - "x": 243.5, - "y": 1246 + "x": 267.5, + "y": 1270 } ], "animated": false, @@ -548,12 +548,12 @@ "labelPercentage": 0, "route": [ { - "x": 666.5, - "y": 336 + "x": 690.5, + "y": 360 }, { - "x": 666.5, - "y": 1246 + "x": 690.5, + "y": 1270 } ], "animated": false, @@ -587,12 +587,12 @@ "labelPercentage": 0, "route": [ { - "x": 1089, - "y": 336 + "x": 1113, + "y": 360 }, { - "x": 1089, - "y": 1246 + "x": 1113, + "y": 1270 } ], "animated": false, @@ -626,12 +626,12 @@ "labelPercentage": 0, "route": [ { - "x": 1550, - "y": 336 + "x": 1574, + "y": 360 }, { - "x": 1550, - "y": 1246 + "x": 1574, + "y": 1270 } ], "animated": false, @@ -665,12 +665,12 @@ "labelPercentage": 0, "route": [ { - "x": 1799.5, - "y": 336 + "x": 1823.5, + "y": 360 }, { - "x": 1799.5, - "y": 1246 + "x": 1823.5, + "y": 1270 } ], "animated": false, @@ -704,12 +704,12 @@ "labelPercentage": 0, "route": [ { - "x": 2211.5, - "y": 336 + "x": 2235.5, + "y": 360 }, { - "x": 2211.5, - "y": 1246 + "x": 2235.5, + "y": 1270 } ], "animated": false, diff --git a/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/sketch.exp.svg index a2518e2ba..0e9876acc 100644 --- a/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/sequence_diagram_actor_distance/dagre/sketch.exp.svg @@ -2,7 +2,7 @@ an actor with a really long label that will break everythinganactorwithareallylonglabelthatwillbreakeverythingsimplea short onefar awaywhat if there were no labels between this actor and the previous one shortlong label for testing purposes and it must be really, really longshortthis should span many actors lifelines so we know how it will look like when redering a long label over many actorslong label for testing purposes and it must be really, really long - - - - - + + + + + an actor with a really long label that will break everythinganactorwithareallylonglabelthatwillbreakeverythingsimplea short onefar awaywhat if there were no labels between this actor and the previous one shortlong label for testing purposes and it must be really, really longshortthis should span many actors lifelines so we know how it will look like when redering a long label over many actorslong label for testing purposes and it must be really, really long +an actor with a really long label that will break everythinganactorwithareallylonglabelthatwillbreakeverythingsimplea short onefar awaywhat if there were no labels between this actor and the previous one shortlong label for testing purposes and it must be really, really longshortthis should span many actors lifelines so we know how it will look like when redering a long label over many actorslong label for testing purposes and it must be really, really long - - - - - + + + + + a labelblabelsa class+ -public() bool -void- -private() int -voidcloudyyyy:= 5 +a labelblabelsa class+ +public() bool +void- +private() int +voidcloudyyyy:= 5 := a + 7 -fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid -int -name -varchar - result := callThisFunction(obj, 5) midthis sideother side +fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid +int +name +varchar + result := callThisFunction(obj, 5) midthis sideother side - - + + a labelblabelsa class+ -public() bool -void- -private() int -voidcloudyyyy:= 5 +a labelblabelsa class+ +public() bool +void- +private() int +voidcloudyyyy:= 5 := a + 7 -fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid -int -name -varchar - result := callThisFunction(obj, 5) midthis sideother side +fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid +int +name +varchar + result := callThisFunction(obj, 5) midthis sideother side - - + + abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note +abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note - - - - - - - - - + + + + + + + + + abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note +abcdggggroup 1group bchoonested guy lalaeyokayokaywhat would arnold saythis note - - - - - - - - - + + + + + + + + + ba a note here to remember that padding must consider notes toojustalongnotehereba a 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 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 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 toojustalongnotehere + + + + + + + + + + + scoreritemResponseitemessayRubricconceptitemOutcome scoreritemResponseitemessayRubricconceptitemOutcome 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 + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + ab a self edge herebetween actorsto descendantto deeper descendantto parentactor +ab a self edge herebetween actorsto descendantto deeper descendantto parentactor - - - - - - + + + + + + ab a self edge herebetween actorsto descendantto deeper descendantto parentactor +ab a self edge herebetween actorsto descendantto deeper descendantto parentactor - - - - - - + + + + + + AlicelinebreakerBobdbqueueanoddservicewithanameinmultiple lines Authentication Requestmake request for something that is quite far away and requires a really long label to take all the space between the objectsvalidate credentialsAuthentication ResponseAnother authentication Requestdo it later storedAnother authentication Response +AlicelinebreakerBobdbqueueanoddservicewithanameinmultiple lines Authentication Requestmake request for something that is quite far away and requires a really long label to take all the space between the objectsvalidate credentialsAuthentication ResponseAnother authentication Requestdo it later storedAnother authentication Response - - - - - - - - + + + + + + + + AlicelinebreakerBobdbqueueanoddservicewithanameinmultiple lines Authentication Requestmake request for something that is quite far away and requires a really long label to take all the space between the objectsvalidate credentialsAuthentication ResponseAnother authentication Requestdo it later storedAnother authentication Response +AlicelinebreakerBobdbqueueanoddservicewithanameinmultiple lines Authentication Requestmake request for something that is quite far away and requires a really long label to take all the space between the objectsvalidate credentialsAuthentication ResponseAnother authentication Requestdo it later storedAnother authentication Response - - - - - - - - + + + + + + + + scoreritemResponseitemessayRubricconceptitemOutcome getItem() itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) +scoreritemResponseitemessayRubricconceptitemOutcome getItem() itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) - - - - - - - - - - - - + + + + + + + + + + + + scoreritemResponseitemessayRubricconceptitemOutcome getItem() itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) +scoreritemResponseitemessayRubricconceptitemOutcome getItem() itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) - - - - - - - - - - - - + + + + + + + + + + + + a_shapea_sequenceanotherfinallysequencesequencesequencescoreritemResponseitemessayRubricconceptitemOutcomescorerconceptessayRubricitemitemOutcomeitemResponsescoreritemResponseitemessayRubricconceptitemOutcome getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts)getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) - - - - - - - - - - - - - - - - - - - - - - - - - +a_shapea_sequenceanotherfinallysequencesequencesequencescoreritemResponseitemessayRubricconceptitemOutcomescorerconceptessayRubricitemitemOutcomeitemResponsescoreritemResponseitemessayRubricconceptitemOutcome getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts)getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) + + + + + + + + + + + + + + + + + + + + + + + + + a_shapea_sequenceanotherfinallysequencesequencesequencescoreritemResponseitemessayRubricconceptitemOutcomescorerconceptessayRubricitemitemOutcomeitemResponsescoreritemResponseitemessayRubricconceptitemOutcome getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts)getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) - - - - - - - - - - - - - - - - - - - - - - - - - +a_shapea_sequenceanotherfinallysequencesequencesequencescoreritemResponseitemessayRubricconceptitemOutcomescorerconceptessayRubricitemitemOutcomeitemResponsescoreritemResponseitemessayRubricconceptitemOutcome getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts)getItem()itemgetRubric()rubricapplyTo(essayResp)match(essayResponse)scorenewgetNormalMinimum()getNormalMaximum()setScore(score)setFeedback(missingConcepts) + + + + + + + + + + + + + + + + + + + + + + + + + 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 - - - - - + + + + +