try
This commit is contained in:
parent
59f4a1bb90
commit
53423dbabc
5 changed files with 153 additions and 201 deletions
|
|
@ -90,7 +90,7 @@ func createCircularArc(edge *d2graph.Edge, radius float64) {
|
||||||
dstAngle := math.Atan2(newDst.Y, newDst.X)
|
dstAngle := math.Atan2(newDst.Y, newDst.X)
|
||||||
tangent := geo.NewPoint(-math.Sin(dstAngle), math.Cos(dstAngle))
|
tangent := geo.NewPoint(-math.Sin(dstAngle), math.Cos(dstAngle))
|
||||||
ε := 0.01 * radius // Small offset, e.g., 1% of radius
|
ε := 0.01 * radius // Small offset, e.g., 1% of radius
|
||||||
preDst := geo.NewPoint(newDst.X-ε*tangent.X, newDst.Y-ε*tangent.Y)
|
preDst := geo.NewPoint(newDst.X+ε*tangent.X, newDst.Y+ε*tangent.Y)
|
||||||
// Insert preDst before newDst
|
// Insert preDst before newDst
|
||||||
path = append(path[:len(path)-1], preDst, newDst)
|
path = append(path[:len(path)-1], preDst, newDst)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json
generated
vendored
24
e2etests/testdata/txtar/cycle-diagram/dagre/board.exp.json
generated
vendored
|
|
@ -867,10 +867,6 @@
|
||||||
"x": 197.02099609375,
|
"x": 197.02099609375,
|
||||||
"y": -34.3849983215332
|
"y": -34.3849983215332
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 196.9219970703125,
|
|
||||||
"y": -34.97200012207031
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 197.2519989013672,
|
"x": 197.2519989013672,
|
||||||
"y": -33
|
"y": -33
|
||||||
|
|
@ -1235,10 +1231,6 @@
|
||||||
"x": 28.18000030517578,
|
"x": 28.18000030517578,
|
||||||
"y": 198.00399780273438
|
"y": 198.00399780273438
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 28.48200035095215,
|
|
||||||
"y": 197.96499633789062
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 26.5,
|
"x": 26.5,
|
||||||
"y": 198.22999572753906
|
"y": 198.22999572753906
|
||||||
|
|
@ -1603,10 +1595,6 @@
|
||||||
"x": -197.02099609375,
|
"x": -197.02099609375,
|
||||||
"y": 34.3849983215332
|
"y": 34.3849983215332
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": -196.9219970703125,
|
|
||||||
"y": 34.97200012207031
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": -197.2519989013672,
|
"x": -197.2519989013672,
|
||||||
"y": 33
|
"y": 33
|
||||||
|
|
@ -1987,10 +1975,6 @@
|
||||||
"x": 701.875,
|
"x": 701.875,
|
||||||
"y": 115.77300262451172
|
"y": 115.77300262451172
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 702.10302734375,
|
|
||||||
"y": 115.11499786376953
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 701.4329833984375,
|
"x": 701.4329833984375,
|
||||||
"y": 116.9990005493164
|
"y": 116.9990005493164
|
||||||
|
|
@ -2355,10 +2339,6 @@
|
||||||
"x": 364.3710021972656,
|
"x": 364.3710021972656,
|
||||||
"y": 183.8260040283203
|
"y": 183.8260040283203
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 364.97198486328125,
|
|
||||||
"y": 184.4929962158203
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 363.6419982910156,
|
"x": 363.6419982910156,
|
||||||
"y": 183
|
"y": 183
|
||||||
|
|
@ -2763,10 +2743,6 @@
|
||||||
"x": 1003.2860107421875,
|
"x": 1003.2860107421875,
|
||||||
"y": 197.53700256347656
|
"y": 197.53700256347656
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 1000.4819946289062,
|
|
||||||
"y": 197.9530029296875
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 998.5,
|
"x": 998.5,
|
||||||
"y": 198.21800231933594
|
"y": 198.21800231933594
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
24
e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json
generated
vendored
24
e2etests/testdata/txtar/cycle-diagram/elk/board.exp.json
generated
vendored
|
|
@ -867,10 +867,6 @@
|
||||||
"x": 209.02099609375,
|
"x": 209.02099609375,
|
||||||
"y": -22.385000228881836
|
"y": -22.385000228881836
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 208.9219970703125,
|
|
||||||
"y": -22.972000122070312
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 209.2519989013672,
|
"x": 209.2519989013672,
|
||||||
"y": -21
|
"y": -21
|
||||||
|
|
@ -1235,10 +1231,6 @@
|
||||||
"x": 40.18000030517578,
|
"x": 40.18000030517578,
|
||||||
"y": 210.00399780273438
|
"y": 210.00399780273438
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 40.481998443603516,
|
|
||||||
"y": 209.96499633789062
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 38.5,
|
"x": 38.5,
|
||||||
"y": 210.22999572753906
|
"y": 210.22999572753906
|
||||||
|
|
@ -1603,10 +1595,6 @@
|
||||||
"x": -185.02099609375,
|
"x": -185.02099609375,
|
||||||
"y": 46.3849983215332
|
"y": 46.3849983215332
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": -184.9219970703125,
|
|
||||||
"y": 46.97200012207031
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": -185.2519989013672,
|
"x": -185.2519989013672,
|
||||||
"y": 45
|
"y": 45
|
||||||
|
|
@ -1987,10 +1975,6 @@
|
||||||
"x": 674.375,
|
"x": 674.375,
|
||||||
"y": 127.77300262451172
|
"y": 127.77300262451172
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 674.60302734375,
|
|
||||||
"y": 127.11499786376953
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 673.9329833984375,
|
"x": 673.9329833984375,
|
||||||
"y": 128.99899291992188
|
"y": 128.99899291992188
|
||||||
|
|
@ -2355,10 +2339,6 @@
|
||||||
"x": 336.8710021972656,
|
"x": 336.8710021972656,
|
||||||
"y": 195.8260040283203
|
"y": 195.8260040283203
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 337.47198486328125,
|
|
||||||
"y": 196.4929962158203
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 336.1419982910156,
|
"x": 336.1419982910156,
|
||||||
"y": 195
|
"y": 195
|
||||||
|
|
@ -2763,10 +2743,6 @@
|
||||||
"x": 936.197021484375,
|
"x": 936.197021484375,
|
||||||
"y": 209.53700256347656
|
"y": 209.53700256347656
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"x": 933.3920288085938,
|
|
||||||
"y": 209.9530029296875
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"x": 931.4099731445312,
|
"x": 931.4099731445312,
|
||||||
"y": 210.21800231933594
|
"y": 210.21800231933594
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Loading…
Reference in a new issue