@euphrasiologist/lwphylo 1.2.21 → 1.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drawPhylogeny.cjs +19 -8
- package/dist/drawPhylogeny.cjs.map +1 -1
- package/dist/drawPhylogeny.esm.js +19 -8
- package/dist/drawPhylogeny.esm.js.map +1 -1
- package/dist/drawPhylogeny.umd.js +1 -1
- package/dist/drawPhylogeny.umd.js.map +1 -1
- package/dist/index.cjs +19 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,13 @@ const TAU$1 = Math.PI * 2;
|
|
|
45
45
|
const norm$1 = (t) => ((t % TAU$1) + TAU$1) % TAU$1;
|
|
46
46
|
|
|
47
47
|
function describeArcSweep(cx, cy, r, a0, a1, sweep /*0=CCW,1=CW*/) {
|
|
48
|
+
console.log("describeArcSweep input:", {
|
|
49
|
+
cx, cy, r,
|
|
50
|
+
a0Deg: (a0 * 180 / Math.PI).toFixed(2),
|
|
51
|
+
a1Deg: (a1 * 180 / Math.PI).toFixed(2),
|
|
52
|
+
sweep
|
|
53
|
+
});
|
|
54
|
+
|
|
48
55
|
const delta = sweep === 0 ? norm$1(a1 - a0) : norm$1(a0 - a1);
|
|
49
56
|
if (!(r > 0) || delta < 1e-9) return "";
|
|
50
57
|
const largeArcFlag = delta > Math.PI ? 1 : 0;
|
|
@@ -452,9 +459,6 @@ function getChildArcsFan(pd) {
|
|
|
452
459
|
const TAU = Math.PI * 2;
|
|
453
460
|
const norm = (t) => ((t % TAU) + TAU) % TAU;
|
|
454
461
|
|
|
455
|
-
const ccwDelta = (a0, a1) => (a1 - a0 + TAU) % TAU;
|
|
456
|
-
const cwDelta = (a0, a1) => (a0 - a1 + TAU) % TAU;
|
|
457
|
-
|
|
458
462
|
// Circular midpoint that travels CCW from a -> b by half the CCW span
|
|
459
463
|
function midCCW(a, b) {
|
|
460
464
|
const d = (b - a + TAU) % TAU; // CCW delta in [0, 2π)
|
|
@@ -503,14 +507,12 @@ function getChildArcsFan(pd) {
|
|
|
503
507
|
const cur = A[i];
|
|
504
508
|
const next = A[(i + 1) % N];
|
|
505
509
|
|
|
506
|
-
// “fan” wedge around the child: midpoint(prev→cur) .. midpoint(cur→next), CCW
|
|
507
510
|
const start = midCCW(prev.a, cur.a);
|
|
508
511
|
const end = midCCW(cur.a, next.a);
|
|
509
512
|
|
|
510
|
-
//
|
|
511
|
-
const
|
|
512
|
-
const
|
|
513
|
-
const sweep = ccw <= cw ? 0 : 1;
|
|
513
|
+
// Use SVG-conforming sweep logic
|
|
514
|
+
const delta = (end - start + TAU) % TAU;
|
|
515
|
+
const sweep = delta > Math.PI ? 0 : 1;
|
|
514
516
|
|
|
515
517
|
child_arcs.push({
|
|
516
518
|
parentId: pid,
|
|
@@ -521,6 +523,7 @@ function getChildArcsFan(pd) {
|
|
|
521
523
|
sweep
|
|
522
524
|
});
|
|
523
525
|
}
|
|
526
|
+
|
|
524
527
|
}
|
|
525
528
|
|
|
526
529
|
return child_arcs;
|
|
@@ -1474,6 +1477,14 @@ function drawPhylogeny(
|
|
|
1474
1477
|
}
|
|
1475
1478
|
|
|
1476
1479
|
if (a) {
|
|
1480
|
+
console.log("Drawing arc:", {
|
|
1481
|
+
childId: cur.thisId,
|
|
1482
|
+
startDeg: (a.start * 180 / Math.PI).toFixed(2),
|
|
1483
|
+
endDeg: (a.end * 180 / Math.PI).toFixed(2),
|
|
1484
|
+
sweep: a.sweep,
|
|
1485
|
+
radius: a.radius
|
|
1486
|
+
});
|
|
1487
|
+
|
|
1477
1488
|
arcLayer
|
|
1478
1489
|
.append("path")
|
|
1479
1490
|
.attr("d", pathFromArcRecord(a))
|