diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index fd95f04a1..e34faad22 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -23,6 +23,7 @@ - Code snippets use bold and italic font styles as determined by highlighter [#710](https://github.com/terrastruct/d2/issues/710), [#741](https://github.com/terrastruct/d2/issues/741) - Reduces default padding of shapes. [#702](https://github.com/terrastruct/d2/pull/702) - Ensures labels fit inside shapes with shape-specific inner bounding boxes. [#702](https://github.com/terrastruct/d2/pull/702) +- dagre container labels changed positions to outside the shape. Many previously obscured container labels are now legible. [#788](https://github.com/terrastruct/d2/pull/788) - Improves package shape dimensions with short height. [#702](https://github.com/terrastruct/d2/pull/702) - Keeps person shape from becoming too distorted. [#702](https://github.com/terrastruct/d2/pull/702) - Ensures shapes with icons have enough padding for their labels. [#702](https://github.com/terrastruct/d2/pull/702) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 7ac2a44e4..4e018b11f 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -104,6 +104,16 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err rootAttrs.rankdir = "TB" } + maxContainerLabelHeight := 0 + for _, obj := range g.Objects { + if len(obj.ChildrenArray) == 0 { + continue + } + if obj.LabelHeight != nil { + maxContainerLabelHeight = go2.Max(maxContainerLabelHeight, *obj.LabelHeight+label.PADDING) + } + } + maxLabelSize := 0 for _, edge := range g.Edges { size := edge.LabelDimensions.Width @@ -112,7 +122,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err } maxLabelSize = go2.Max(maxLabelSize, size) } - rootAttrs.ranksep = go2.Max(100, maxLabelSize+40) + rootAttrs.ranksep = go2.Max(go2.Max(100, maxLabelSize+40), maxContainerLabelHeight) configJS := setGraphAttrs(rootAttrs) if _, err := vm.RunString(configJS); err != nil { @@ -130,6 +140,9 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err if obj.Attributes.Shape.Value == d2target.ShapeImage || obj.Attributes.Icon != nil { height += float64(*obj.LabelHeight) + label.PADDING } + if len(obj.ChildrenArray) > 0 { + height += float64(*obj.LabelHeight) + label.PADDING + } } loadScript += generateAddNodeLine(id, int(obj.Width), int(height)) if obj.Parent != g.Root { @@ -191,7 +204,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err if obj.LabelWidth != nil && obj.LabelHeight != nil { if len(obj.ChildrenArray) > 0 { - obj.LabelPosition = go2.Pointer(string(label.InsideTopCenter)) + obj.LabelPosition = go2.Pointer(string(label.OutsideTopCenter)) } else if obj.Attributes.Shape.Value == d2target.ShapeImage { obj.LabelPosition = go2.Pointer(string(label.OutsideBottomCenter)) // remove the extra height we added to the node when passing to dagre @@ -248,6 +261,105 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err } } } + points = points[startIndex : endIndex+1] + points[0] = start + points[len(points)-1] = end + + edge.Route = points + } + + for _, obj := range g.Objects { + if obj.LabelHeight == nil || len(obj.ChildrenArray) <= 0 { + continue + } + + // usually you don't want to take away here more than what was added, which is the label height + // however, if the label height is more than the ranksep/2, we'll have no padding around children anymore + // so cap the amount taken off at ranksep/2 + subtract := float64(go2.Min(rootAttrs.ranksep/2, *obj.LabelHeight+label.PADDING)) + + obj.Height -= subtract + + // If the edge is connected to two descendants that are about to be downshifted, their whole route gets downshifted + movedEdges := make(map[*d2graph.Edge]struct{}) + for _, e := range g.Edges { + currSrc := e.Src + currDst := e.Dst + + isSrcDesc := false + isDstDesc := false + + for currSrc != nil { + if currSrc == obj { + isSrcDesc = true + break + } + currSrc = currSrc.Parent + } + for currDst != nil { + if currDst == obj { + isDstDesc = true + break + } + currDst = currDst.Parent + } + if isSrcDesc && isDstDesc { + stepSize := subtract + if e.Src != obj || e.Dst != obj { + stepSize /= 2. + } + movedEdges[e] = struct{}{} + for _, p := range e.Route { + p.Y += stepSize + } + } + } + + // Downshift descendents and edges that have one endpoint connected to a descendant + q := []*d2graph.Object{obj} + for len(q) > 0 { + curr := q[0] + q = q[1:] + + stepSize := subtract + // The object itself needs to move down the height it was just subtracted + // all descendents move half, to maintain vertical padding + if curr != obj { + stepSize /= 2. + } + curr.TopLeft.Y += stepSize + shouldMove := func(p *geo.Point) bool { + if curr != obj { + return true + } + // Edge should only move if it's not connected to the bottom side of the shrinking container + return p.Y != obj.TopLeft.Y+obj.Height + } + for _, e := range g.Edges { + if _, ok := movedEdges[e]; ok { + continue + } + if e.Src == curr { + if shouldMove(e.Route[0]) { + e.Route[0].Y += stepSize + } + } + if e.Dst == curr { + if shouldMove(e.Route[len(e.Route)-1]) { + e.Route[len(e.Route)-1].Y += stepSize + } + } + } + for _, c := range curr.ChildrenArray { + q = append(q, c) + } + } + } + + for _, edge := range g.Edges { + points := edge.Route + startIndex, endIndex := 0, len(points)-1 + start, end := points[startIndex], points[endIndex] // arrowheads can appear broken if segments are very short from dagre routing a point just outside the shape // to fix this, we try extending the previous segment into the shape instead of having a very short segment diff --git a/d2renderers/d2sketch/testdata/animated/sketch.exp.svg b/d2renderers/d2sketch/testdata/animated/sketch.exp.svg index 51a2b7396..921626327 100644 --- a/d2renderers/d2sketch/testdata/animated/sketch.exp.svg +++ b/d2renderers/d2sketch/testdata/animated/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="486" height="802" viewBox="-102 -102 486 802">aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + + ninety ninesixty fourthirty twosixteeneight + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/font_sizes_containers_large/elk/board.exp.json b/e2etests/testdata/stable/font_sizes_containers_large/elk/board.exp.json new file mode 100644 index 000000000..dcdae1536 --- /dev/null +++ b/e2etests/testdata/stable/font_sizes_containers_large/elk/board.exp.json @@ -0,0 +1,212 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "ninety nine", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 664, + "height": 656, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "ninety nine", + "fontSize": 99, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 452, + "labelHeight": 125, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "ninety nine.sixty four", + "type": "rectangle", + "pos": { + "x": 87, + "y": 87 + }, + "width": 514, + "height": 506, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "sixty four", + "fontSize": 64, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 246, + "labelHeight": 81, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "ninety nine.sixty four.thirty two", + "type": "rectangle", + "pos": { + "x": 162, + "y": 162 + }, + "width": 364, + "height": 356, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "thirty two", + "fontSize": 32, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 130, + "labelHeight": 41, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "ninety nine.sixty four.thirty two.sixteen", + "type": "rectangle", + "pos": { + "x": 237, + "y": 237 + }, + "width": 214, + "height": 206, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "sixteen", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 21, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 4 + }, + { + "id": "ninety nine.sixty four.thirty two.sixteen.eight", + "type": "rectangle", + "pos": { + "x": 312, + "y": 312 + }, + "width": 64, + "height": 56, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "eight", + "fontSize": 8, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 19, + "labelHeight": 11, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 5 + } + ], + "connections": [] +} diff --git a/e2etests/testdata/stable/font_sizes_containers_large/elk/sketch.exp.svg b/e2etests/testdata/stable/font_sizes_containers_large/elk/sketch.exp.svg new file mode 100644 index 000000000..1fe80d81c --- /dev/null +++ b/e2etests/testdata/stable/font_sizes_containers_large/elk/sketch.exp.svg @@ -0,0 +1,59 @@ + +ninety ninesixty fourthirty twosixteeneight + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/investigate/dagre/board.exp.json b/e2etests/testdata/stable/investigate/dagre/board.exp.json index dea71ae1c..454ed984d 100644 --- a/e2etests/testdata/stable/investigate/dagre/board.exp.json +++ b/e2etests/testdata/stable/investigate/dagre/board.exp.json @@ -130,10 +130,10 @@ "type": "rectangle", "pos": { "x": 9, - "y": 645 + "y": 686 }, "width": 430, - "height": 192, + "height": 151, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -162,7 +162,7 @@ "underline": false, "labelWidth": 29, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -171,7 +171,7 @@ "type": "diamond", "pos": { "x": 59, - "y": 695 + "y": 715 }, "width": 64, "height": 92, @@ -212,10 +212,10 @@ "type": "rectangle", "pos": { "x": 0, - "y": 1895 + "y": 1936 }, "width": 459, - "height": 373, + "height": 332, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -244,7 +244,7 @@ "underline": false, "labelWidth": 18, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -253,7 +253,7 @@ "type": "diamond", "pos": { "x": 303, - "y": 1945 + "y": 1965 }, "width": 66, "height": 92, @@ -294,7 +294,7 @@ "type": "diamond", "pos": { "x": 323, - "y": 695 + "y": 715 }, "width": 66, "height": 92, @@ -458,10 +458,10 @@ "type": "rectangle", "pos": { "x": 0, - "y": 2368 + "y": 2409 }, "width": 417, - "height": 347, + "height": 306, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -490,7 +490,7 @@ "underline": false, "labelWidth": 13, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -499,7 +499,7 @@ "type": "oval", "pos": { "x": 50, - "y": 2584 + "y": 2604 }, "width": 81, "height": 81, @@ -540,7 +540,7 @@ "type": "oval", "pos": { "x": 50, - "y": 2137 + "y": 2157 }, "width": 81, "height": 81, @@ -581,10 +581,10 @@ "type": "cylinder", "pos": { "x": 9, - "y": 3320 + "y": 3361 }, "width": 571, - "height": 166, + "height": 125, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -613,7 +613,7 @@ "underline": false, "labelWidth": 28, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -622,7 +622,7 @@ "type": "rectangle", "pos": { "x": 59, - "y": 3370 + "y": 3390 }, "width": 63, "height": 66, @@ -663,7 +663,7 @@ "type": "rectangle", "pos": { "x": 304, - "y": 2145 + "y": 2165 }, "width": 63, "height": 66, @@ -704,7 +704,7 @@ "type": "rectangle", "pos": { "x": 304, - "y": 2418 + "y": 2438 }, "width": 64, "height": 66, @@ -745,7 +745,7 @@ "type": "rectangle", "pos": { "x": 307, - "y": 2592 + "y": 2612 }, "width": 58, "height": 66, @@ -786,10 +786,10 @@ "type": "rectangle", "pos": { "x": 463, - "y": 1124 + "y": 1165 }, "width": 159, - "height": 166, + "height": 125, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -818,7 +818,7 @@ "underline": false, "labelWidth": 23, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -827,7 +827,7 @@ "type": "rectangle", "pos": { "x": 514, - "y": 1174 + "y": 1194 }, "width": 58, "height": 66, @@ -868,10 +868,10 @@ "type": "rectangle", "pos": { "x": 461, - "y": 1390 + "y": 1431 }, "width": 163, - "height": 166, + "height": 125, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -900,7 +900,7 @@ "underline": false, "labelWidth": 27, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -909,7 +909,7 @@ "type": "rectangle", "pos": { "x": 511, - "y": 1440 + "y": 1460 }, "width": 63, "height": 66, @@ -1043,7 +1043,7 @@ "type": "rectangle", "pos": { "x": 246, - "y": 3370 + "y": 3390 }, "width": 62, "height": 66, @@ -1084,10 +1084,10 @@ "type": "rectangle", "pos": { "x": 317, - "y": 2815 + "y": 2856 }, "width": 321, - "height": 405, + "height": 364, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -1116,7 +1116,7 @@ "underline": false, "labelWidth": 27, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -1125,7 +1125,7 @@ "type": "queue", "pos": { "x": 430, - "y": 2865 + "y": 2885 }, "width": 138, "height": 118, @@ -1177,7 +1177,7 @@ "type": "rectangle", "pos": { "x": 468, - "y": 3104 + "y": 3124 }, "width": 63, "height": 66, @@ -1218,7 +1218,7 @@ "type": "rectangle", "pos": { "x": 468, - "y": 3370 + "y": 3390 }, "width": 62, "height": 66, @@ -1476,11 +1476,11 @@ }, { "x": 90.6, - "y": 655 + "y": 659.2 }, { "x": 91, - "y": 695 + "y": 716 } ], "isCurve": true, @@ -1739,12 +1739,12 @@ "y": 1810.6 }, { - "x": 270.6, - "y": 1909.8 + "x": 270.2, + "y": 1914.6 }, { - "x": 318, - "y": 1969 + "x": 316, + "y": 1993 } ], "isCurve": true, @@ -1788,11 +1788,11 @@ }, { "x": 356.2, - "y": 655 + "y": 659.2 }, { "x": 356, - "y": 695 + "y": 716 } ], "isCurve": true, @@ -1828,11 +1828,11 @@ "route": [ { "x": 91, - "y": 787 + "y": 808 }, { "x": 90.6, - "y": 827 + "y": 831.2 }, { "x": 90.5, @@ -2052,11 +2052,11 @@ }, { "x": 90.6, - "y": 2097 + "y": 2101.2 }, { "x": 91, - "y": 2137 + "y": 2158 } ], "isCurve": true, @@ -2092,11 +2092,11 @@ "route": [ { "x": 91, - "y": 2218 + "y": 2239 }, { "x": 90.6, - "y": 2258 + "y": 2262.2 }, { "x": 90.5, @@ -2136,11 +2136,11 @@ }, { "x": 90.6, - "y": 2544 + "y": 2548.2 }, { "x": 91, - "y": 2584 + "y": 2605 } ], "isCurve": true, @@ -2176,11 +2176,11 @@ "route": [ { "x": 91, - "y": 2665 + "y": 2686 }, { "x": 90.6, - "y": 2705 + "y": 2709.2 }, { "x": 90.5, @@ -2268,11 +2268,11 @@ }, { "x": 90.5, - "y": 3330 + "y": 3334.1 }, { "x": 90.5, - "y": 3370 + "y": 3390.5 } ], "isCurve": true, @@ -2308,19 +2308,19 @@ "route": [ { "x": 336, - "y": 2037 + "y": 2058 }, { "x": 335.8, - "y": 2077 + "y": 2097.6 }, { "x": 335.75, - "y": 2098.5 + "y": 2119 }, { "x": 335.75, - "y": 2144.5 + "y": 2165 } ], "isCurve": true, @@ -2356,11 +2356,11 @@ "route": [ { "x": 335.75, - "y": 2211.5 + "y": 2232 }, { "x": 335.75, - "y": 2256.7 + "y": 2260.8 }, { "x": 335.75, @@ -2376,11 +2376,11 @@ }, { "x": 335.75, - "y": 2378 + "y": 2382.1 }, { "x": 335.75, - "y": 2418 + "y": 2438.5 } ], "isCurve": true, @@ -2416,19 +2416,19 @@ "route": [ { "x": 335.75, - "y": 2484 + "y": 2504.5 }, { "x": 335.75, - "y": 2524 + "y": 2544.5 }, { "x": 335.75, - "y": 2545.5 + "y": 2566 }, { "x": 335.75, - "y": 2591.5 + "y": 2612 } ], "isCurve": true, @@ -2464,11 +2464,11 @@ "route": [ { "x": 356, - "y": 787 + "y": 807 }, { "x": 356.2, - "y": 827 + "y": 831 }, { "x": 393.55, @@ -2508,11 +2508,11 @@ }, { "x": 542.75, - "y": 1134 + "y": 1138.1 }, { "x": 542.75, - "y": 1174 + "y": 1194.5 } ], "isCurve": true, @@ -2548,11 +2548,11 @@ "route": [ { "x": 542.75, - "y": 1240 + "y": 1260.5 }, { "x": 542.75, - "y": 1280 + "y": 1284.1 }, { "x": 542.75, @@ -2568,11 +2568,11 @@ }, { "x": 542.75, - "y": 1400 + "y": 1404.1 }, { "x": 542.75, - "y": 1440 + "y": 1460.5 } ], "isCurve": true, @@ -2656,11 +2656,11 @@ "route": [ { "x": 542.75, - "y": 1506 + "y": 1526.5 }, { "x": 542.75, - "y": 1546 + "y": 1550.1 }, { "x": 538.6, @@ -2940,11 +2940,11 @@ }, { "x": 277, - "y": 3330 + "y": 3334.1 }, { "x": 277, - "y": 3370 + "y": 3390.5 } ], "isCurve": true, @@ -2980,11 +2980,11 @@ "route": [ { "x": 335.75, - "y": 2658.5 + "y": 2679 }, { "x": 335.75, - "y": 2703.7 + "y": 2707.8 }, { "x": 351.9, @@ -3000,11 +3000,11 @@ }, { "x": 424.2, - "y": 2825 + "y": 2829.2 }, { "x": 455, - "y": 2865 + "y": 2886 } ], "isCurve": true, @@ -3060,11 +3060,11 @@ }, { "x": 553.4, - "y": 2825 + "y": 2829.2 }, { "x": 532, - "y": 2865 + "y": 2886 } ], "isCurve": true, @@ -3100,19 +3100,19 @@ "route": [ { "x": 499, - "y": 2983 + "y": 3004 }, { "x": 499, - "y": 3031.4 + "y": 3052 }, { "x": 499, - "y": 3055.7 + "y": 3076.2 }, { "x": 499, - "y": 3104.5 + "y": 3125 } ], "isCurve": true, @@ -3148,11 +3148,11 @@ "route": [ { "x": 499, - "y": 3170 + "y": 3190.5 }, { "x": 499, - "y": 3210 + "y": 3214.1 }, { "x": 499, @@ -3168,11 +3168,11 @@ }, { "x": 499, - "y": 3330 + "y": 3334.1 }, { "x": 499, - "y": 3370 + "y": 3390.5 } ], "isCurve": true, @@ -3208,11 +3208,11 @@ "route": [ { "x": 499, - "y": 3436 + "y": 3456.5 }, { "x": 499, - "y": 3476 + "y": 3480.1 }, { "x": 499, @@ -3263,12 +3263,12 @@ "y": 1822.4 }, { - "x": 388.8, - "y": 1909.4 + "x": 389.2, + "y": 1914.4 }, { - "x": 352, - "y": 1967 + "x": 354, + "y": 1992 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/investigate/dagre/sketch.exp.svg b/e2etests/testdata/stable/investigate/dagre/sketch.exp.svg index 1403b8bc1..6ea9dba05 100644 --- a/e2etests/testdata/stable/investigate/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/investigate/dagre/sketch.exp.svg @@ -39,14 +39,14 @@ width="842" height="3856" viewBox="-102 -102 842 3856">container

they did it in style

-

a header

+container

they did it in style

+

a header

a line of text and an

{
 	indented: "block",
@@ -805,8 +805,8 @@ width="516" height="686" viewBox="-102 -102 516 686">markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
- +
+ markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
- +
+ abcd + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/child_parent_edges/elk/board.exp.json b/e2etests/testdata/todo/child_parent_edges/elk/board.exp.json new file mode 100644 index 000000000..987db0ad6 --- /dev/null +++ b/e2etests/testdata/todo/child_parent_edges/elk/board.exp.json @@ -0,0 +1,297 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 514, + "height": 621, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.b", + "type": "rectangle", + "pos": { + "x": 87, + "y": 87 + }, + "width": 364, + "height": 471, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.b.c", + "type": "rectangle", + "pos": { + "x": 172, + "y": 162 + }, + "width": 204, + "height": 216, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 9, + "labelHeight": 26, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "a.b.c.d", + "type": "rectangle", + "pos": { + "x": 247, + "y": 237 + }, + "width": 54, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 4 + } + ], + "connections": [ + { + "id": "(a.b -> a)[0]", + "src": "a.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "a", + "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": 162, + "y": 558 + }, + { + "x": 162, + "y": 633 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "a.(b -> b.c)[0]", + "src": "a.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.b.c", + "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": 247, + "y": 87 + }, + { + "x": 247, + "y": 162 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "a.(b.c.d -> b)[0]", + "src": "a.b.c.d", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.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": 274, + "y": 303 + }, + { + "x": 274, + "y": 433 + }, + { + "x": 162, + "y": 433 + }, + { + "x": 162, + "y": 87 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/child_parent_edges/elk/sketch.exp.svg b/e2etests/testdata/todo/child_parent_edges/elk/sketch.exp.svg new file mode 100644 index 000000000..0a488aa47 --- /dev/null +++ b/e2etests/testdata/todo/child_parent_edges/elk/sketch.exp.svg @@ -0,0 +1,59 @@ + +abcd + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/container_child_edge/dagre/board.exp.json b/e2etests/testdata/todo/container_child_edge/dagre/board.exp.json index 783d0cfdf..dba65a4d4 100644 --- a/e2etests/testdata/todo/container_child_edge/dagre/board.exp.json +++ b/e2etests/testdata/todo/container_child_edge/dagre/board.exp.json @@ -7,10 +7,10 @@ "type": "rectangle", "pos": { "x": 0, - "y": 0 + "y": 41 }, "width": 220, - "height": 353, + "height": 312, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -39,7 +39,7 @@ "underline": false, "labelWidth": 112, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -48,7 +48,7 @@ "type": "rectangle", "pos": { "x": 73, - "y": 50 + "y": 70 }, "width": 75, "height": 66, @@ -89,7 +89,7 @@ "type": "rectangle", "pos": { "x": 63, - "y": 237 + "y": 257 }, "width": 95, "height": 66, @@ -154,19 +154,19 @@ "route": [ { "x": 98.16176470588235, - "y": 116 + "y": 136.5 }, { "x": 80.43235294117648, - "y": 164.4 + "y": 184.9 }, { "x": 80.4, - "y": 188.7 + "y": 209.2 }, { "x": 98, - "y": 237.5 + "y": 258 } ], "isCurve": true, @@ -202,19 +202,19 @@ "route": [ { "x": 122.33823529411765, - "y": 116 + "y": 136.5 }, { "x": 140.06764705882352, - "y": 164.4 + "y": 184.9 }, { "x": 140.1, - "y": 188.7 + "y": 209.2 }, { "x": 122.5, - "y": 237.5 + "y": 258 } ], "isCurve": true, diff --git a/e2etests/testdata/todo/container_child_edge/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_child_edge/dagre/sketch.exp.svg index dea408f3c..d9dc7645b 100644 --- a/e2etests/testdata/todo/container_child_edge/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/container_child_edge/dagre/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="424" height="557" viewBox="-102 -102 424 557">Big fontabca + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/container_icon_label/elk/board.exp.json b/e2etests/testdata/todo/container_icon_label/elk/board.exp.json new file mode 100644 index 000000000..d1347e8a9 --- /dev/null +++ b/e2etests/testdata/todo/container_icon_label/elk/board.exp.json @@ -0,0 +1,302 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 353, + "height": 698, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": { + "Scheme": "https", + "Opaque": "", + "User": null, + "Host": "icons.terrastruct.com", + "Path": "/essentials/004-picture.svg", + "RawPath": "", + "ForceQuery": false, + "RawQuery": "", + "Fragment": "", + "RawFragment": "" + }, + "iconPosition": "INSIDE_MIDDLE_CENTER", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "Big font", + "fontSize": 30, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 96, + "labelHeight": 38, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.a", + "type": "rectangle", + "pos": { + "x": 87, + "y": 87 + }, + "width": 203, + "height": 216, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.b", + "type": "rectangle", + "pos": { + "x": 162, + "y": 403 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.c", + "type": "rectangle", + "pos": { + "x": 162, + "y": 569 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.a.a", + "type": "rectangle", + "pos": { + "x": 162, + "y": 162 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 3 + } + ], + "connections": [ + { + "id": "a.(a -> b)[0]", + "src": "a.a", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.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": 188.5, + "y": 303 + }, + { + "x": 188.5, + "y": 403 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "a.(b -> c)[0]", + "src": "a.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.c", + "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": 188.5, + "y": 469 + }, + { + "x": 188.5, + "y": 569 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_icon_label/elk/sketch.exp.svg b/e2etests/testdata/todo/container_icon_label/elk/sketch.exp.svg new file mode 100644 index 000000000..c37c34e2e --- /dev/null +++ b/e2etests/testdata/todo/container_icon_label/elk/sketch.exp.svg @@ -0,0 +1,59 @@ + +Big fontabca + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/container_label_loop/dagre/board.exp.json b/e2etests/testdata/todo/container_label_loop/dagre/board.exp.json new file mode 100644 index 000000000..8877ccf79 --- /dev/null +++ b/e2etests/testdata/todo/container_label_loop/dagre/board.exp.json @@ -0,0 +1,263 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 0, + "y": 41 + }, + "width": 193, + "height": 291, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "If we were meant to fly, we wouldn't keep losing our luggage", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 702, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.b", + "type": "rectangle", + "pos": { + "x": 50, + "y": 70 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.c", + "type": "rectangle", + "pos": { + "x": 50, + "y": 236 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + } + ], + "connections": [ + { + "id": "a.(b -> c)[0]", + "src": "a.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.c", + "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": 76.5, + "y": 136.5 + }, + { + "x": 76.5, + "y": 176.5 + }, + { + "x": 76.5, + "y": 196.5 + }, + { + "x": 76.5, + "y": 236.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a -> a)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "a", + "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": 103, + "y": 109.38440111420613 + }, + { + "x": 129.66666666666669, + "y": 94.67688022284122 + }, + { + "x": 138, + "y": 91 + }, + { + "x": 140.5, + "y": 91 + }, + { + "x": 143, + "y": 91 + }, + { + "x": 146.33333333333331, + "y": 97.6 + }, + { + "x": 148.83333333333331, + "y": 107.5 + }, + { + "x": 151.33333333333334, + "y": 117.4 + }, + { + "x": 151.33333333333334, + "y": 130.6 + }, + { + "x": 148.83333333333331, + "y": 140.5 + }, + { + "x": 146.33333333333331, + "y": 150.4 + }, + { + "x": 129.66666666666669, + "y": 153.32311977715878 + }, + { + "x": 103, + "y": 138.61559888579387 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_label_loop/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_label_loop/dagre/sketch.exp.svg new file mode 100644 index 000000000..1ea5a9824 --- /dev/null +++ b/e2etests/testdata/todo/container_label_loop/dagre/sketch.exp.svg @@ -0,0 +1,59 @@ + +If we were meant to fly, we wouldn't keep losing our luggagebc + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/container_label_loop/elk/board.exp.json b/e2etests/testdata/todo/container_label_loop/elk/board.exp.json new file mode 100644 index 000000000..9e87e945d --- /dev/null +++ b/e2etests/testdata/todo/container_label_loop/elk/board.exp.json @@ -0,0 +1,217 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 62, + "y": 12 + }, + "width": 203, + "height": 382, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "If we were meant to fly, we wouldn't keep losing our luggage", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 702, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.b", + "type": "rectangle", + "pos": { + "x": 137, + "y": 87 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.c", + "type": "rectangle", + "pos": { + "x": 137, + "y": 253 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + } + ], + "connections": [ + { + "id": "a.(b -> c)[0]", + "src": "a.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.c", + "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": 163.5, + "y": 153 + }, + { + "x": 163.5, + "y": 253 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a -> a)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "a", + "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": 62, + "y": 139.33333333333331 + }, + { + "x": 12, + "y": 139.33333333333331 + }, + { + "x": 12, + "y": 266.66666666666663 + }, + { + "x": 62, + "y": 266.66666666666663 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_label_loop/elk/sketch.exp.svg b/e2etests/testdata/todo/container_label_loop/elk/sketch.exp.svg new file mode 100644 index 000000000..95bc08d82 --- /dev/null +++ b/e2etests/testdata/todo/container_label_loop/elk/sketch.exp.svg @@ -0,0 +1,59 @@ + +If we were meant to fly, we wouldn't keep losing our luggagebc + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/shape_set_width_height/dagre/board.exp.json b/e2etests/testdata/todo/shape_set_width_height/dagre/board.exp.json index 3582b4b80..391bd4924 100644 --- a/e2etests/testdata/todo/shape_set_width_height/dagre/board.exp.json +++ b/e2etests/testdata/todo/shape_set_width_height/dagre/board.exp.json @@ -7,10 +7,10 @@ "type": "rectangle", "pos": { "x": 0, - "y": 0 + "y": 41 }, "width": 1112, - "height": 456, + "height": 415, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -39,7 +39,7 @@ "underline": false, "labelWidth": 123, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -48,10 +48,10 @@ "type": "oval", "pos": { "x": 40, - "y": 50 + "y": 106 }, "width": 228, - "height": 356, + "height": 320, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -80,7 +80,7 @@ "underline": false, "labelWidth": 156, "labelHeight": 31, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 2 }, @@ -89,7 +89,7 @@ "type": "diamond", "pos": { "x": 90, - "y": 196 + "y": 234 }, "width": 128, "height": 64, @@ -130,10 +130,10 @@ "type": "diamond", "pos": { "x": 308, - "y": 50 + "y": 106 }, "width": 228, - "height": 356, + "height": 320, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -162,7 +162,7 @@ "underline": false, "labelWidth": 192, "labelHeight": 31, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 2 }, @@ -171,7 +171,7 @@ "type": "oval", "pos": { "x": 358, - "y": 164 + "y": 202 }, "width": 128, "height": 128, @@ -212,10 +212,10 @@ "type": "oval", "pos": { "x": 576, - "y": 50 + "y": 106 }, "width": 228, - "height": 356, + "height": 320, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -244,7 +244,7 @@ "underline": false, "labelWidth": 144, "labelHeight": 31, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 2 }, @@ -253,7 +253,7 @@ "type": "hexagon", "pos": { "x": 626, - "y": 196 + "y": 234 }, "width": 128, "height": 64, @@ -294,10 +294,10 @@ "type": "hexagon", "pos": { "x": 844, - "y": 50 + "y": 106 }, "width": 228, - "height": 356, + "height": 320, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -326,7 +326,7 @@ "underline": false, "labelWidth": 188, "labelHeight": 31, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 2 }, @@ -335,7 +335,7 @@ "type": "oval", "pos": { "x": 894, - "y": 196 + "y": 234 }, "width": 128, "height": 64, diff --git a/e2etests/testdata/todo/shape_set_width_height/dagre/sketch.exp.svg b/e2etests/testdata/todo/shape_set_width_height/dagre/sketch.exp.svg index 99f781516..c807e2b94 100644 --- a/e2etests/testdata/todo/shape_set_width_height/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/shape_set_width_height/dagre/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="2482" height="2672" viewBox="-102 -102 2482 2672">containerscloudtall cylinderclass- +containerscloudtall cylinderclass- num int- timeout @@ -823,8 +823,8 @@ width="2482" height="2672" viewBox="-102 -102 2482 2672">