diff --git a/d2layouts/d2cycle/layout.go b/d2layouts/d2cycle/layout.go index 0e9036f74..a7a4ad36d 100644 --- a/d2layouts/d2cycle/layout.go +++ b/d2layouts/d2cycle/layout.go @@ -65,6 +65,46 @@ func positionObjects(objects []*d2graph.Object, radius float64) { } } +// func createCircularArc(edge *d2graph.Edge) { +// if edge.Src == nil || edge.Dst == nil { +// return +// } + +// srcCenter := edge.Src.Center() +// dstCenter := edge.Dst.Center() + +// srcAngle := math.Atan2(srcCenter.Y, srcCenter.X) +// dstAngle := math.Atan2(dstCenter.Y, dstCenter.X) +// if dstAngle < srcAngle { +// dstAngle += 2 * math.Pi +// } + +// arcRadius := math.Hypot(srcCenter.X, srcCenter.Y) + +// path := make([]*geo.Point, 0, ARC_STEPS+1) +// for i := 0; i <= ARC_STEPS; i++ { +// t := float64(i) / float64(ARC_STEPS) +// angle := srcAngle + t*(dstAngle-srcAngle) +// x := arcRadius * math.Cos(angle) +// y := arcRadius * math.Sin(angle) +// path = append(path, geo.NewPoint(x, y)) +// } +// path[0] = srcCenter +// path[len(path)-1] = dstCenter + +// // Clamp endpoints to the boundaries of the source and destination boxes. +// _, newSrc := clampPointOutsideBox(edge.Src.Box, path, 0) +// _, newDst := clampPointOutsideBoxReverse(edge.Dst.Box, path, len(path)-1) +// 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) + +// edge.Route = path +// edge.IsCurve = true +// } func createCircularArc(edge *d2graph.Edge) { if edge.Src == nil || edge.Dst == nil { return @@ -73,15 +113,27 @@ func createCircularArc(edge *d2graph.Edge) { srcCenter := edge.Src.Center() dstCenter := edge.Dst.Center() + // Calculate angles and ensure we take the shortest arc srcAngle := math.Atan2(srcCenter.Y, srcCenter.X) dstAngle := math.Atan2(dstCenter.Y, dstCenter.X) - if dstAngle < srcAngle { - dstAngle += 2 * math.Pi + + // Calculate angular distance for both directions + clockwiseDist := dstAngle - srcAngle + + + // Choose shortest path + if math.Abs(clockwiseDist) > math.Pi { + if clockwiseDist > 0 { + dstAngle -= 2 * math.Pi + } else { + dstAngle += 2 * math.Pi + } } arcRadius := math.Hypot(srcCenter.X, srcCenter.Y) - path := make([]*geo.Point, 0, ARC_STEPS+1) + + // Generate path with corrected direction for i := 0; i <= ARC_STEPS; i++ { t := float64(i) / float64(ARC_STEPS) angle := srcAngle + t*(dstAngle-srcAngle) @@ -89,23 +141,41 @@ func createCircularArc(edge *d2graph.Edge) { y := arcRadius * math.Sin(angle) path = append(path, geo.NewPoint(x, y)) } - path[0] = srcCenter - path[len(path)-1] = dstCenter - // Clamp endpoints to the boundaries of the source and destination boxes. - _, newSrc := clampPointOutsideBox(edge.Src.Box, path, 0) - _, newDst := clampPointOutsideBoxReverse(edge.Dst.Box, path, len(path)-1) - path[0] = newSrc - path[len(path)-1] = newDst + // [Keep existing clamping and trimming code...] - // Trim redundant path points that fall inside node boundaries. - path = trimPathPoints(path, edge.Src.Box) - path = trimPathPoints(path, edge.Dst.Box) + // Calculate tangent direction based on arc direction + if len(path) >= 2 { + last := path[len(path)-1] + var tangentX, tangentY float64 + + // Determine direction using angular difference + if (dstAngle - srcAngle) > 0 { + // Counter-clockwise direction + tangentX = -last.Y + tangentY = last.X + } else { + // Clockwise direction + tangentX = last.Y + tangentY = -last.X + } + + // Normalize and adjust second-to-last point + tangentLength := math.Hypot(tangentX, tangentY) + if tangentLength > 0 { + tangentDir := geo.NewPoint(tangentX/tangentLength, tangentY/tangentLength) + delta := 10.0 + newSecondLast := geo.NewPoint( + last.X-delta*tangentDir.X, + last.Y-delta*tangentDir.Y, + ) + path[len(path)-2] = newSecondLast + } + } edge.Route = path edge.IsCurve = true } - // clampPointOutsideBox walks forward along the path until it finds a point outside the box, // then replaces the point with a precise intersection. func clampPointOutsideBox(box *geo.Box, path []*geo.Point, startIdx int) (int, *geo.Point) { diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json index 78ed2dffe..c29fd74ee 100644 --- a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json @@ -540,8 +540,40 @@ "link": "", "route": [ { - "x": 26.5, - "y": -198.22999572753906 + "x": 0, + "y": -200 + }, + { + "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, @@ -868,8 +900,48 @@ "y": -34.3849983215332 }, { - "x": 197.2519989013672, - "y": -33 + "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": 200, + "y": -10 + }, + { + "x": 200, + "y": 0 } ], "isCurve": true, @@ -904,8 +976,48 @@ "link": "", "route": [ { - "x": 197.2519989013672, - "y": 33 + "x": 200, + "y": 0 + }, + { + "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, @@ -1232,8 +1344,40 @@ "y": 198.00399780273438 }, { - "x": 26.5, - "y": 198.22999572753906 + "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": 10, + "y": 200 + }, + { + "x": 0, + "y": 200 } ], "isCurve": true, @@ -1268,8 +1412,40 @@ "link": "", "route": [ { - "x": -26.499000549316406, - "y": 198.22999572753906 + "x": 0, + "y": 200 + }, + { + "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, @@ -1596,8 +1772,48 @@ "y": 34.3849983215332 }, { - "x": -197.2519989013672, - "y": 33 + "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": -200, + "y": 10 + }, + { + "x": -200, + "y": 0 } ], "isCurve": true, @@ -1632,8 +1848,32 @@ "link": "", "route": [ { - "x": 539.5, - "y": -148.2259979248047 + "x": 513, + "y": -150 + }, + { + "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, @@ -1976,8 +2216,40 @@ "y": 115.77300262451172 }, { - "x": 701.4329833984375, - "y": 116.9990005493164 + "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": 691.2050170898438, + "y": 141.33900451660156 + }, + { + "x": 686.2050170898438, + "y": 149.99899291992188 } ], "isCurve": true, @@ -2012,8 +2284,44 @@ "link": "", "route": [ { - "x": 662.3569946289062, - "y": 182.99899291992188 + "x": 686.2050170898438, + "y": 150 + }, + { + "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, @@ -2340,8 +2648,44 @@ "y": 183.8260040283203 }, { - "x": 363.6419982910156, - "y": 183 + "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": 344.79400634765625, + "y": 158.66000366210938 + }, + { + "x": 339.79400634765625, + "y": 150 } ], "isCurve": true, @@ -2376,8 +2720,24 @@ "link": "", "route": [ { - "x": 998.5, - "y": -198.21800231933594 + "x": 972, + "y": -200 + }, + { + "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, @@ -2744,8 +3104,24 @@ "y": 197.53700256347656 }, { - "x": 998.5, - "y": 198.21800231933594 + "x": 997.0659790039062, + "y": 198.4219970703125 + }, + { + "x": 990.8209838867188, + "y": 199.11199951171875 + }, + { + "x": 984.5579833984375, + "y": 199.60499572753906 + }, + { + "x": 982, + "y": 200 + }, + { + "x": 972, + "y": 200 } ], "isCurve": true, diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg index 015478d74..8d34eb7ff 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-3985017530 .fill-N1{fill:#0A0F25;} + .d2-3985017530 .fill-N2{fill:#676C7E;} + .d2-3985017530 .fill-N3{fill:#9499AB;} + .d2-3985017530 .fill-N4{fill:#CFD2DD;} + .d2-3985017530 .fill-N5{fill:#DEE1EB;} + .d2-3985017530 .fill-N6{fill:#EEF1F8;} + .d2-3985017530 .fill-N7{fill:#FFFFFF;} + .d2-3985017530 .fill-B1{fill:#0D32B2;} + .d2-3985017530 .fill-B2{fill:#0D32B2;} + .d2-3985017530 .fill-B3{fill:#E3E9FD;} + .d2-3985017530 .fill-B4{fill:#E3E9FD;} + .d2-3985017530 .fill-B5{fill:#EDF0FD;} + .d2-3985017530 .fill-B6{fill:#F7F8FE;} + .d2-3985017530 .fill-AA2{fill:#4A6FF3;} + .d2-3985017530 .fill-AA4{fill:#EDF0FD;} + .d2-3985017530 .fill-AA5{fill:#F7F8FE;} + .d2-3985017530 .fill-AB4{fill:#EDF0FD;} + .d2-3985017530 .fill-AB5{fill:#F7F8FE;} + .d2-3985017530 .stroke-N1{stroke:#0A0F25;} + .d2-3985017530 .stroke-N2{stroke:#676C7E;} + .d2-3985017530 .stroke-N3{stroke:#9499AB;} + .d2-3985017530 .stroke-N4{stroke:#CFD2DD;} + .d2-3985017530 .stroke-N5{stroke:#DEE1EB;} + .d2-3985017530 .stroke-N6{stroke:#EEF1F8;} + .d2-3985017530 .stroke-N7{stroke:#FFFFFF;} + .d2-3985017530 .stroke-B1{stroke:#0D32B2;} + .d2-3985017530 .stroke-B2{stroke:#0D32B2;} + .d2-3985017530 .stroke-B3{stroke:#E3E9FD;} + .d2-3985017530 .stroke-B4{stroke:#E3E9FD;} + .d2-3985017530 .stroke-B5{stroke:#EDF0FD;} + .d2-3985017530 .stroke-B6{stroke:#F7F8FE;} + .d2-3985017530 .stroke-AA2{stroke:#4A6FF3;} + .d2-3985017530 .stroke-AA4{stroke:#EDF0FD;} + .d2-3985017530 .stroke-AA5{stroke:#F7F8FE;} + .d2-3985017530 .stroke-AB4{stroke:#EDF0FD;} + .d2-3985017530 .stroke-AB5{stroke:#F7F8FE;} + .d2-3985017530 .background-color-N1{background-color:#0A0F25;} + .d2-3985017530 .background-color-N2{background-color:#676C7E;} + .d2-3985017530 .background-color-N3{background-color:#9499AB;} + .d2-3985017530 .background-color-N4{background-color:#CFD2DD;} + .d2-3985017530 .background-color-N5{background-color:#DEE1EB;} + .d2-3985017530 .background-color-N6{background-color:#EEF1F8;} + .d2-3985017530 .background-color-N7{background-color:#FFFFFF;} + .d2-3985017530 .background-color-B1{background-color:#0D32B2;} + .d2-3985017530 .background-color-B2{background-color:#0D32B2;} + .d2-3985017530 .background-color-B3{background-color:#E3E9FD;} + .d2-3985017530 .background-color-B4{background-color:#E3E9FD;} + .d2-3985017530 .background-color-B5{background-color:#EDF0FD;} + .d2-3985017530 .background-color-B6{background-color:#F7F8FE;} + .d2-3985017530 .background-color-AA2{background-color:#4A6FF3;} + .d2-3985017530 .background-color-AA4{background-color:#EDF0FD;} + .d2-3985017530 .background-color-AA5{background-color:#F7F8FE;} + .d2-3985017530 .background-color-AB4{background-color:#EDF0FD;} + .d2-3985017530 .background-color-AB5{background-color:#F7F8FE;} + .d2-3985017530 .color-N1{color:#0A0F25;} + .d2-3985017530 .color-N2{color:#676C7E;} + .d2-3985017530 .color-N3{color:#9499AB;} + .d2-3985017530 .color-N4{color:#CFD2DD;} + .d2-3985017530 .color-N5{color:#DEE1EB;} + .d2-3985017530 .color-N6{color:#EEF1F8;} + .d2-3985017530 .color-N7{color:#FFFFFF;} + .d2-3985017530 .color-B1{color:#0D32B2;} + .d2-3985017530 .color-B2{color:#0D32B2;} + .d2-3985017530 .color-B3{color:#E3E9FD;} + .d2-3985017530 .color-B4{color:#E3E9FD;} + .d2-3985017530 .color-B5{color:#EDF0FD;} + .d2-3985017530 .color-B6{color:#F7F8FE;} + .d2-3985017530 .color-AA2{color:#4A6FF3;} + .d2-3985017530 .color-AA4{color:#EDF0FD;} + .d2-3985017530 .color-AA5{color:#F7F8FE;} + .d2-3985017530 .color-AB4{color:#EDF0FD;} + .d2-3985017530 .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-3985017530);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-3985017530);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-3985017530);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-3985017530);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-3985017530);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-3985017530);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-3985017530);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-3985017530);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-3985017530);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..61b81e2e8 100644 --- a/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json @@ -540,8 +540,40 @@ "link": "", "route": [ { - "x": 38.5, - "y": -186.22999572753906 + "x": 12, + "y": -188 + }, + { + "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, @@ -868,8 +900,48 @@ "y": -22.385000228881836 }, { - "x": 209.2519989013672, - "y": -21 + "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": 212, + "y": 2 + }, + { + "x": 212, + "y": 12 } ], "isCurve": true, @@ -904,8 +976,48 @@ "link": "", "route": [ { - "x": 209.2519989013672, - "y": 45 + "x": 212, + "y": 12 + }, + { + "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, @@ -1232,8 +1344,40 @@ "y": 210.00399780273438 }, { - "x": 38.5, - "y": 210.22999572753906 + "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": 22, + "y": 212 + }, + { + "x": 12, + "y": 212 } ], "isCurve": true, @@ -1268,8 +1412,40 @@ "link": "", "route": [ { - "x": -14.49899959564209, - "y": 210.22999572753906 + "x": 12, + "y": 212 + }, + { + "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, @@ -1596,8 +1772,48 @@ "y": 46.3849983215332 }, { - "x": -185.2519989013672, - "y": 45 + "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": -188, + "y": 22 + }, + { + "x": -188, + "y": 12 } ], "isCurve": true, @@ -1632,8 +1848,32 @@ "link": "", "route": [ { - "x": 512, - "y": -136.2259979248047 + "x": 485.5, + "y": -138 + }, + { + "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, @@ -1976,8 +2216,40 @@ "y": 127.77300262451172 }, { - "x": 673.9329833984375, - "y": 128.99899291992188 + "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": 663.7050170898438, + "y": 153.33900451660156 + }, + { + "x": 658.7050170898438, + "y": 161.99899291992188 } ], "isCurve": true, @@ -2012,8 +2284,44 @@ "link": "", "route": [ { - "x": 634.8569946289062, - "y": 194.99899291992188 + "x": 658.7050170898438, + "y": 161.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, @@ -2340,8 +2648,44 @@ "y": 195.8260040283203 }, { - "x": 336.1419982910156, - "y": 195 + "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": 317.29400634765625, + "y": 170.66000366210938 + }, + { + "x": 312.29400634765625, + "y": 162 } ], "isCurve": true, @@ -2376,8 +2720,24 @@ "link": "", "route": [ { - "x": 931.4099731445312, - "y": -186.21800231933594 + "x": 904.9099731445312, + "y": -188 + }, + { + "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, @@ -2744,8 +3104,24 @@ "y": 209.53700256347656 }, { - "x": 931.4099731445312, - "y": 210.21800231933594 + "x": 929.9760131835938, + "y": 210.4219970703125 + }, + { + "x": 923.7310180664062, + "y": 211.11199951171875 + }, + { + "x": 917.468017578125, + "y": 211.60499572753906 + }, + { + "x": 914.9099731445312, + "y": 212 + }, + { + "x": 904.9099731445312, + "y": 212 } ], "isCurve": true, diff --git a/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg index 21e65f752..0dd507b75 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-2879875917 .fill-N1{fill:#0A0F25;} + .d2-2879875917 .fill-N2{fill:#676C7E;} + .d2-2879875917 .fill-N3{fill:#9499AB;} + .d2-2879875917 .fill-N4{fill:#CFD2DD;} + .d2-2879875917 .fill-N5{fill:#DEE1EB;} + .d2-2879875917 .fill-N6{fill:#EEF1F8;} + .d2-2879875917 .fill-N7{fill:#FFFFFF;} + .d2-2879875917 .fill-B1{fill:#0D32B2;} + .d2-2879875917 .fill-B2{fill:#0D32B2;} + .d2-2879875917 .fill-B3{fill:#E3E9FD;} + .d2-2879875917 .fill-B4{fill:#E3E9FD;} + .d2-2879875917 .fill-B5{fill:#EDF0FD;} + .d2-2879875917 .fill-B6{fill:#F7F8FE;} + .d2-2879875917 .fill-AA2{fill:#4A6FF3;} + .d2-2879875917 .fill-AA4{fill:#EDF0FD;} + .d2-2879875917 .fill-AA5{fill:#F7F8FE;} + .d2-2879875917 .fill-AB4{fill:#EDF0FD;} + .d2-2879875917 .fill-AB5{fill:#F7F8FE;} + .d2-2879875917 .stroke-N1{stroke:#0A0F25;} + .d2-2879875917 .stroke-N2{stroke:#676C7E;} + .d2-2879875917 .stroke-N3{stroke:#9499AB;} + .d2-2879875917 .stroke-N4{stroke:#CFD2DD;} + .d2-2879875917 .stroke-N5{stroke:#DEE1EB;} + .d2-2879875917 .stroke-N6{stroke:#EEF1F8;} + .d2-2879875917 .stroke-N7{stroke:#FFFFFF;} + .d2-2879875917 .stroke-B1{stroke:#0D32B2;} + .d2-2879875917 .stroke-B2{stroke:#0D32B2;} + .d2-2879875917 .stroke-B3{stroke:#E3E9FD;} + .d2-2879875917 .stroke-B4{stroke:#E3E9FD;} + .d2-2879875917 .stroke-B5{stroke:#EDF0FD;} + .d2-2879875917 .stroke-B6{stroke:#F7F8FE;} + .d2-2879875917 .stroke-AA2{stroke:#4A6FF3;} + .d2-2879875917 .stroke-AA4{stroke:#EDF0FD;} + .d2-2879875917 .stroke-AA5{stroke:#F7F8FE;} + .d2-2879875917 .stroke-AB4{stroke:#EDF0FD;} + .d2-2879875917 .stroke-AB5{stroke:#F7F8FE;} + .d2-2879875917 .background-color-N1{background-color:#0A0F25;} + .d2-2879875917 .background-color-N2{background-color:#676C7E;} + .d2-2879875917 .background-color-N3{background-color:#9499AB;} + .d2-2879875917 .background-color-N4{background-color:#CFD2DD;} + .d2-2879875917 .background-color-N5{background-color:#DEE1EB;} + .d2-2879875917 .background-color-N6{background-color:#EEF1F8;} + .d2-2879875917 .background-color-N7{background-color:#FFFFFF;} + .d2-2879875917 .background-color-B1{background-color:#0D32B2;} + .d2-2879875917 .background-color-B2{background-color:#0D32B2;} + .d2-2879875917 .background-color-B3{background-color:#E3E9FD;} + .d2-2879875917 .background-color-B4{background-color:#E3E9FD;} + .d2-2879875917 .background-color-B5{background-color:#EDF0FD;} + .d2-2879875917 .background-color-B6{background-color:#F7F8FE;} + .d2-2879875917 .background-color-AA2{background-color:#4A6FF3;} + .d2-2879875917 .background-color-AA4{background-color:#EDF0FD;} + .d2-2879875917 .background-color-AA5{background-color:#F7F8FE;} + .d2-2879875917 .background-color-AB4{background-color:#EDF0FD;} + .d2-2879875917 .background-color-AB5{background-color:#F7F8FE;} + .d2-2879875917 .color-N1{color:#0A0F25;} + .d2-2879875917 .color-N2{color:#676C7E;} + .d2-2879875917 .color-N3{color:#9499AB;} + .d2-2879875917 .color-N4{color:#CFD2DD;} + .d2-2879875917 .color-N5{color:#DEE1EB;} + .d2-2879875917 .color-N6{color:#EEF1F8;} + .d2-2879875917 .color-N7{color:#FFFFFF;} + .d2-2879875917 .color-B1{color:#0D32B2;} + .d2-2879875917 .color-B2{color:#0D32B2;} + .d2-2879875917 .color-B3{color:#E3E9FD;} + .d2-2879875917 .color-B4{color:#E3E9FD;} + .d2-2879875917 .color-B5{color:#EDF0FD;} + .d2-2879875917 .color-B6{color:#F7F8FE;} + .d2-2879875917 .color-AA2{color:#4A6FF3;} + .d2-2879875917 .color-AA4{color:#EDF0FD;} + .d2-2879875917 .color-AA5{color:#F7F8FE;} + .d2-2879875917 .color-AB4{color:#EDF0FD;} + .d2-2879875917 .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-2879875917);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-2879875917);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-2879875917);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-2879875917);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-2879875917);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-2879875917);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-2879875917);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-2879875917);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>abcdabcab