diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 75018b871..72368861f 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -15,3 +15,4 @@ - Fixes a regression where PNG backgrounds could be cut off in the appendix. [#941](https://github.com/terrastruct/d2/pull/941) - Fixes zooming not working in watch mode. [#944](https://github.com/terrastruct/d2/pull/944) - [API] Fixes `DeleteIDDeltas` giving duplicate deltas in rare cases. [#957](https://github.com/terrastruct/d2/pull/957) +- Fixes insufficient vertical padding in dagre with direction: right/left. [#973](https://github.com/terrastruct/d2/pull/973) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 1c4793928..be2f69998 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -109,6 +109,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err maxContainerLabelHeight := 0 for _, obj := range g.Objects { + // TODO count root level container label sizes for ranksep if len(obj.ChildrenArray) == 0 || obj.Parent == g.Root { continue } @@ -126,15 +127,25 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err } } - maxLabelSize := 0 + maxLabelWidth := 0 + maxLabelHeight := 0 for _, edge := range g.Edges { - size := edge.LabelDimensions.Width - if !isHorizontal { - size = edge.LabelDimensions.Height - } - maxLabelSize = go2.Max(maxLabelSize, size) + width := edge.LabelDimensions.Width + height := edge.LabelDimensions.Height + maxLabelWidth = go2.Max(maxLabelWidth, width) + maxLabelHeight = go2.Max(maxLabelHeight, height) + } + + if !isHorizontal { + rootAttrs.ranksep = go2.Max(go2.Max(100, maxLabelHeight+40), maxContainerLabelHeight) + } else { + rootAttrs.ranksep = go2.Max(100, maxLabelWidth+40) + // use existing config + rootAttrs.NodeSep = rootAttrs.EdgeSep + // configure vertical padding + rootAttrs.EdgeSep = go2.Max(maxLabelHeight+40, maxContainerLabelHeight) + // Note: non-containers have both of these as padding (rootAttrs.NodeSep + rootAttrs.EdgeSep) } - rootAttrs.ranksep = go2.Max(go2.Max(100, maxLabelSize+40), maxContainerLabelHeight) configJS := setGraphAttrs(rootAttrs) if _, err := vm.RunString(configJS); err != nil { @@ -286,7 +297,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err } for _, obj := range g.Objects { - if obj.LabelHeight == nil || len(obj.ChildrenArray) <= 0 { + if obj.LabelHeight == nil || len(obj.ChildrenArray) == 0 { continue } diff --git a/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf b/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf index 28e876399..3f3ede9ee 100644 Binary files a/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf and b/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf differ diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index f9628c79e..5f3794027 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -669,6 +669,28 @@ x -> hey -> y { name: "font_sizes_containers_large", script: ` +ninety nine: { + style.font-size: 99 + sixty four: { + style.font-size: 64 + thirty two:{ + style.font-size: 32 + sixteen: { + style.font-size: 16 + eight: { + style.font-size: 8 + } + } + } + } +} +`, + }, + { + name: "font_sizes_containers_large_right", + script: ` +direction: right + ninety nine: { style.font-size: 99 sixty four: { diff --git a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json index 743963d16..dc411adb2 100644 --- a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json +++ b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json @@ -11,7 +11,7 @@ "y": 41 }, "width": 2328, - "height": 116, + "height": 117, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -49,7 +49,7 @@ "type": "rectangle", "pos": { "x": 105, - "y": 60 + "y": 61 }, "width": 270, "height": 77, @@ -90,7 +90,7 @@ "type": "rectangle", "pos": { "x": 638, - "y": 60 + "y": 61 }, "width": 209, "height": 77, @@ -131,7 +131,7 @@ "type": "rectangle", "pos": { "x": 1194, - "y": 60 + "y": 61 }, "width": 71, "height": 77, @@ -172,7 +172,7 @@ "type": "rectangle", "pos": { "x": 1593, - "y": 60 + "y": 61 }, "width": 158, "height": 77, @@ -213,7 +213,7 @@ "type": "rectangle", "pos": { "x": 2129, - "y": 60 + "y": 61 }, "width": 95, "height": 77, @@ -279,19 +279,19 @@ "route": [ { "x": 375.5, - "y": 99 + "y": 99.5 }, { "x": 479.9, - "y": 99 + "y": 99.5 }, { "x": 532.3, - "y": 99 + "y": 99.5 }, { "x": 637.5, - "y": 99 + "y": 99.5 } ], "isCurve": true, @@ -328,19 +328,19 @@ "route": [ { "x": 846.5, - "y": 99 + "y": 99.5 }, { "x": 985.3, - "y": 99 + "y": 99.5 }, { "x": 1054.7, - "y": 99 + "y": 99.5 }, { "x": 1193.5, - "y": 99 + "y": 99.5 } ], "isCurve": true, @@ -377,19 +377,19 @@ "route": [ { "x": 1265.5, - "y": 99 + "y": 99.5 }, { "x": 1395.9, - "y": 99 + "y": 99.5 }, { "x": 1461.3, - "y": 99 + "y": 99.5 }, { "x": 1592.5, - "y": 99 + "y": 99.5 } ], "isCurve": true, @@ -426,19 +426,19 @@ "route": [ { "x": 1751.5, - "y": 99 + "y": 99.5 }, { "x": 1901.9, - "y": 99 + "y": 99.5 }, { "x": 1977.3, - "y": 99 + "y": 99.5 }, { "x": 2128.5, - "y": 99 + "y": 99.5 } ], "isCurve": true, diff --git a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg index 0d2e22868..6bd8241a8 100644 --- a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg @@ -1,4 +1,4 @@ -lambda-build.yamlPush to main branchGitHub ActionsS3TerraformAWS TriggersBuilds zip & pushes it Pulls zip to deployChanges the live lambdas - +.fill-N1{fill:#0A0F25;}.fill-N2{fill:#676C7E;}.fill-N3{fill:#9499AB;}.fill-N4{fill:#CFD2DD;}.fill-N5{fill:#DEE1EB;}.fill-N6{fill:#EEF1F8;}.fill-N7{fill:#FFFFFF;}.fill-B1{fill:#0D32B2;}.fill-B2{fill:#0D32B2;}.fill-B3{fill:#E3E9FD;}.fill-B4{fill:#E3E9FD;}.fill-B5{fill:#EDF0FD;}.fill-B6{fill:#F7F8FE;}.fill-AA2{fill:#4A6FF3;}.fill-AA4{fill:#EDF0FD;}.fill-AA5{fill:#F7F8FE;}.fill-AB4{fill:#EDF0FD;}.fill-AB5{fill:#F7F8FE;}.stroke-N1{stroke:#0A0F25;}.stroke-N2{stroke:#676C7E;}.stroke-N3{stroke:#9499AB;}.stroke-N4{stroke:#CFD2DD;}.stroke-N5{stroke:#DEE1EB;}.stroke-N6{stroke:#EEF1F8;}.stroke-N7{stroke:#FFFFFF;}.stroke-B1{stroke:#0D32B2;}.stroke-B2{stroke:#0D32B2;}.stroke-B3{stroke:#E3E9FD;}.stroke-B4{stroke:#E3E9FD;}.stroke-B5{stroke:#EDF0FD;}.stroke-B6{stroke:#F7F8FE;}.stroke-AA2{stroke:#4A6FF3;}.stroke-AA4{stroke:#EDF0FD;}.stroke-AA5{stroke:#F7F8FE;}.stroke-AB4{stroke:#EDF0FD;}.stroke-AB5{stroke:#F7F8FE;}.background-color-N1{background-color:#0A0F25;}.background-color-N2{background-color:#676C7E;}.background-color-N3{background-color:#9499AB;}.background-color-N4{background-color:#CFD2DD;}.background-color-N5{background-color:#DEE1EB;}.background-color-N6{background-color:#EEF1F8;}.background-color-N7{background-color:#FFFFFF;}.background-color-B1{background-color:#0D32B2;}.background-color-B2{background-color:#0D32B2;}.background-color-B3{background-color:#E3E9FD;}.background-color-B4{background-color:#E3E9FD;}.background-color-B5{background-color:#EDF0FD;}.background-color-B6{background-color:#F7F8FE;}.background-color-AA2{background-color:#4A6FF3;}.background-color-AA4{background-color:#EDF0FD;}.background-color-AA5{background-color:#F7F8FE;}.background-color-AB4{background-color:#EDF0FD;}.background-color-AB5{background-color:#F7F8FE;}.color-N1{color:#0A0F25;}.color-N2{color:#676C7E;}.color-N3{color:#9499AB;}.color-N4{color:#CFD2DD;}.color-N5{color:#DEE1EB;}.color-N6{color:#EEF1F8;}.color-N7{color:#FFFFFF;}.color-B1{color:#0D32B2;}.color-B2{color:#0D32B2;}.color-B3{color:#E3E9FD;}.color-B4{color:#E3E9FD;}.color-B5{color:#EDF0FD;}.color-B6{color:#F7F8FE;}.color-AA2{color:#4A6FF3;}.color-AA4{color:#EDF0FD;}.color-AA5{color:#F7F8FE;}.color-AB4{color:#EDF0FD;}.color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>lambda-build.yamlPush to main branchGitHub ActionsS3TerraformAWS TriggersBuilds zip & pushes it Pulls zip to deployChanges the live lambdas + diff --git a/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/board.exp.json b/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/board.exp.json index 3fbf6da18..ea7cbd886 100644 --- a/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/board.exp.json +++ b/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/board.exp.json @@ -8,7 +8,7 @@ "type": "rectangle", "pos": { "x": 0, - "y": 60 + "y": 87 }, "width": 53, "height": 66, @@ -49,7 +49,7 @@ "type": "rectangle", "pos": { "x": 0, - "y": 392 + "y": 453 }, "width": 53, "height": 66, @@ -90,7 +90,7 @@ "type": "rectangle", "pos": { "x": 0, - "y": 226 + "y": 270 }, "width": 53, "height": 66, @@ -131,10 +131,10 @@ "type": "rectangle", "pos": { "x": 153, - "y": 61 + "y": 81 }, "width": 153, - "height": 437, + "height": 468, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -172,7 +172,7 @@ "type": "rectangle", "pos": { "x": 203, - "y": 246 + "y": 290 }, "width": 53, "height": 66, @@ -213,7 +213,7 @@ "type": "rectangle", "pos": { "x": 203, - "y": 80 + "y": 107 }, "width": 53, "height": 66, @@ -254,7 +254,7 @@ "type": "rectangle", "pos": { "x": 203, - "y": 412 + "y": 473 }, "width": 53, "height": 66, @@ -295,10 +295,10 @@ "type": "rectangle", "pos": { "x": 406, - "y": 61 + "y": 81 }, "width": 153, - "height": 105, + "height": 102, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -336,7 +336,7 @@ "type": "rectangle", "pos": { "x": 456, - "y": 80 + "y": 107 }, "width": 53, "height": 66, @@ -377,10 +377,10 @@ "type": "rectangle", "pos": { "x": 406, - "y": 393 + "y": 447 }, "width": 153, - "height": 105, + "height": 102, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -418,7 +418,7 @@ "type": "rectangle", "pos": { "x": 456, - "y": 412 + "y": 473 }, "width": 53, "height": 66, @@ -459,10 +459,10 @@ "type": "rectangle", "pos": { "x": 406, - "y": 227 + "y": 264 }, "width": 153, - "height": 105, + "height": 102, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -500,7 +500,7 @@ "type": "rectangle", "pos": { "x": 456, - "y": 246 + "y": 290 }, "width": 53, "height": 66, @@ -541,10 +541,10 @@ "type": "rectangle", "pos": { "x": 659, - "y": 61 + "y": 81 }, "width": 153, - "height": 271, + "height": 285, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -582,7 +582,7 @@ "type": "rectangle", "pos": { "x": 709, - "y": 80 + "y": 107 }, "width": 53, "height": 66, @@ -623,7 +623,7 @@ "type": "rectangle", "pos": { "x": 709, - "y": 246 + "y": 290 }, "width": 53, "height": 66, @@ -664,10 +664,10 @@ "type": "rectangle", "pos": { "x": 659, - "y": 393 + "y": 447 }, "width": 153, - "height": 105, + "height": 102, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -705,7 +705,7 @@ "type": "rectangle", "pos": { "x": 709, - "y": 412 + "y": 473 }, "width": 53, "height": 66, @@ -749,7 +749,7 @@ "y": 41 }, "width": 253, - "height": 477, + "height": 548, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -787,10 +787,10 @@ "type": "rectangle", "pos": { "x": 962, - "y": 76 + "y": 96 }, "width": 153, - "height": 110, + "height": 107, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -828,7 +828,7 @@ "type": "rectangle", "pos": { "x": 1012, - "y": 98 + "y": 125 }, "width": 53, "height": 66, @@ -869,10 +869,10 @@ "type": "rectangle", "pos": { "x": 962, - "y": 242 + "y": 279 }, "width": 153, - "height": 110, + "height": 107, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -910,7 +910,7 @@ "type": "rectangle", "pos": { "x": 1012, - "y": 264 + "y": 308 }, "width": 53, "height": 66, @@ -951,10 +951,10 @@ "type": "rectangle", "pos": { "x": 962, - "y": 408 + "y": 462 }, "width": 153, - "height": 110, + "height": 107, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -992,7 +992,7 @@ "type": "rectangle", "pos": { "x": 1012, - "y": 430 + "y": 491 }, "width": 53, "height": 66, @@ -1058,19 +1058,19 @@ "route": [ { "x": 53, - "y": 259 + "y": 303 }, { "x": 93, - "y": 259 + "y": 303 }, { "x": 163, - "y": 263.1 + "y": 307.1 }, { "x": 203, - "y": 279.5 + "y": 323.5 } ], "isCurve": true, @@ -1107,19 +1107,19 @@ "route": [ { "x": 53, - "y": 93 + "y": 120 }, { "x": 93, - "y": 93 + "y": 120 }, { "x": 163, - "y": 97.1 + "y": 124.1 }, { "x": 203, - "y": 113.5 + "y": 140.5 } ], "isCurve": true, @@ -1156,19 +1156,19 @@ "route": [ { "x": 53, - "y": 425 + "y": 486 }, { "x": 93, - "y": 425 + "y": 486 }, { "x": 163, - "y": 429.1 + "y": 490.1 }, { "x": 203, - "y": 445.5 + "y": 506.5 } ], "isCurve": true, @@ -1205,31 +1205,31 @@ "route": [ { "x": 256, - "y": 113.5 + "y": 140.5 }, { "x": 296, - "y": 113.5 + "y": 140.5 }, { "x": 316, - "y": 113.5 + "y": 140.5 }, { "x": 331, - "y": 113.5 + "y": 140.5 }, { "x": 346, - "y": 113.5 + "y": 140.5 }, { "x": 416, - "y": 113.5 + "y": 140.5 }, { "x": 456, - "y": 113.5 + "y": 140.5 } ], "isCurve": true, @@ -1266,31 +1266,31 @@ "route": [ { "x": 256, - "y": 445.5 + "y": 506.5 }, { "x": 296, - "y": 445.5 + "y": 506.5 }, { "x": 316, - "y": 445.5 + "y": 506.5 }, { "x": 331, - "y": 445.5 + "y": 506.5 }, { "x": 346, - "y": 445.5 + "y": 506.5 }, { "x": 416, - "y": 445.5 + "y": 506.5 }, { "x": 456, - "y": 445.5 + "y": 506.5 } ], "isCurve": true, @@ -1327,31 +1327,31 @@ "route": [ { "x": 256, - "y": 279.5 + "y": 323.5 }, { "x": 296, - "y": 279.5 + "y": 323.5 }, { "x": 316, - "y": 279.5 + "y": 323.5 }, { "x": 331, - "y": 279.5 + "y": 323.5 }, { "x": 346, - "y": 279.5 + "y": 323.5 }, { "x": 416, - "y": 279.5 + "y": 323.5 }, { "x": 456, - "y": 279.5 + "y": 323.5 } ], "isCurve": true, @@ -1388,31 +1388,31 @@ "route": [ { "x": 509, - "y": 113.5 + "y": 140.5 }, { "x": 549, - "y": 113.5 + "y": 140.5 }, { "x": 569, - "y": 113.5 + "y": 140.5 }, { "x": 584, - "y": 113.5 + "y": 140.5 }, { "x": 599, - "y": 113.5 + "y": 140.5 }, { "x": 669, - "y": 113.5 + "y": 140.5 }, { "x": 709, - "y": 113.5 + "y": 140.5 } ], "isCurve": true, @@ -1449,31 +1449,31 @@ "route": [ { "x": 509, - "y": 279.5 + "y": 323.5 }, { "x": 549, - "y": 279.5 + "y": 323.5 }, { "x": 569, - "y": 279.5 + "y": 323.5 }, { "x": 584, - "y": 279.5 + "y": 323.5 }, { "x": 599, - "y": 279.5 + "y": 323.5 }, { "x": 669, - "y": 279.5 + "y": 323.5 }, { "x": 709, - "y": 279.5 + "y": 323.5 } ], "isCurve": true, @@ -1510,31 +1510,31 @@ "route": [ { "x": 509, - "y": 445.5 + "y": 506.5 }, { "x": 549, - "y": 445.5 + "y": 506.5 }, { "x": 569, - "y": 445.5 + "y": 506.5 }, { "x": 584, - "y": 445.5 + "y": 506.5 }, { "x": 599, - "y": 445.5 + "y": 506.5 }, { "x": 669, - "y": 445.5 + "y": 506.5 }, { "x": 709, - "y": 445.5 + "y": 506.5 } ], "isCurve": true, @@ -1571,43 +1571,43 @@ "route": [ { "x": 762, - "y": 122.5 + "y": 149.5 }, { "x": 802, - "y": 122.5 + "y": 149.5 }, { "x": 822, - "y": 122.5 + "y": 149.5 }, { "x": 837, - "y": 122.5 + "y": 149.5 }, { "x": 852, - "y": 122.5 + "y": 149.5 }, { "x": 872, - "y": 122.5 + "y": 149.5 }, { "x": 887, - "y": 122.5 + "y": 149.5 }, { "x": 902, - "y": 122.5 + "y": 149.5 }, { "x": 972, - "y": 122.5 + "y": 149.5 }, { "x": 1012, - "y": 122.5 + "y": 149.5 } ], "isCurve": true, @@ -1644,43 +1644,43 @@ "route": [ { "x": 762, - "y": 288.5 + "y": 332.5 }, { "x": 802, - "y": 288.5 + "y": 332.5 }, { "x": 822, - "y": 288.5 + "y": 332.5 }, { "x": 837, - "y": 288.5 + "y": 332.5 }, { "x": 852, - "y": 288.5 + "y": 332.5 }, { "x": 872, - "y": 288.5 + "y": 332.5 }, { "x": 887, - "y": 288.5 + "y": 332.5 }, { "x": 902, - "y": 288.5 + "y": 332.5 }, { "x": 972, - "y": 288.5 + "y": 332.5 }, { "x": 1012, - "y": 288.5 + "y": 332.5 } ], "isCurve": true, @@ -1717,43 +1717,43 @@ "route": [ { "x": 762, - "y": 454.5 + "y": 515.5 }, { "x": 802, - "y": 454.5 + "y": 515.5 }, { "x": 822, - "y": 454.5 + "y": 515.5 }, { "x": 837, - "y": 454.5 + "y": 515.5 }, { "x": 852, - "y": 454.5 + "y": 515.5 }, { "x": 872, - "y": 454.5 + "y": 515.5 }, { "x": 887, - "y": 454.5 + "y": 515.5 }, { "x": 902, - "y": 454.5 + "y": 515.5 }, { "x": 972, - "y": 454.5 + "y": 515.5 }, { "x": 1012, - "y": 454.5 + "y": 515.5 } ], "isCurve": true, diff --git a/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/sketch.exp.svg b/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/sketch.exp.svg index 849898b24..f1ba9c626 100644 --- a/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/straight_hierarchy_container_direction_right/dagre/sketch.exp.svg @@ -1,4 +1,4 @@ -acbl1l2c1l2c3l2c2l3c1l3c2l4bacacbabcc1c2c3abc - +.fill-N1{fill:#0A0F25;}.fill-N2{fill:#676C7E;}.fill-N3{fill:#9499AB;}.fill-N4{fill:#CFD2DD;}.fill-N5{fill:#DEE1EB;}.fill-N6{fill:#EEF1F8;}.fill-N7{fill:#FFFFFF;}.fill-B1{fill:#0D32B2;}.fill-B2{fill:#0D32B2;}.fill-B3{fill:#E3E9FD;}.fill-B4{fill:#E3E9FD;}.fill-B5{fill:#EDF0FD;}.fill-B6{fill:#F7F8FE;}.fill-AA2{fill:#4A6FF3;}.fill-AA4{fill:#EDF0FD;}.fill-AA5{fill:#F7F8FE;}.fill-AB4{fill:#EDF0FD;}.fill-AB5{fill:#F7F8FE;}.stroke-N1{stroke:#0A0F25;}.stroke-N2{stroke:#676C7E;}.stroke-N3{stroke:#9499AB;}.stroke-N4{stroke:#CFD2DD;}.stroke-N5{stroke:#DEE1EB;}.stroke-N6{stroke:#EEF1F8;}.stroke-N7{stroke:#FFFFFF;}.stroke-B1{stroke:#0D32B2;}.stroke-B2{stroke:#0D32B2;}.stroke-B3{stroke:#E3E9FD;}.stroke-B4{stroke:#E3E9FD;}.stroke-B5{stroke:#EDF0FD;}.stroke-B6{stroke:#F7F8FE;}.stroke-AA2{stroke:#4A6FF3;}.stroke-AA4{stroke:#EDF0FD;}.stroke-AA5{stroke:#F7F8FE;}.stroke-AB4{stroke:#EDF0FD;}.stroke-AB5{stroke:#F7F8FE;}.background-color-N1{background-color:#0A0F25;}.background-color-N2{background-color:#676C7E;}.background-color-N3{background-color:#9499AB;}.background-color-N4{background-color:#CFD2DD;}.background-color-N5{background-color:#DEE1EB;}.background-color-N6{background-color:#EEF1F8;}.background-color-N7{background-color:#FFFFFF;}.background-color-B1{background-color:#0D32B2;}.background-color-B2{background-color:#0D32B2;}.background-color-B3{background-color:#E3E9FD;}.background-color-B4{background-color:#E3E9FD;}.background-color-B5{background-color:#EDF0FD;}.background-color-B6{background-color:#F7F8FE;}.background-color-AA2{background-color:#4A6FF3;}.background-color-AA4{background-color:#EDF0FD;}.background-color-AA5{background-color:#F7F8FE;}.background-color-AB4{background-color:#EDF0FD;}.background-color-AB5{background-color:#F7F8FE;}.color-N1{color:#0A0F25;}.color-N2{color:#676C7E;}.color-N3{color:#9499AB;}.color-N4{color:#CFD2DD;}.color-N5{color:#DEE1EB;}.color-N6{color:#EEF1F8;}.color-N7{color:#FFFFFF;}.color-B1{color:#0D32B2;}.color-B2{color:#0D32B2;}.color-B3{color:#E3E9FD;}.color-B4{color:#E3E9FD;}.color-B5{color:#EDF0FD;}.color-B6{color:#F7F8FE;}.color-AA2{color:#4A6FF3;}.color-AA4{color:#EDF0FD;}.color-AA5{color:#F7F8FE;}.color-AB4{color:#EDF0FD;}.color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>acbl1l2c1l2c3l2c2l3c1l3c2l4bacacbabcc1c2c3abc + \ No newline at end of file diff --git a/e2etests/testdata/regression/unconnected/dagre/board.exp.json b/e2etests/testdata/regression/unconnected/dagre/board.exp.json index ea3bf7a37..b878f6fe1 100644 --- a/e2etests/testdata/regression/unconnected/dagre/board.exp.json +++ b/e2etests/testdata/regression/unconnected/dagre/board.exp.json @@ -8,7 +8,7 @@ "type": "rectangle", "pos": { "x": 50, - "y": 322 + "y": 262 }, "width": 135, "height": 66, @@ -49,7 +49,7 @@ "type": "rectangle", "pos": { "x": 358, - "y": 332 + "y": 282 }, "width": 159, "height": 66, @@ -90,7 +90,7 @@ "type": "rectangle", "pos": { "x": 335, - "y": 458 + "y": 368 }, "width": 204, "height": 66, @@ -131,10 +131,10 @@ "type": "rectangle", "pos": { "x": 639, - "y": 203 + "y": 169 }, "width": 872, - "height": 308, + "height": 272, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -172,7 +172,7 @@ "type": "rectangle", "pos": { "x": 689, - "y": 316 + "y": 271 }, "width": 94, "height": 66, @@ -213,7 +213,7 @@ "type": "rectangle", "pos": { "x": 883, - "y": 389 + "y": 325 }, "width": 120, "height": 66, @@ -254,7 +254,7 @@ "type": "rectangle", "pos": { "x": 1103, - "y": 268 + "y": 238 }, "width": 120, "height": 66, @@ -295,7 +295,7 @@ "type": "rectangle", "pos": { "x": 1331, - "y": 257 + "y": 237 }, "width": 122, "height": 66, @@ -336,7 +336,7 @@ "type": "text", "pos": { "x": 1323, - "y": 383 + "y": 323 }, "width": 138, "height": 108, @@ -379,7 +379,7 @@ "y": 41 }, "width": 235, - "height": 231, + "height": 171, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -417,7 +417,7 @@ "type": "rectangle", "pos": { "x": 55, - "y": 60 + "y": 50 }, "width": 126, "height": 66, @@ -458,7 +458,7 @@ "type": "rectangle", "pos": { "x": 66, - "y": 186 + "y": 136 }, "width": 103, "height": 66, @@ -565,19 +565,19 @@ "route": [ { "x": 185, - "y": 360.74468085106383 + "y": 306.48936170212767 }, { "x": 225, - "y": 364.1489361702128 + "y": 313.29787234042556 }, { "x": 299.5, - "y": 365 + "y": 315 }, { "x": 357.5, - "y": 365 + "y": 315 } ], "isCurve": true, @@ -613,20 +613,20 @@ "labelPercentage": 0, "route": [ { - "x": 146.0110294117647, - "y": 388 + "x": 154.08018867924528, + "y": 328 }, { - "x": 217.20220588235293, - "y": 470.4 + "x": 218.81603773584908, + "y": 386.4 }, { "x": 295, - "y": 491 + "y": 401 }, { "x": 335, - "y": 491 + "y": 401 } ], "isCurve": true, @@ -662,44 +662,44 @@ "labelPercentage": 0, "route": [ { - "x": 179.04761904761904, - "y": 322 + "x": 185, + "y": 270.29787234042556 }, { - "x": 223.8095238095238, - "y": 298 + "x": 225, + "y": 255.6595744680851 }, { "x": 245, - "y": 292 + "y": 252 }, { "x": 260, - "y": 292 + "y": 252 }, { "x": 275, - "y": 292 + "y": 252 }, { "x": 315.4, - "y": 292 + "y": 252 }, { "x": 361, - "y": 292 + "y": 252 }, { "x": 406.6, - "y": 292 + "y": 252 }, { "x": 599, - "y": 292 + "y": 252 }, { "x": 639, - "y": 292 + "y": 252 } ], "isCurve": true, @@ -735,20 +735,20 @@ "labelPercentage": 0, "route": [ { - "x": 780.8493150684932, - "y": 383 + "x": 783, + "y": 330.4072164948454 }, { - "x": 822.5698630136986, - "y": 414.2 + "x": 823, + "y": 352.8814432989691 }, { "x": 843, - "y": 422 + "y": 358.5 }, { "x": 883, - "y": 422 + "y": 358.5 } ], "isCurve": true, @@ -784,32 +784,32 @@ "labelPercentage": 0, "route": [ { - "x": 779.2567567567568, - "y": 316 + "x": 783, + "y": 278.5618556701031 }, { - "x": 822.2513513513513, - "y": 283.2 + "x": 823, + "y": 256.91237113402065 }, { "x": 855, - "y": 275 + "y": 251.5 }, { "x": 888, - "y": 275 + "y": 251.5 }, { "x": 921, - "y": 275 + "y": 251.5 }, { "x": 1063, - "y": 277.4 + "y": 253.3 }, { "x": 1103, - "y": 287 + "y": 260.5 } ], "isCurve": true, @@ -845,56 +845,56 @@ "labelPercentage": 0, "route": [ { - "x": 762.5643153526971, - "y": 316 + "x": 766.7788461538462, + "y": 271 }, { - "x": 818.9128630705394, - "y": 246 + "x": 819.7557692307693, + "y": 214.2 }, { "x": 855, - "y": 228.5 + "y": 200 }, { "x": 888, - "y": 228.5 + "y": 200 }, { "x": 921, - "y": 228.5 + "y": 200 }, { "x": 965, - "y": 228.5 + "y": 200 }, { "x": 998, - "y": 228.5 + "y": 200 }, { "x": 1031, - "y": 228.5 + "y": 200 }, { "x": 1075, - "y": 228.5 + "y": 200 }, { "x": 1108, - "y": 228.5 + "y": 200 }, { "x": 1141, - "y": 228.5 + "y": 200 }, { - "x": 1284.6, - "y": 234.5 + "x": 1285.6, + "y": 207.6 }, { - "x": 1331, - "y": 258.5 + "x": 1336, + "y": 238 } ], "isCurve": true, @@ -931,19 +931,19 @@ "route": [ { "x": 1003, - "y": 396.09090909090907 + "y": 340.77272727272725 }, { "x": 1043, - "y": 378.8181818181818 + "y": 328.95454545454544 }, { - "x": 1065, - "y": 366.5 + "x": 1063, + "y": 321 }, { - "x": 1113, - "y": 334.5 + "x": 1103, + "y": 301 } ], "isCurve": true, @@ -980,19 +980,19 @@ "route": [ { "x": 1223, - "y": 301.5 + "y": 271.5 }, { "x": 1263, - "y": 301.5 + "y": 271.5 }, { "x": 1284.6, - "y": 300.5 + "y": 271.5 }, { "x": 1331, - "y": 296.5 + "y": 271.5 } ], "isCurve": true, @@ -1028,32 +1028,32 @@ "labelPercentage": 0, "route": [ { - "x": 1367.1455696202531, - "y": 323.5 + "x": 1355.638888888889, + "y": 303.5 }, { - "x": 1291.8291139240507, - "y": 423.5 + "x": 1289.5277777777778, + "y": 363.5 }, { "x": 1251, - "y": 448.5 + "y": 378.5 }, { "x": 1218, - "y": 448.5 + "y": 378.5 }, { "x": 1185, - "y": 448.5 + "y": 378.5 }, { "x": 1043, - "y": 446.1 + "y": 376.7 }, { "x": 1003, - "y": 436.5 + "y": 369.5 } ], "isCurve": true, @@ -1090,19 +1090,19 @@ "route": [ { "x": 517.5, - "y": 365 + "y": 315 }, { "x": 574.7, - "y": 365 + "y": 315 }, { "x": 599, - "y": 365 + "y": 315 }, { "x": 639, - "y": 365 + "y": 315 } ], "isCurve": true, @@ -1139,19 +1139,19 @@ "route": [ { "x": 539, - "y": 491 + "y": 401 }, { "x": 579, - "y": 491 + "y": 401 }, { "x": 599, - "y": 491 + "y": 401 }, { "x": 639, - "y": 491 + "y": 401 } ], "isCurve": true, diff --git a/e2etests/testdata/regression/unconnected/dagre/sketch.exp.svg b/e2etests/testdata/regression/unconnected/dagre/sketch.exp.svg index 91c0bad0a..c3c0d9f10 100644 --- a/e2etests/testdata/regression/unconnected/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/unconnected/dagre/sketch.exp.svg @@ -1,4 +1,4 @@ -ninety ninesixty fourthirty twosixteeneight + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/font_sizes_containers_large_right/elk/board.exp.json b/e2etests/testdata/stable/font_sizes_containers_large_right/elk/board.exp.json new file mode 100644 index 000000000..a05e2b636 --- /dev/null +++ b/e2etests/testdata/stable/font_sizes_containers_large_right/elk/board.exp.json @@ -0,0 +1,253 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "ninety nine", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 464, + "height": 572, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "stroke": "B1", + "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": "N1", + "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": 62, + "y": 142 + }, + "width": 364, + "height": 392, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "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": "N1", + "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": 112, + "y": 228 + }, + "width": 264, + "height": 256, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "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": "N1", + "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": 162, + "y": 278 + }, + "width": 164, + "height": 156, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "stroke": "B1", + "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": "N1", + "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": 212, + "y": 328 + }, + "width": 64, + "height": 56, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "stroke": "B1", + "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": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 19, + "labelHeight": 11, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 5 + } + ], + "connections": [], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/stable/font_sizes_containers_large_right/elk/sketch.exp.svg b/e2etests/testdata/stable/font_sizes_containers_large_right/elk/sketch.exp.svg new file mode 100644 index 000000000..159756c38 --- /dev/null +++ b/e2etests/testdata/stable/font_sizes_containers_large_right/elk/sketch.exp.svg @@ -0,0 +1,30 @@ +ninety ninesixty fourthirty twosixteeneight + + + \ No newline at end of file