From 17cca5ee89068c60f7721626b90554cd50c154d4 Mon Sep 17 00:00:00 2001 From: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com> Date: Sat, 22 Feb 2025 13:39:54 +0000 Subject: [PATCH] try --- d2layouts/d2cycle/layout.go | 2 +- .../txtar/cycle-diagram/dagre/board.exp.json | 12 +- .../txtar/cycle-diagram/dagre/sketch.exp.svg | 152 +++++++++--------- .../txtar/cycle-diagram/elk/board.exp.json | 12 +- .../txtar/cycle-diagram/elk/sketch.exp.svg | 152 +++++++++--------- 5 files changed, 165 insertions(+), 165 deletions(-) diff --git a/d2layouts/d2cycle/layout.go b/d2layouts/d2cycle/layout.go index f80fecb64..a085eb7db 100644 --- a/d2layouts/d2cycle/layout.go +++ b/d2layouts/d2cycle/layout.go @@ -112,7 +112,7 @@ path = trimPathPoints(path, edge.Dst.Box) if len(path) >= 2 { dstPoint := path[len(path)-1] // Calculate the tangent direction at the destination point (counter-clockwise) - tangentX := -dstPoint.Y + tangentX := dstPoint.Y tangentY := dstPoint.X // Normalize the tangent vector length := math.Hypot(tangentX, tangentY) diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json index f260b0886..789be8290 100644 --- a/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json @@ -864,7 +864,7 @@ "y": -37.47600173950195 }, { - "x": 195.6020050048828, + "x": 198.90199279785156, "y": -42.86199951171875 }, { @@ -1228,7 +1228,7 @@ "y": 197.53700256347656 }, { - "x": 36.4109992980957, + "x": 16.58799934387207, "y": 196.90499877929688 }, { @@ -1592,7 +1592,7 @@ "y": 37.47600173950195 }, { - "x": -195.6020050048828, + "x": -198.90199279785156, "y": 42.86199951171875 }, { @@ -1972,7 +1972,7 @@ "y": 111.8030014038086 }, { - "x": 704.7830200195312, + "x": 698.0830078125, "y": 107.5770034790039 }, { @@ -2336,7 +2336,7 @@ "y": 186.90899658203125 }, { - "x": 370.2919921875, + "x": 356.99200439453125, "y": 190.46800231933594 }, { @@ -2740,7 +2740,7 @@ "y": 196.45700073242188 }, { - "x": 1008.4110107421875, + "x": 988.5880126953125, "y": 196.89300537109375 }, { diff --git a/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/dagre/sketch.exp.svg index 037adcdac..5569c4f34 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-3418838250 .fill-N1{fill:#0A0F25;} + .d2-3418838250 .fill-N2{fill:#676C7E;} + .d2-3418838250 .fill-N3{fill:#9499AB;} + .d2-3418838250 .fill-N4{fill:#CFD2DD;} + .d2-3418838250 .fill-N5{fill:#DEE1EB;} + .d2-3418838250 .fill-N6{fill:#EEF1F8;} + .d2-3418838250 .fill-N7{fill:#FFFFFF;} + .d2-3418838250 .fill-B1{fill:#0D32B2;} + .d2-3418838250 .fill-B2{fill:#0D32B2;} + .d2-3418838250 .fill-B3{fill:#E3E9FD;} + .d2-3418838250 .fill-B4{fill:#E3E9FD;} + .d2-3418838250 .fill-B5{fill:#EDF0FD;} + .d2-3418838250 .fill-B6{fill:#F7F8FE;} + .d2-3418838250 .fill-AA2{fill:#4A6FF3;} + .d2-3418838250 .fill-AA4{fill:#EDF0FD;} + .d2-3418838250 .fill-AA5{fill:#F7F8FE;} + .d2-3418838250 .fill-AB4{fill:#EDF0FD;} + .d2-3418838250 .fill-AB5{fill:#F7F8FE;} + .d2-3418838250 .stroke-N1{stroke:#0A0F25;} + .d2-3418838250 .stroke-N2{stroke:#676C7E;} + .d2-3418838250 .stroke-N3{stroke:#9499AB;} + .d2-3418838250 .stroke-N4{stroke:#CFD2DD;} + .d2-3418838250 .stroke-N5{stroke:#DEE1EB;} + .d2-3418838250 .stroke-N6{stroke:#EEF1F8;} + .d2-3418838250 .stroke-N7{stroke:#FFFFFF;} + .d2-3418838250 .stroke-B1{stroke:#0D32B2;} + .d2-3418838250 .stroke-B2{stroke:#0D32B2;} + .d2-3418838250 .stroke-B3{stroke:#E3E9FD;} + .d2-3418838250 .stroke-B4{stroke:#E3E9FD;} + .d2-3418838250 .stroke-B5{stroke:#EDF0FD;} + .d2-3418838250 .stroke-B6{stroke:#F7F8FE;} + .d2-3418838250 .stroke-AA2{stroke:#4A6FF3;} + .d2-3418838250 .stroke-AA4{stroke:#EDF0FD;} + .d2-3418838250 .stroke-AA5{stroke:#F7F8FE;} + .d2-3418838250 .stroke-AB4{stroke:#EDF0FD;} + .d2-3418838250 .stroke-AB5{stroke:#F7F8FE;} + .d2-3418838250 .background-color-N1{background-color:#0A0F25;} + .d2-3418838250 .background-color-N2{background-color:#676C7E;} + .d2-3418838250 .background-color-N3{background-color:#9499AB;} + .d2-3418838250 .background-color-N4{background-color:#CFD2DD;} + .d2-3418838250 .background-color-N5{background-color:#DEE1EB;} + .d2-3418838250 .background-color-N6{background-color:#EEF1F8;} + .d2-3418838250 .background-color-N7{background-color:#FFFFFF;} + .d2-3418838250 .background-color-B1{background-color:#0D32B2;} + .d2-3418838250 .background-color-B2{background-color:#0D32B2;} + .d2-3418838250 .background-color-B3{background-color:#E3E9FD;} + .d2-3418838250 .background-color-B4{background-color:#E3E9FD;} + .d2-3418838250 .background-color-B5{background-color:#EDF0FD;} + .d2-3418838250 .background-color-B6{background-color:#F7F8FE;} + .d2-3418838250 .background-color-AA2{background-color:#4A6FF3;} + .d2-3418838250 .background-color-AA4{background-color:#EDF0FD;} + .d2-3418838250 .background-color-AA5{background-color:#F7F8FE;} + .d2-3418838250 .background-color-AB4{background-color:#EDF0FD;} + .d2-3418838250 .background-color-AB5{background-color:#F7F8FE;} + .d2-3418838250 .color-N1{color:#0A0F25;} + .d2-3418838250 .color-N2{color:#676C7E;} + .d2-3418838250 .color-N3{color:#9499AB;} + .d2-3418838250 .color-N4{color:#CFD2DD;} + .d2-3418838250 .color-N5{color:#DEE1EB;} + .d2-3418838250 .color-N6{color:#EEF1F8;} + .d2-3418838250 .color-N7{color:#FFFFFF;} + .d2-3418838250 .color-B1{color:#0D32B2;} + .d2-3418838250 .color-B2{color:#0D32B2;} + .d2-3418838250 .color-B3{color:#E3E9FD;} + .d2-3418838250 .color-B4{color:#E3E9FD;} + .d2-3418838250 .color-B5{color:#EDF0FD;} + .d2-3418838250 .color-B6{color:#F7F8FE;} + .d2-3418838250 .color-AA2{color:#4A6FF3;} + .d2-3418838250 .color-AA4{color:#EDF0FD;} + .d2-3418838250 .color-AA5{color:#F7F8FE;} + .d2-3418838250 .color-AB4{color:#EDF0FD;} + .d2-3418838250 .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-3418838250);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-3418838250);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-3418838250);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-3418838250);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-3418838250);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-3418838250);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-3418838250);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-3418838250);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-3418838250);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 94712ff99..3e6b5ac27 100644 --- a/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json +++ b/e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json @@ -864,7 +864,7 @@ "y": -25.47599983215332 }, { - "x": 207.6020050048828, + "x": 210.90199279785156, "y": -30.86199951171875 }, { @@ -1228,7 +1228,7 @@ "y": 209.53700256347656 }, { - "x": 48.4109992980957, + "x": 28.58799934387207, "y": 208.90499877929688 }, { @@ -1592,7 +1592,7 @@ "y": 49.47600173950195 }, { - "x": -183.6020050048828, + "x": -186.90199279785156, "y": 54.86199951171875 }, { @@ -1972,7 +1972,7 @@ "y": 123.8030014038086 }, { - "x": 677.2830200195312, + "x": 670.5830078125, "y": 119.5770034790039 }, { @@ -2336,7 +2336,7 @@ "y": 198.90899658203125 }, { - "x": 342.7919921875, + "x": 329.49200439453125, "y": 202.46800231933594 }, { @@ -2740,7 +2740,7 @@ "y": 208.45700073242188 }, { - "x": 941.3209838867188, + "x": 921.4979858398438, "y": 208.89300537109375 }, { diff --git a/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg b/e2etests/testdata/txtar/cycle-diagram/elk/sketch.exp.svg index c894e3d67..705b7e769 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-4040176331 .fill-N1{fill:#0A0F25;} + .d2-4040176331 .fill-N2{fill:#676C7E;} + .d2-4040176331 .fill-N3{fill:#9499AB;} + .d2-4040176331 .fill-N4{fill:#CFD2DD;} + .d2-4040176331 .fill-N5{fill:#DEE1EB;} + .d2-4040176331 .fill-N6{fill:#EEF1F8;} + .d2-4040176331 .fill-N7{fill:#FFFFFF;} + .d2-4040176331 .fill-B1{fill:#0D32B2;} + .d2-4040176331 .fill-B2{fill:#0D32B2;} + .d2-4040176331 .fill-B3{fill:#E3E9FD;} + .d2-4040176331 .fill-B4{fill:#E3E9FD;} + .d2-4040176331 .fill-B5{fill:#EDF0FD;} + .d2-4040176331 .fill-B6{fill:#F7F8FE;} + .d2-4040176331 .fill-AA2{fill:#4A6FF3;} + .d2-4040176331 .fill-AA4{fill:#EDF0FD;} + .d2-4040176331 .fill-AA5{fill:#F7F8FE;} + .d2-4040176331 .fill-AB4{fill:#EDF0FD;} + .d2-4040176331 .fill-AB5{fill:#F7F8FE;} + .d2-4040176331 .stroke-N1{stroke:#0A0F25;} + .d2-4040176331 .stroke-N2{stroke:#676C7E;} + .d2-4040176331 .stroke-N3{stroke:#9499AB;} + .d2-4040176331 .stroke-N4{stroke:#CFD2DD;} + .d2-4040176331 .stroke-N5{stroke:#DEE1EB;} + .d2-4040176331 .stroke-N6{stroke:#EEF1F8;} + .d2-4040176331 .stroke-N7{stroke:#FFFFFF;} + .d2-4040176331 .stroke-B1{stroke:#0D32B2;} + .d2-4040176331 .stroke-B2{stroke:#0D32B2;} + .d2-4040176331 .stroke-B3{stroke:#E3E9FD;} + .d2-4040176331 .stroke-B4{stroke:#E3E9FD;} + .d2-4040176331 .stroke-B5{stroke:#EDF0FD;} + .d2-4040176331 .stroke-B6{stroke:#F7F8FE;} + .d2-4040176331 .stroke-AA2{stroke:#4A6FF3;} + .d2-4040176331 .stroke-AA4{stroke:#EDF0FD;} + .d2-4040176331 .stroke-AA5{stroke:#F7F8FE;} + .d2-4040176331 .stroke-AB4{stroke:#EDF0FD;} + .d2-4040176331 .stroke-AB5{stroke:#F7F8FE;} + .d2-4040176331 .background-color-N1{background-color:#0A0F25;} + .d2-4040176331 .background-color-N2{background-color:#676C7E;} + .d2-4040176331 .background-color-N3{background-color:#9499AB;} + .d2-4040176331 .background-color-N4{background-color:#CFD2DD;} + .d2-4040176331 .background-color-N5{background-color:#DEE1EB;} + .d2-4040176331 .background-color-N6{background-color:#EEF1F8;} + .d2-4040176331 .background-color-N7{background-color:#FFFFFF;} + .d2-4040176331 .background-color-B1{background-color:#0D32B2;} + .d2-4040176331 .background-color-B2{background-color:#0D32B2;} + .d2-4040176331 .background-color-B3{background-color:#E3E9FD;} + .d2-4040176331 .background-color-B4{background-color:#E3E9FD;} + .d2-4040176331 .background-color-B5{background-color:#EDF0FD;} + .d2-4040176331 .background-color-B6{background-color:#F7F8FE;} + .d2-4040176331 .background-color-AA2{background-color:#4A6FF3;} + .d2-4040176331 .background-color-AA4{background-color:#EDF0FD;} + .d2-4040176331 .background-color-AA5{background-color:#F7F8FE;} + .d2-4040176331 .background-color-AB4{background-color:#EDF0FD;} + .d2-4040176331 .background-color-AB5{background-color:#F7F8FE;} + .d2-4040176331 .color-N1{color:#0A0F25;} + .d2-4040176331 .color-N2{color:#676C7E;} + .d2-4040176331 .color-N3{color:#9499AB;} + .d2-4040176331 .color-N4{color:#CFD2DD;} + .d2-4040176331 .color-N5{color:#DEE1EB;} + .d2-4040176331 .color-N6{color:#EEF1F8;} + .d2-4040176331 .color-N7{color:#FFFFFF;} + .d2-4040176331 .color-B1{color:#0D32B2;} + .d2-4040176331 .color-B2{color:#0D32B2;} + .d2-4040176331 .color-B3{color:#E3E9FD;} + .d2-4040176331 .color-B4{color:#E3E9FD;} + .d2-4040176331 .color-B5{color:#EDF0FD;} + .d2-4040176331 .color-B6{color:#F7F8FE;} + .d2-4040176331 .color-AA2{color:#4A6FF3;} + .d2-4040176331 .color-AA4{color:#EDF0FD;} + .d2-4040176331 .color-AA5{color:#F7F8FE;} + .d2-4040176331 .color-AB4{color:#EDF0FD;} + .d2-4040176331 .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-4040176331);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-4040176331);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-4040176331);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-4040176331);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-4040176331);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-4040176331);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-4040176331);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-4040176331);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>abcdabcab