From d594af3f4af6382226d5d718f297d7a184e7eb7a Mon Sep 17 00:00:00 2001 From: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com> Date: Sat, 8 Mar 2025 10:56:38 +0000 Subject: [PATCH] try --- d2layouts/d2cycle/layout.go | 54 ++++--- .../txtar/cycle-diagram/dagre/board.exp.json | 60 +++---- .../txtar/cycle-diagram/dagre/sketch.exp.svg | 152 +++++++++--------- .../txtar/cycle-diagram/elk/board.exp.json | 60 +++---- .../txtar/cycle-diagram/elk/sketch.exp.svg | 152 +++++++++--------- 5 files changed, 242 insertions(+), 236 deletions(-) diff --git a/d2layouts/d2cycle/layout.go b/d2layouts/d2cycle/layout.go index 6cee125be..642344a44 100644 --- a/d2layouts/d2cycle/layout.go +++ b/d2layouts/d2cycle/layout.go @@ -14,7 +14,7 @@ import ( const ( MIN_RADIUS = 200 PADDING = 20 - MIN_SEGMENT_LEN = 10 + MIN_SEGMENT_LEN = 10.0 // Changed to float64 ARC_STEPS = 100 ) @@ -41,22 +41,12 @@ func Layout(ctx context.Context, g *d2graph.Graph, layout d2graph.LayoutGraph) e func calculateRadius(objects []*d2graph.Object) float64 { numObjects := float64(len(objects)) - if numObjects == 0 { - return MIN_RADIUS - } - - maxDiagonal := 0.0 + maxSize := 0.0 for _, obj := range objects { - // Calculate the diagonal of the object's bounding box - diagonal := math.Sqrt(obj.Box.Width*obj.Box.Width + obj.Box.Height*obj.Box.Height) - if diagonal > maxDiagonal { - maxDiagonal = diagonal - } + size := math.Max(obj.Box.Width, obj.Box.Height) + maxSize = math.Max(maxSize, size) } - - // Required chord length: sum of two radii (maxDiagonal/2) + padding - requiredChordLength := maxDiagonal + PADDING - minRadius := requiredChordLength / (2 * math.Sin(math.Pi/numObjects)) + minRadius := (maxSize/2.0 + PADDING) / math.Sin(math.Pi/numObjects) return math.Max(minRadius, MIN_RADIUS) } @@ -83,14 +73,27 @@ func createCircularArc(edge *d2graph.Edge) { srcCenter := edge.Src.Center() dstCenter := edge.Dst.Center() + // Calculate the angle of each object from the origin (0,0) srcAngle := math.Atan2(srcCenter.Y, srcCenter.X) dstAngle := math.Atan2(dstCenter.Y, dstCenter.X) + + // Determine the shortest arc direction if dstAngle < srcAngle { - dstAngle += 2 * math.Pi + if srcAngle - dstAngle > math.Pi { + dstAngle += 2 * math.Pi + } + } else { + if dstAngle - srcAngle > math.Pi { + srcAngle += 2 * math.Pi + } } - arcRadius := math.Hypot(srcCenter.X, srcCenter.Y) + // Use the average radius for a smooth circular arc + srcRadius := math.Hypot(srcCenter.X, srcCenter.Y) + dstRadius := math.Hypot(dstCenter.X, dstCenter.Y) + arcRadius := (srcRadius + dstRadius) / 2 + // Create a perfectly circular arc with more points for smoothness path := make([]*geo.Point, 0, ARC_STEPS+1) for i := 0; i <= ARC_STEPS; i++ { t := float64(i) / float64(ARC_STEPS) @@ -99,27 +102,31 @@ func createCircularArc(edge *d2graph.Edge) { y := arcRadius * math.Sin(angle) path = append(path, geo.NewPoint(x, y)) } + + // Ensure the path starts and ends at the centers path[0] = srcCenter path[len(path)-1] = dstCenter - // Clamp endpoints to the boundaries of the source and destination boxes. + // Find precise intersection points with object boundaries _, 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. + // Trim points that are inside the objects' boxes path = trimPathPoints(path, edge.Src.Box) path = trimPathPoints(path, edge.Dst.Box) edge.Route = path edge.IsCurve = true + // Adjust the final segment for proper arrow rendering if len(edge.Route) >= 2 { lastIndex := len(edge.Route) - 1 lastPoint := edge.Route[lastIndex] secondLastPoint := edge.Route[lastIndex-1] + // Calculate tangent at the intersection point (perpendicular to radius) tangentX := -lastPoint.Y tangentY := lastPoint.X mag := math.Hypot(tangentX, tangentY) @@ -127,8 +134,8 @@ func createCircularArc(edge *d2graph.Edge) { tangentX /= mag tangentY /= mag } - const MIN_SEGMENT_LEN = 4.159 + // Check if final segment needs adjustment dx := lastPoint.X - secondLastPoint.X dy := lastPoint.Y - secondLastPoint.Y segLength := math.Hypot(dx, dy) @@ -136,9 +143,8 @@ func createCircularArc(edge *d2graph.Edge) { currentDirX := dx / segLength currentDirY := dy / segLength - // Check if we need to adjust the direction - if segLength < MIN_SEGMENT_LEN || (currentDirX*tangentX+currentDirY*tangentY) < 0.999 { - // Create new point along tangent direction + // If segment is too short or not aligned with the tangent + if segLength < MIN_SEGMENT_LEN || (currentDirX*tangentX+currentDirY*tangentY) < 0.99 { adjustLength := MIN_SEGMENT_LEN // Now float64 if segLength >= MIN_SEGMENT_LEN { adjustLength = segLength // Both are float64 now @@ -335,4 +341,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 a44184a6d..e073c49a7 100644 --- a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json @@ -1408,8 +1408,8 @@ "y": -37.47600173950195 }, { - "x": 196.5659942626953, - "y": -37.10100173950195 + "x": 195.6020050048828, + "y": -42.86199951171875 }, { "x": 197.2519989013672, @@ -1772,8 +1772,8 @@ "y": 197.53700256347656 }, { - "x": 30.621999740600586, - "y": 197.6790008544922 + "x": 36.4109992980957, + "y": 196.90499877929688 }, { "x": 26.5, @@ -2136,8 +2136,8 @@ "y": 37.47600173950195 }, { - "x": -196.5659942626953, - "y": 37.10100173950195 + "x": -195.6020050048828, + "y": 42.86199951171875 }, { "x": -197.2519989013672, @@ -2516,8 +2516,8 @@ "y": 111.8030014038086 }, { - "x": 702.8259887695312, - "y": 113.08100128173828 + "x": 704.7830200195312, + "y": 107.5770034790039 }, { "x": 701.4329833984375, @@ -2880,8 +2880,8 @@ "y": 186.90899658203125 }, { - "x": 366.4079895019531, - "y": 186.1060028076172 + "x": 370.2919921875, + "y": 190.46800231933594 }, { "x": 363.6419982910156, @@ -3284,8 +3284,8 @@ "y": 196.45700073242188 }, { - "x": 1003.2860107421875, - "y": 197.53700256347656 + "x": 1008.4110107421875, + "y": 196.89300537109375 }, { "x": 998.5, @@ -3596,8 +3596,8 @@ "y": -135.375 }, { - "x": 1231.5989990234375, - "y": -136.1060028076172 + "x": 1227.7139892578125, + "y": -140.46800231933594 }, { "x": 1234.364990234375, @@ -3896,8 +3896,8 @@ "y": 63.79100036621094 }, { - "x": 1274.833984375, - "y": 63.08100128173828 + "x": 1276.7900390625, + "y": 57.57699966430664 }, { "x": 1273.43994140625, @@ -4208,8 +4208,8 @@ "y": 197.85400390625 }, { - "x": 1116.1199951171875, - "y": 197.6060028076172 + "x": 1121.907958984375, + "y": 196.8179931640625 }, { "x": 1112, @@ -4520,8 +4520,8 @@ "y": 135.375 }, { - "x": 938.4000244140625, - "y": 136.1060028076172 + "x": 942.2849731445312, + "y": 140.46800231933594 }, { "x": 935.6339721679688, @@ -4820,8 +4820,8 @@ "y": -63.79100036621094 }, { - "x": 895.1649780273438, - "y": -63.08100128173828 + "x": 893.208984375, + "y": -57.57699966430664 }, { "x": 896.5590209960938, @@ -5160,8 +5160,8 @@ "y": -78.54499816894531 }, { - "x": 1718.126953125, - "y": -78.46499633789062 + "x": 1715.3590087890625, + "y": -83.60800170898438 }, { "x": 1720.0989990234375, @@ -5492,8 +5492,8 @@ "y": 156.90899658203125 }, { - "x": 1690.9420166015625, - "y": 155.73899841308594 + "x": 1694.9930419921875, + "y": 151.53199768066406 }, { "x": 1688.0570068359375, @@ -5832,8 +5832,8 @@ "y": 199.88099670410156 }, { - "x": 1457.1510009765625, - "y": 200.20199584960938 + "x": 1462.3590087890625, + "y": 202.8470001220703 }, { "x": 1453.4420166015625, @@ -6160,8 +6160,8 @@ "y": -5.065999984741211 }, { - "x": 1345.489013671875, - "y": -4.686999797821045 + "x": 1344.64794921875, + "y": 1.0920000076293945 }, { "x": 1346.0880126953125, diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg index b1b31e77f..966687b6b 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 @@ -abcdabcababcdefabcde + .d2-359737804 .fill-N1{fill:#0A0F25;} + .d2-359737804 .fill-N2{fill:#676C7E;} + .d2-359737804 .fill-N3{fill:#9499AB;} + .d2-359737804 .fill-N4{fill:#CFD2DD;} + .d2-359737804 .fill-N5{fill:#DEE1EB;} + .d2-359737804 .fill-N6{fill:#EEF1F8;} + .d2-359737804 .fill-N7{fill:#FFFFFF;} + .d2-359737804 .fill-B1{fill:#0D32B2;} + .d2-359737804 .fill-B2{fill:#0D32B2;} + .d2-359737804 .fill-B3{fill:#E3E9FD;} + .d2-359737804 .fill-B4{fill:#E3E9FD;} + .d2-359737804 .fill-B5{fill:#EDF0FD;} + .d2-359737804 .fill-B6{fill:#F7F8FE;} + .d2-359737804 .fill-AA2{fill:#4A6FF3;} + .d2-359737804 .fill-AA4{fill:#EDF0FD;} + .d2-359737804 .fill-AA5{fill:#F7F8FE;} + .d2-359737804 .fill-AB4{fill:#EDF0FD;} + .d2-359737804 .fill-AB5{fill:#F7F8FE;} + .d2-359737804 .stroke-N1{stroke:#0A0F25;} + .d2-359737804 .stroke-N2{stroke:#676C7E;} + .d2-359737804 .stroke-N3{stroke:#9499AB;} + .d2-359737804 .stroke-N4{stroke:#CFD2DD;} + .d2-359737804 .stroke-N5{stroke:#DEE1EB;} + .d2-359737804 .stroke-N6{stroke:#EEF1F8;} + .d2-359737804 .stroke-N7{stroke:#FFFFFF;} + .d2-359737804 .stroke-B1{stroke:#0D32B2;} + .d2-359737804 .stroke-B2{stroke:#0D32B2;} + .d2-359737804 .stroke-B3{stroke:#E3E9FD;} + .d2-359737804 .stroke-B4{stroke:#E3E9FD;} + .d2-359737804 .stroke-B5{stroke:#EDF0FD;} + .d2-359737804 .stroke-B6{stroke:#F7F8FE;} + .d2-359737804 .stroke-AA2{stroke:#4A6FF3;} + .d2-359737804 .stroke-AA4{stroke:#EDF0FD;} + .d2-359737804 .stroke-AA5{stroke:#F7F8FE;} + .d2-359737804 .stroke-AB4{stroke:#EDF0FD;} + .d2-359737804 .stroke-AB5{stroke:#F7F8FE;} + .d2-359737804 .background-color-N1{background-color:#0A0F25;} + .d2-359737804 .background-color-N2{background-color:#676C7E;} + .d2-359737804 .background-color-N3{background-color:#9499AB;} + .d2-359737804 .background-color-N4{background-color:#CFD2DD;} + .d2-359737804 .background-color-N5{background-color:#DEE1EB;} + .d2-359737804 .background-color-N6{background-color:#EEF1F8;} + .d2-359737804 .background-color-N7{background-color:#FFFFFF;} + .d2-359737804 .background-color-B1{background-color:#0D32B2;} + .d2-359737804 .background-color-B2{background-color:#0D32B2;} + .d2-359737804 .background-color-B3{background-color:#E3E9FD;} + .d2-359737804 .background-color-B4{background-color:#E3E9FD;} + .d2-359737804 .background-color-B5{background-color:#EDF0FD;} + .d2-359737804 .background-color-B6{background-color:#F7F8FE;} + .d2-359737804 .background-color-AA2{background-color:#4A6FF3;} + .d2-359737804 .background-color-AA4{background-color:#EDF0FD;} + .d2-359737804 .background-color-AA5{background-color:#F7F8FE;} + .d2-359737804 .background-color-AB4{background-color:#EDF0FD;} + .d2-359737804 .background-color-AB5{background-color:#F7F8FE;} + .d2-359737804 .color-N1{color:#0A0F25;} + .d2-359737804 .color-N2{color:#676C7E;} + .d2-359737804 .color-N3{color:#9499AB;} + .d2-359737804 .color-N4{color:#CFD2DD;} + .d2-359737804 .color-N5{color:#DEE1EB;} + .d2-359737804 .color-N6{color:#EEF1F8;} + .d2-359737804 .color-N7{color:#FFFFFF;} + .d2-359737804 .color-B1{color:#0D32B2;} + .d2-359737804 .color-B2{color:#0D32B2;} + .d2-359737804 .color-B3{color:#E3E9FD;} + .d2-359737804 .color-B4{color:#E3E9FD;} + .d2-359737804 .color-B5{color:#EDF0FD;} + .d2-359737804 .color-B6{color:#F7F8FE;} + .d2-359737804 .color-AA2{color:#4A6FF3;} + .d2-359737804 .color-AA4{color:#EDF0FD;} + .d2-359737804 .color-AA5{color:#F7F8FE;} + .d2-359737804 .color-AB4{color:#EDF0FD;} + .d2-359737804 .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-359737804);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-359737804);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-359737804);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-359737804);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-359737804);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-359737804);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-359737804);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-359737804);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>abcdabcababcdefabcde diff --git a/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json b/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json index bc4abcf55..112d4573c 100644 --- a/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json @@ -1408,8 +1408,8 @@ "y": -25.47599983215332 }, { - "x": 208.5659942626953, - "y": -25.10099983215332 + "x": 207.6020050048828, + "y": -30.86199951171875 }, { "x": 209.2519989013672, @@ -1772,8 +1772,8 @@ "y": 209.53700256347656 }, { - "x": 42.62200164794922, - "y": 209.6790008544922 + "x": 48.4109992980957, + "y": 208.90499877929688 }, { "x": 38.5, @@ -2136,8 +2136,8 @@ "y": 49.47600173950195 }, { - "x": -184.5659942626953, - "y": 49.10100173950195 + "x": -183.6020050048828, + "y": 54.86199951171875 }, { "x": -185.2519989013672, @@ -2516,8 +2516,8 @@ "y": 123.8030014038086 }, { - "x": 675.3259887695312, - "y": 125.08100128173828 + "x": 677.2830200195312, + "y": 119.5770034790039 }, { "x": 673.9329833984375, @@ -2880,8 +2880,8 @@ "y": 198.90899658203125 }, { - "x": 338.9079895019531, - "y": 198.1060028076172 + "x": 342.7919921875, + "y": 202.46800231933594 }, { "x": 336.1419982910156, @@ -3284,8 +3284,8 @@ "y": 208.45700073242188 }, { - "x": 936.197021484375, - "y": 209.53700256347656 + "x": 941.3209838867188, + "y": 208.89300537109375 }, { "x": 931.4099731445312, @@ -3596,8 +3596,8 @@ "y": -123.375 }, { - "x": 1124.509033203125, - "y": -124.10600280761719 + "x": 1120.625, + "y": -128.46800231933594 }, { "x": 1127.2750244140625, @@ -3896,8 +3896,8 @@ "y": 75.79100036621094 }, { - "x": 1167.7440185546875, - "y": 75.08100128173828 + "x": 1169.7010498046875, + "y": 69.5770034790039 }, { "x": 1166.3509521484375, @@ -4208,8 +4208,8 @@ "y": 209.85400390625 }, { - "x": 1009.031005859375, - "y": 209.6060028076172 + "x": 1014.8179931640625, + "y": 208.8179931640625 }, { "x": 1004.9099731445312, @@ -4520,8 +4520,8 @@ "y": 147.375 }, { - "x": 831.3099975585938, - "y": 148.1060028076172 + "x": 835.1950073242188, + "y": 152.46800231933594 }, { "x": 828.5449829101562, @@ -4820,8 +4820,8 @@ "y": -51.79100036621094 }, { - "x": 788.0750122070312, - "y": -51.08100128173828 + "x": 786.1190185546875, + "y": -45.57699966430664 }, { "x": 789.468994140625, @@ -5160,8 +5160,8 @@ "y": -67.4469985961914 }, { - "x": 1571.447998046875, - "y": -67.36699676513672 + "x": 1568.678955078125, + "y": -72.51000213623047 }, { "x": 1573.4189453125, @@ -5492,8 +5492,8 @@ "y": 168.0070037841797 }, { - "x": 1544.261962890625, - "y": 166.83799743652344 + "x": 1548.31396484375, + "y": 162.6300048828125 }, { "x": 1541.376953125, @@ -5832,8 +5832,8 @@ "y": 210.97900390625 }, { - "x": 1310.470947265625, - "y": 211.30099487304688 + "x": 1315.678955078125, + "y": 213.94500732421875 }, { "x": 1306.762939453125, @@ -6160,8 +6160,8 @@ "y": 6.031000137329102 }, { - "x": 1198.81005859375, - "y": 6.409999847412109 + "x": 1197.968994140625, + "y": 12.1899995803833 }, { "x": 1199.4090576171875, diff --git a/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg index 35f09dec2..a1eaa3577 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 @@ -abcdabcababcdefabcde + .d2-3450658605 .fill-N1{fill:#0A0F25;} + .d2-3450658605 .fill-N2{fill:#676C7E;} + .d2-3450658605 .fill-N3{fill:#9499AB;} + .d2-3450658605 .fill-N4{fill:#CFD2DD;} + .d2-3450658605 .fill-N5{fill:#DEE1EB;} + .d2-3450658605 .fill-N6{fill:#EEF1F8;} + .d2-3450658605 .fill-N7{fill:#FFFFFF;} + .d2-3450658605 .fill-B1{fill:#0D32B2;} + .d2-3450658605 .fill-B2{fill:#0D32B2;} + .d2-3450658605 .fill-B3{fill:#E3E9FD;} + .d2-3450658605 .fill-B4{fill:#E3E9FD;} + .d2-3450658605 .fill-B5{fill:#EDF0FD;} + .d2-3450658605 .fill-B6{fill:#F7F8FE;} + .d2-3450658605 .fill-AA2{fill:#4A6FF3;} + .d2-3450658605 .fill-AA4{fill:#EDF0FD;} + .d2-3450658605 .fill-AA5{fill:#F7F8FE;} + .d2-3450658605 .fill-AB4{fill:#EDF0FD;} + .d2-3450658605 .fill-AB5{fill:#F7F8FE;} + .d2-3450658605 .stroke-N1{stroke:#0A0F25;} + .d2-3450658605 .stroke-N2{stroke:#676C7E;} + .d2-3450658605 .stroke-N3{stroke:#9499AB;} + .d2-3450658605 .stroke-N4{stroke:#CFD2DD;} + .d2-3450658605 .stroke-N5{stroke:#DEE1EB;} + .d2-3450658605 .stroke-N6{stroke:#EEF1F8;} + .d2-3450658605 .stroke-N7{stroke:#FFFFFF;} + .d2-3450658605 .stroke-B1{stroke:#0D32B2;} + .d2-3450658605 .stroke-B2{stroke:#0D32B2;} + .d2-3450658605 .stroke-B3{stroke:#E3E9FD;} + .d2-3450658605 .stroke-B4{stroke:#E3E9FD;} + .d2-3450658605 .stroke-B5{stroke:#EDF0FD;} + .d2-3450658605 .stroke-B6{stroke:#F7F8FE;} + .d2-3450658605 .stroke-AA2{stroke:#4A6FF3;} + .d2-3450658605 .stroke-AA4{stroke:#EDF0FD;} + .d2-3450658605 .stroke-AA5{stroke:#F7F8FE;} + .d2-3450658605 .stroke-AB4{stroke:#EDF0FD;} + .d2-3450658605 .stroke-AB5{stroke:#F7F8FE;} + .d2-3450658605 .background-color-N1{background-color:#0A0F25;} + .d2-3450658605 .background-color-N2{background-color:#676C7E;} + .d2-3450658605 .background-color-N3{background-color:#9499AB;} + .d2-3450658605 .background-color-N4{background-color:#CFD2DD;} + .d2-3450658605 .background-color-N5{background-color:#DEE1EB;} + .d2-3450658605 .background-color-N6{background-color:#EEF1F8;} + .d2-3450658605 .background-color-N7{background-color:#FFFFFF;} + .d2-3450658605 .background-color-B1{background-color:#0D32B2;} + .d2-3450658605 .background-color-B2{background-color:#0D32B2;} + .d2-3450658605 .background-color-B3{background-color:#E3E9FD;} + .d2-3450658605 .background-color-B4{background-color:#E3E9FD;} + .d2-3450658605 .background-color-B5{background-color:#EDF0FD;} + .d2-3450658605 .background-color-B6{background-color:#F7F8FE;} + .d2-3450658605 .background-color-AA2{background-color:#4A6FF3;} + .d2-3450658605 .background-color-AA4{background-color:#EDF0FD;} + .d2-3450658605 .background-color-AA5{background-color:#F7F8FE;} + .d2-3450658605 .background-color-AB4{background-color:#EDF0FD;} + .d2-3450658605 .background-color-AB5{background-color:#F7F8FE;} + .d2-3450658605 .color-N1{color:#0A0F25;} + .d2-3450658605 .color-N2{color:#676C7E;} + .d2-3450658605 .color-N3{color:#9499AB;} + .d2-3450658605 .color-N4{color:#CFD2DD;} + .d2-3450658605 .color-N5{color:#DEE1EB;} + .d2-3450658605 .color-N6{color:#EEF1F8;} + .d2-3450658605 .color-N7{color:#FFFFFF;} + .d2-3450658605 .color-B1{color:#0D32B2;} + .d2-3450658605 .color-B2{color:#0D32B2;} + .d2-3450658605 .color-B3{color:#E3E9FD;} + .d2-3450658605 .color-B4{color:#E3E9FD;} + .d2-3450658605 .color-B5{color:#EDF0FD;} + .d2-3450658605 .color-B6{color:#F7F8FE;} + .d2-3450658605 .color-AA2{color:#4A6FF3;} + .d2-3450658605 .color-AA4{color:#EDF0FD;} + .d2-3450658605 .color-AA5{color:#F7F8FE;} + .d2-3450658605 .color-AB4{color:#EDF0FD;} + .d2-3450658605 .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-3450658605);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-3450658605);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-3450658605);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-3450658605);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-3450658605);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-3450658605);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-3450658605);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-3450658605);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>abcdabcababcdefabcde