diff --git a/d2layouts/d2cycle/layout.go b/d2layouts/d2cycle/layout.go index 0e9036f74..53d62b45c 100644 --- a/d2layouts/d2cycle/layout.go +++ b/d2layouts/d2cycle/layout.go @@ -89,6 +89,7 @@ func createCircularArc(edge *d2graph.Edge) { y := arcRadius * math.Sin(angle) path = append(path, geo.NewPoint(x, y)) } + // Ensure endpoints are the node centers path[0] = srcCenter path[len(path)-1] = dstCenter @@ -98,9 +99,10 @@ func createCircularArc(edge *d2graph.Edge) { path[0] = newSrc path[len(path)-1] = newDst - // Trim redundant path points that fall inside node boundaries. - path = trimPathPoints(path, edge.Src.Box) - path = trimPathPoints(path, edge.Dst.Box) + // Instead of trimming all intermediate points that fall inside a node, + // only trim contiguous points from the start and end. + path = trimStartPoints(path, edge.Src.Box) + path = trimEndPoints(path, edge.Dst.Box) edge.Route = path edge.IsCurve = true @@ -232,19 +234,32 @@ func findPreciseIntersection(box *geo.Box, seg geo.Segment) *geo.Point { return intersections[0].point } -// trimPathPoints removes intermediate points that fall inside the given box while preserving endpoints. -func trimPathPoints(path []*geo.Point, box *geo.Box) []*geo.Point { - if len(path) <= 2 { - return path +// trimStartPoints removes contiguous starting points that fall inside the box, +// but preserves one point before the first point outside to maintain smoothness. +func trimStartPoints(path []*geo.Point, box *geo.Box) []*geo.Point { + i := 0 + for i < len(path) && boxContains(box, path[i]) { + i++ } - trimmed := []*geo.Point{path[0]} - for i := 1; i < len(path)-1; i++ { - if !boxContains(box, path[i]) { - trimmed = append(trimmed, path[i]) - } + // If we've trimmed some points and there's at least one point before, + // include the last inside point to keep the curve smooth. + if i > 0 && i < len(path) { + return path[i-1:] } - trimmed = append(trimmed, path[len(path)-1]) - return trimmed + return path +} + +// trimEndPoints removes contiguous ending points that fall inside the box, +// but preserves one point after the last point outside to maintain smoothness. +func trimEndPoints(path []*geo.Point, box *geo.Box) []*geo.Point { + i := len(path) - 1 + for i >= 0 && boxContains(box, path[i]) { + i-- + } + if i < len(path)-1 && i >= 0 { + return path[:i+2] + } + return path } // boxContains uses strict inequalities so that points exactly on the boundary are considered outside. @@ -290,4 +305,4 @@ func positionLabelsIcons(obj *d2graph.Object) { } } } -} \ No newline at end of file +} diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json index 78ed2dffe..3f9a49143 100644 --- a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json @@ -543,6 +543,38 @@ "x": 26.5, "y": -198.22999572753906 }, + { + "x": 3.1410000324249268, + "y": -199.97500610351562 + }, + { + "x": 6.2820000648498535, + "y": -199.9010009765625 + }, + { + "x": 9.420999526977539, + "y": -199.77699279785156 + }, + { + "x": 12.557999610900879, + "y": -199.60499572753906 + }, + { + "x": 15.690999984741211, + "y": -199.38299560546875 + }, + { + "x": 18.820999145507812, + "y": -199.11199951171875 + }, + { + "x": 21.945999145507812, + "y": -198.79200744628906 + }, + { + "x": 25.06599998474121, + "y": -198.4219970703125 + }, { "x": 28.18000030517578, "y": -198.00399780273438 @@ -867,6 +899,46 @@ "x": 197.02099609375, "y": -34.3849983215332 }, + { + "x": 197.53700256347656, + "y": -31.285999298095703 + }, + { + "x": 198.00399780273438, + "y": -28.18000030517578 + }, + { + "x": 198.4219970703125, + "y": -25.06599998474121 + }, + { + "x": 198.79200744628906, + "y": -21.945999145507812 + }, + { + "x": 199.11199951171875, + "y": -18.820999145507812 + }, + { + "x": 199.38299560546875, + "y": -15.690999984741211 + }, + { + "x": 199.60499572753906, + "y": -12.557999610900879 + }, + { + "x": 199.77699279785156, + "y": -9.420999526977539 + }, + { + "x": 199.9010009765625, + "y": -6.2820000648498535 + }, + { + "x": 199.97500610351562, + "y": -3.1410000324249268 + }, { "x": 197.2519989013672, "y": -33 @@ -907,6 +979,46 @@ "x": 197.2519989013672, "y": 33 }, + { + "x": 199.97500610351562, + "y": 3.1410000324249268 + }, + { + "x": 199.9010009765625, + "y": 6.2820000648498535 + }, + { + "x": 199.77699279785156, + "y": 9.420999526977539 + }, + { + "x": 199.60499572753906, + "y": 12.557999610900879 + }, + { + "x": 199.38299560546875, + "y": 15.690999984741211 + }, + { + "x": 199.11199951171875, + "y": 18.820999145507812 + }, + { + "x": 198.79200744628906, + "y": 21.945999145507812 + }, + { + "x": 198.4219970703125, + "y": 25.06599998474121 + }, + { + "x": 198.00399780273438, + "y": 28.18000030517578 + }, + { + "x": 197.53700256347656, + "y": 31.285999298095703 + }, { "x": 197.02099609375, "y": 34.3849983215332 @@ -1231,6 +1343,38 @@ "x": 28.18000030517578, "y": 198.00399780273438 }, + { + "x": 25.06599998474121, + "y": 198.4219970703125 + }, + { + "x": 21.945999145507812, + "y": 198.79200744628906 + }, + { + "x": 18.820999145507812, + "y": 199.11199951171875 + }, + { + "x": 15.690999984741211, + "y": 199.38299560546875 + }, + { + "x": 12.557999610900879, + "y": 199.60499572753906 + }, + { + "x": 9.420999526977539, + "y": 199.77699279785156 + }, + { + "x": 6.2820000648498535, + "y": 199.9010009765625 + }, + { + "x": 3.1410000324249268, + "y": 199.97500610351562 + }, { "x": 26.5, "y": 198.22999572753906 @@ -1271,6 +1415,38 @@ "x": -26.499000549316406, "y": 198.22999572753906 }, + { + "x": -3.1410000324249268, + "y": 199.97500610351562 + }, + { + "x": -6.2820000648498535, + "y": 199.9010009765625 + }, + { + "x": -9.420999526977539, + "y": 199.77699279785156 + }, + { + "x": -12.557999610900879, + "y": 199.60499572753906 + }, + { + "x": -15.690999984741211, + "y": 199.38299560546875 + }, + { + "x": -18.820999145507812, + "y": 199.11199951171875 + }, + { + "x": -21.945999145507812, + "y": 198.79200744628906 + }, + { + "x": -25.06599998474121, + "y": 198.4219970703125 + }, { "x": -28.18000030517578, "y": 198.00399780273438 @@ -1595,6 +1771,46 @@ "x": -197.02099609375, "y": 34.3849983215332 }, + { + "x": -197.53700256347656, + "y": 31.285999298095703 + }, + { + "x": -198.00399780273438, + "y": 28.18000030517578 + }, + { + "x": -198.4219970703125, + "y": 25.06599998474121 + }, + { + "x": -198.79200744628906, + "y": 21.945999145507812 + }, + { + "x": -199.11199951171875, + "y": 18.820999145507812 + }, + { + "x": -199.38299560546875, + "y": 15.690999984741211 + }, + { + "x": -199.60499572753906, + "y": 12.557999610900879 + }, + { + "x": -199.77699279785156, + "y": 9.420999526977539 + }, + { + "x": -199.9010009765625, + "y": 6.2820000648498535 + }, + { + "x": -199.97500610351562, + "y": 3.1410000324249268 + }, { "x": -197.2519989013672, "y": 33 @@ -1635,6 +1851,30 @@ "x": 539.5, "y": -148.2259979248047 }, + { + "x": 517.18798828125, + "y": -149.95599365234375 + }, + { + "x": 521.375, + "y": -149.82400512695312 + }, + { + "x": 525.5579833984375, + "y": -149.60499572753906 + }, + { + "x": 529.7349853515625, + "y": -149.29800415039062 + }, + { + "x": 533.905029296875, + "y": -148.9040069580078 + }, + { + "x": 538.0659790039062, + "y": -148.4219970703125 + }, { "x": 542.2160034179688, "y": -147.85400390625 @@ -1975,6 +2215,38 @@ "x": 701.875, "y": 115.77300262451172 }, + { + "x": 700.4559936523438, + "y": 119.71399688720703 + }, + { + "x": 698.9550170898438, + "y": 123.6240005493164 + }, + { + "x": 697.3720092773438, + "y": 127.50299835205078 + }, + { + "x": 695.708984375, + "y": 131.3470001220703 + }, + { + "x": 693.9650268554688, + "y": 135.15499877929688 + }, + { + "x": 692.1420288085938, + "y": 138.927001953125 + }, + { + "x": 690.239990234375, + "y": 142.65899658203125 + }, + { + "x": 688.260986328125, + "y": 146.35000610351562 + }, { "x": 701.4329833984375, "y": 116.9990005493164 @@ -2015,6 +2287,42 @@ "x": 662.3569946289062, "y": 182.99899291992188 }, + { + "x": 684.072021484375, + "y": 153.60499572753906 + }, + { + "x": 681.864990234375, + "y": 157.1649932861328 + }, + { + "x": 679.583984375, + "y": 160.67799377441406 + }, + { + "x": 677.22900390625, + "y": 164.14199829101562 + }, + { + "x": 674.802978515625, + "y": 167.5570068359375 + }, + { + "x": 672.3049926757812, + "y": 170.91900634765625 + }, + { + "x": 669.7379760742188, + "y": 174.22900390625 + }, + { + "x": 667.1019897460938, + "y": 177.48399353027344 + }, + { + "x": 664.3989868164062, + "y": 180.6840057373047 + }, { "x": 661.6279907226562, "y": 183.8260040283203 @@ -2339,6 +2647,42 @@ "x": 364.3710021972656, "y": 183.8260040283203 }, + { + "x": 361.6000061035156, + "y": 180.6840057373047 + }, + { + "x": 358.8970031738281, + "y": 177.48399353027344 + }, + { + "x": 356.260986328125, + "y": 174.22900390625 + }, + { + "x": 353.6940002441406, + "y": 170.91900634765625 + }, + { + "x": 351.1960144042969, + "y": 167.5570068359375 + }, + { + "x": 348.7699890136719, + "y": 164.14199829101562 + }, + { + "x": 346.4150085449219, + "y": 160.67799377441406 + }, + { + "x": 344.1340026855469, + "y": 157.1649932861328 + }, + { + "x": 341.927001953125, + "y": 153.60499572753906 + }, { "x": 363.6419982910156, "y": 183 @@ -2379,6 +2723,22 @@ "x": 998.5, "y": -198.21800231933594 }, + { + "x": 978.281982421875, + "y": -199.9010009765625 + }, + { + "x": 984.5579833984375, + "y": -199.60499572753906 + }, + { + "x": 990.8209838867188, + "y": -199.11199951171875 + }, + { + "x": 997.0659790039062, + "y": -198.4219970703125 + }, { "x": 1003.2860107421875, "y": -197.53700256347656 @@ -2743,6 +3103,22 @@ "x": 1003.2860107421875, "y": 197.53700256347656 }, + { + "x": 997.0659790039062, + "y": 198.4219970703125 + }, + { + "x": 990.8209838867188, + "y": 199.11199951171875 + }, + { + "x": 984.5579833984375, + "y": 199.60499572753906 + }, + { + "x": 978.281982421875, + "y": 199.9010009765625 + }, { "x": 998.5, "y": 198.21800231933594 diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg index 015478d74..56a9cf1f3 100644 --- a/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg +++ b/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg @@ -1,9 +1,9 @@ -abcdabcab + .d2-671326991 .fill-N1{fill:#0A0F25;} + .d2-671326991 .fill-N2{fill:#676C7E;} + .d2-671326991 .fill-N3{fill:#9499AB;} + .d2-671326991 .fill-N4{fill:#CFD2DD;} + .d2-671326991 .fill-N5{fill:#DEE1EB;} + .d2-671326991 .fill-N6{fill:#EEF1F8;} + .d2-671326991 .fill-N7{fill:#FFFFFF;} + .d2-671326991 .fill-B1{fill:#0D32B2;} + .d2-671326991 .fill-B2{fill:#0D32B2;} + .d2-671326991 .fill-B3{fill:#E3E9FD;} + .d2-671326991 .fill-B4{fill:#E3E9FD;} + .d2-671326991 .fill-B5{fill:#EDF0FD;} + .d2-671326991 .fill-B6{fill:#F7F8FE;} + .d2-671326991 .fill-AA2{fill:#4A6FF3;} + .d2-671326991 .fill-AA4{fill:#EDF0FD;} + .d2-671326991 .fill-AA5{fill:#F7F8FE;} + .d2-671326991 .fill-AB4{fill:#EDF0FD;} + .d2-671326991 .fill-AB5{fill:#F7F8FE;} + .d2-671326991 .stroke-N1{stroke:#0A0F25;} + .d2-671326991 .stroke-N2{stroke:#676C7E;} + .d2-671326991 .stroke-N3{stroke:#9499AB;} + .d2-671326991 .stroke-N4{stroke:#CFD2DD;} + .d2-671326991 .stroke-N5{stroke:#DEE1EB;} + .d2-671326991 .stroke-N6{stroke:#EEF1F8;} + .d2-671326991 .stroke-N7{stroke:#FFFFFF;} + .d2-671326991 .stroke-B1{stroke:#0D32B2;} + .d2-671326991 .stroke-B2{stroke:#0D32B2;} + .d2-671326991 .stroke-B3{stroke:#E3E9FD;} + .d2-671326991 .stroke-B4{stroke:#E3E9FD;} + .d2-671326991 .stroke-B5{stroke:#EDF0FD;} + .d2-671326991 .stroke-B6{stroke:#F7F8FE;} + .d2-671326991 .stroke-AA2{stroke:#4A6FF3;} + .d2-671326991 .stroke-AA4{stroke:#EDF0FD;} + .d2-671326991 .stroke-AA5{stroke:#F7F8FE;} + .d2-671326991 .stroke-AB4{stroke:#EDF0FD;} + .d2-671326991 .stroke-AB5{stroke:#F7F8FE;} + .d2-671326991 .background-color-N1{background-color:#0A0F25;} + .d2-671326991 .background-color-N2{background-color:#676C7E;} + .d2-671326991 .background-color-N3{background-color:#9499AB;} + .d2-671326991 .background-color-N4{background-color:#CFD2DD;} + .d2-671326991 .background-color-N5{background-color:#DEE1EB;} + .d2-671326991 .background-color-N6{background-color:#EEF1F8;} + .d2-671326991 .background-color-N7{background-color:#FFFFFF;} + .d2-671326991 .background-color-B1{background-color:#0D32B2;} + .d2-671326991 .background-color-B2{background-color:#0D32B2;} + .d2-671326991 .background-color-B3{background-color:#E3E9FD;} + .d2-671326991 .background-color-B4{background-color:#E3E9FD;} + .d2-671326991 .background-color-B5{background-color:#EDF0FD;} + .d2-671326991 .background-color-B6{background-color:#F7F8FE;} + .d2-671326991 .background-color-AA2{background-color:#4A6FF3;} + .d2-671326991 .background-color-AA4{background-color:#EDF0FD;} + .d2-671326991 .background-color-AA5{background-color:#F7F8FE;} + .d2-671326991 .background-color-AB4{background-color:#EDF0FD;} + .d2-671326991 .background-color-AB5{background-color:#F7F8FE;} + .d2-671326991 .color-N1{color:#0A0F25;} + .d2-671326991 .color-N2{color:#676C7E;} + .d2-671326991 .color-N3{color:#9499AB;} + .d2-671326991 .color-N4{color:#CFD2DD;} + .d2-671326991 .color-N5{color:#DEE1EB;} + .d2-671326991 .color-N6{color:#EEF1F8;} + .d2-671326991 .color-N7{color:#FFFFFF;} + .d2-671326991 .color-B1{color:#0D32B2;} + .d2-671326991 .color-B2{color:#0D32B2;} + .d2-671326991 .color-B3{color:#E3E9FD;} + .d2-671326991 .color-B4{color:#E3E9FD;} + .d2-671326991 .color-B5{color:#EDF0FD;} + .d2-671326991 .color-B6{color:#F7F8FE;} + .d2-671326991 .color-AA2{color:#4A6FF3;} + .d2-671326991 .color-AA4{color:#EDF0FD;} + .d2-671326991 .color-AA5{color:#F7F8FE;} + .d2-671326991 .color-AB4{color:#EDF0FD;} + .d2-671326991 .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-d2-671326991);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-671326991);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-671326991);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-671326991);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-671326991);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-671326991);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-671326991);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-671326991);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>abcdabcab diff --git a/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json b/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json index 6eb058a84..7f5a0553f 100644 --- a/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json @@ -543,6 +543,38 @@ "x": 38.5, "y": -186.22999572753906 }, + { + "x": 15.140999794006348, + "y": -187.97500610351562 + }, + { + "x": 18.281999588012695, + "y": -187.9010009765625 + }, + { + "x": 21.42099952697754, + "y": -187.77699279785156 + }, + { + "x": 24.558000564575195, + "y": -187.60499572753906 + }, + { + "x": 27.69099998474121, + "y": -187.38299560546875 + }, + { + "x": 30.820999145507812, + "y": -187.11199951171875 + }, + { + "x": 33.94599914550781, + "y": -186.79200744628906 + }, + { + "x": 37.066001892089844, + "y": -186.4219970703125 + }, { "x": 40.18000030517578, "y": -186.00399780273438 @@ -867,6 +899,46 @@ "x": 209.02099609375, "y": -22.385000228881836 }, + { + "x": 209.53700256347656, + "y": -19.285999298095703 + }, + { + "x": 210.00399780273438, + "y": -16.18000030517578 + }, + { + "x": 210.4219970703125, + "y": -13.065999984741211 + }, + { + "x": 210.79200744628906, + "y": -9.946000099182129 + }, + { + "x": 211.11199951171875, + "y": -6.821000099182129 + }, + { + "x": 211.38299560546875, + "y": -3.690999984741211 + }, + { + "x": 211.60499572753906, + "y": -0.5580000281333923 + }, + { + "x": 211.77699279785156, + "y": 2.578000068664551 + }, + { + "x": 211.9010009765625, + "y": 5.7170000076293945 + }, + { + "x": 211.97500610351562, + "y": 8.857999801635742 + }, { "x": 209.2519989013672, "y": -21 @@ -907,6 +979,46 @@ "x": 209.2519989013672, "y": 45 }, + { + "x": 211.97500610351562, + "y": 15.140999794006348 + }, + { + "x": 211.9010009765625, + "y": 18.281999588012695 + }, + { + "x": 211.77699279785156, + "y": 21.42099952697754 + }, + { + "x": 211.60499572753906, + "y": 24.558000564575195 + }, + { + "x": 211.38299560546875, + "y": 27.69099998474121 + }, + { + "x": 211.11199951171875, + "y": 30.820999145507812 + }, + { + "x": 210.79200744628906, + "y": 33.94599914550781 + }, + { + "x": 210.4219970703125, + "y": 37.066001892089844 + }, + { + "x": 210.00399780273438, + "y": 40.18000030517578 + }, + { + "x": 209.53700256347656, + "y": 43.2859992980957 + }, { "x": 209.02099609375, "y": 46.3849983215332 @@ -1231,6 +1343,38 @@ "x": 40.18000030517578, "y": 210.00399780273438 }, + { + "x": 37.066001892089844, + "y": 210.4219970703125 + }, + { + "x": 33.94599914550781, + "y": 210.79200744628906 + }, + { + "x": 30.820999145507812, + "y": 211.11199951171875 + }, + { + "x": 27.69099998474121, + "y": 211.38299560546875 + }, + { + "x": 24.558000564575195, + "y": 211.60499572753906 + }, + { + "x": 21.42099952697754, + "y": 211.77699279785156 + }, + { + "x": 18.281999588012695, + "y": 211.9010009765625 + }, + { + "x": 15.140999794006348, + "y": 211.97500610351562 + }, { "x": 38.5, "y": 210.22999572753906 @@ -1271,6 +1415,38 @@ "x": -14.49899959564209, "y": 210.22999572753906 }, + { + "x": 8.857999801635742, + "y": 211.97500610351562 + }, + { + "x": 5.7170000076293945, + "y": 211.9010009765625 + }, + { + "x": 2.578000068664551, + "y": 211.77699279785156 + }, + { + "x": -0.5580000281333923, + "y": 211.60499572753906 + }, + { + "x": -3.690999984741211, + "y": 211.38299560546875 + }, + { + "x": -6.821000099182129, + "y": 211.11199951171875 + }, + { + "x": -9.946000099182129, + "y": 210.79200744628906 + }, + { + "x": -13.065999984741211, + "y": 210.4219970703125 + }, { "x": -16.18000030517578, "y": 210.00399780273438 @@ -1595,6 +1771,46 @@ "x": -185.02099609375, "y": 46.3849983215332 }, + { + "x": -185.53700256347656, + "y": 43.2859992980957 + }, + { + "x": -186.00399780273438, + "y": 40.18000030517578 + }, + { + "x": -186.4219970703125, + "y": 37.066001892089844 + }, + { + "x": -186.79200744628906, + "y": 33.94599914550781 + }, + { + "x": -187.11199951171875, + "y": 30.820999145507812 + }, + { + "x": -187.38299560546875, + "y": 27.69099998474121 + }, + { + "x": -187.60499572753906, + "y": 24.558000564575195 + }, + { + "x": -187.77699279785156, + "y": 21.42099952697754 + }, + { + "x": -187.9010009765625, + "y": 18.281999588012695 + }, + { + "x": -187.97500610351562, + "y": 15.140999794006348 + }, { "x": -185.2519989013672, "y": 45 @@ -1635,6 +1851,30 @@ "x": 512, "y": -136.2259979248047 }, + { + "x": 489.68798828125, + "y": -137.95599365234375 + }, + { + "x": 493.875, + "y": -137.82400512695312 + }, + { + "x": 498.0580139160156, + "y": -137.60499572753906 + }, + { + "x": 502.2349853515625, + "y": -137.29800415039062 + }, + { + "x": 506.4049987792969, + "y": -136.9040069580078 + }, + { + "x": 510.5660095214844, + "y": -136.4219970703125 + }, { "x": 514.7160034179688, "y": -135.85400390625 @@ -1975,6 +2215,38 @@ "x": 674.375, "y": 127.77300262451172 }, + { + "x": 672.9559936523438, + "y": 131.71400451660156 + }, + { + "x": 671.4550170898438, + "y": 135.62399291992188 + }, + { + "x": 669.8720092773438, + "y": 139.5030059814453 + }, + { + "x": 668.208984375, + "y": 143.3470001220703 + }, + { + "x": 666.4650268554688, + "y": 147.15499877929688 + }, + { + "x": 664.6420288085938, + "y": 150.927001953125 + }, + { + "x": 662.739990234375, + "y": 154.65899658203125 + }, + { + "x": 660.760986328125, + "y": 158.35000610351562 + }, { "x": 673.9329833984375, "y": 128.99899291992188 @@ -2015,6 +2287,42 @@ "x": 634.8569946289062, "y": 194.99899291992188 }, + { + "x": 656.572021484375, + "y": 165.60499572753906 + }, + { + "x": 654.364990234375, + "y": 169.1649932861328 + }, + { + "x": 652.083984375, + "y": 172.67799377441406 + }, + { + "x": 649.72900390625, + "y": 176.14199829101562 + }, + { + "x": 647.302978515625, + "y": 179.5570068359375 + }, + { + "x": 644.8049926757812, + "y": 182.91900634765625 + }, + { + "x": 642.2379760742188, + "y": 186.22900390625 + }, + { + "x": 639.6019897460938, + "y": 189.48399353027344 + }, + { + "x": 636.8989868164062, + "y": 192.6840057373047 + }, { "x": 634.1279907226562, "y": 195.8260040283203 @@ -2339,6 +2647,42 @@ "x": 336.8710021972656, "y": 195.8260040283203 }, + { + "x": 334.1000061035156, + "y": 192.6840057373047 + }, + { + "x": 331.3970031738281, + "y": 189.48399353027344 + }, + { + "x": 328.760986328125, + "y": 186.22900390625 + }, + { + "x": 326.1940002441406, + "y": 182.91900634765625 + }, + { + "x": 323.6960144042969, + "y": 179.5570068359375 + }, + { + "x": 321.2699890136719, + "y": 176.14199829101562 + }, + { + "x": 318.9150085449219, + "y": 172.67799377441406 + }, + { + "x": 316.6340026855469, + "y": 169.1649932861328 + }, + { + "x": 314.427001953125, + "y": 165.60499572753906 + }, { "x": 336.1419982910156, "y": 195 @@ -2379,6 +2723,22 @@ "x": 931.4099731445312, "y": -186.21800231933594 }, + { + "x": 911.1920166015625, + "y": -187.9010009765625 + }, + { + "x": 917.468017578125, + "y": -187.60499572753906 + }, + { + "x": 923.7310180664062, + "y": -187.11199951171875 + }, + { + "x": 929.9760131835938, + "y": -186.4219970703125 + }, { "x": 936.197021484375, "y": -185.53700256347656 @@ -2743,6 +3103,22 @@ "x": 936.197021484375, "y": 209.53700256347656 }, + { + "x": 929.9760131835938, + "y": 210.4219970703125 + }, + { + "x": 923.7310180664062, + "y": 211.11199951171875 + }, + { + "x": 917.468017578125, + "y": 211.60499572753906 + }, + { + "x": 911.1920166015625, + "y": 211.9010009765625 + }, { "x": 931.4099731445312, "y": 210.21800231933594 diff --git a/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg index 21e65f752..1a53f8d0c 100644 --- a/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg @@ -1,9 +1,9 @@ -abcdabcab + .d2-364931106 .fill-N1{fill:#0A0F25;} + .d2-364931106 .fill-N2{fill:#676C7E;} + .d2-364931106 .fill-N3{fill:#9499AB;} + .d2-364931106 .fill-N4{fill:#CFD2DD;} + .d2-364931106 .fill-N5{fill:#DEE1EB;} + .d2-364931106 .fill-N6{fill:#EEF1F8;} + .d2-364931106 .fill-N7{fill:#FFFFFF;} + .d2-364931106 .fill-B1{fill:#0D32B2;} + .d2-364931106 .fill-B2{fill:#0D32B2;} + .d2-364931106 .fill-B3{fill:#E3E9FD;} + .d2-364931106 .fill-B4{fill:#E3E9FD;} + .d2-364931106 .fill-B5{fill:#EDF0FD;} + .d2-364931106 .fill-B6{fill:#F7F8FE;} + .d2-364931106 .fill-AA2{fill:#4A6FF3;} + .d2-364931106 .fill-AA4{fill:#EDF0FD;} + .d2-364931106 .fill-AA5{fill:#F7F8FE;} + .d2-364931106 .fill-AB4{fill:#EDF0FD;} + .d2-364931106 .fill-AB5{fill:#F7F8FE;} + .d2-364931106 .stroke-N1{stroke:#0A0F25;} + .d2-364931106 .stroke-N2{stroke:#676C7E;} + .d2-364931106 .stroke-N3{stroke:#9499AB;} + .d2-364931106 .stroke-N4{stroke:#CFD2DD;} + .d2-364931106 .stroke-N5{stroke:#DEE1EB;} + .d2-364931106 .stroke-N6{stroke:#EEF1F8;} + .d2-364931106 .stroke-N7{stroke:#FFFFFF;} + .d2-364931106 .stroke-B1{stroke:#0D32B2;} + .d2-364931106 .stroke-B2{stroke:#0D32B2;} + .d2-364931106 .stroke-B3{stroke:#E3E9FD;} + .d2-364931106 .stroke-B4{stroke:#E3E9FD;} + .d2-364931106 .stroke-B5{stroke:#EDF0FD;} + .d2-364931106 .stroke-B6{stroke:#F7F8FE;} + .d2-364931106 .stroke-AA2{stroke:#4A6FF3;} + .d2-364931106 .stroke-AA4{stroke:#EDF0FD;} + .d2-364931106 .stroke-AA5{stroke:#F7F8FE;} + .d2-364931106 .stroke-AB4{stroke:#EDF0FD;} + .d2-364931106 .stroke-AB5{stroke:#F7F8FE;} + .d2-364931106 .background-color-N1{background-color:#0A0F25;} + .d2-364931106 .background-color-N2{background-color:#676C7E;} + .d2-364931106 .background-color-N3{background-color:#9499AB;} + .d2-364931106 .background-color-N4{background-color:#CFD2DD;} + .d2-364931106 .background-color-N5{background-color:#DEE1EB;} + .d2-364931106 .background-color-N6{background-color:#EEF1F8;} + .d2-364931106 .background-color-N7{background-color:#FFFFFF;} + .d2-364931106 .background-color-B1{background-color:#0D32B2;} + .d2-364931106 .background-color-B2{background-color:#0D32B2;} + .d2-364931106 .background-color-B3{background-color:#E3E9FD;} + .d2-364931106 .background-color-B4{background-color:#E3E9FD;} + .d2-364931106 .background-color-B5{background-color:#EDF0FD;} + .d2-364931106 .background-color-B6{background-color:#F7F8FE;} + .d2-364931106 .background-color-AA2{background-color:#4A6FF3;} + .d2-364931106 .background-color-AA4{background-color:#EDF0FD;} + .d2-364931106 .background-color-AA5{background-color:#F7F8FE;} + .d2-364931106 .background-color-AB4{background-color:#EDF0FD;} + .d2-364931106 .background-color-AB5{background-color:#F7F8FE;} + .d2-364931106 .color-N1{color:#0A0F25;} + .d2-364931106 .color-N2{color:#676C7E;} + .d2-364931106 .color-N3{color:#9499AB;} + .d2-364931106 .color-N4{color:#CFD2DD;} + .d2-364931106 .color-N5{color:#DEE1EB;} + .d2-364931106 .color-N6{color:#EEF1F8;} + .d2-364931106 .color-N7{color:#FFFFFF;} + .d2-364931106 .color-B1{color:#0D32B2;} + .d2-364931106 .color-B2{color:#0D32B2;} + .d2-364931106 .color-B3{color:#E3E9FD;} + .d2-364931106 .color-B4{color:#E3E9FD;} + .d2-364931106 .color-B5{color:#EDF0FD;} + .d2-364931106 .color-B6{color:#F7F8FE;} + .d2-364931106 .color-AA2{color:#4A6FF3;} + .d2-364931106 .color-AA4{color:#EDF0FD;} + .d2-364931106 .color-AA5{color:#F7F8FE;} + .d2-364931106 .color-AB4{color:#EDF0FD;} + .d2-364931106 .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-d2-364931106);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-364931106);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-364931106);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-364931106);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-364931106);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-364931106);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-364931106);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-364931106);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>abcdabcab