@euphrasiologist/lwphylo 1.2.20 → 1.2.22
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 +20 -4
- package/dist/drawPhylogeny.cjs.map +1 -1
- package/dist/drawPhylogeny.esm.js +20 -4
- 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 +20 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -4
- 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;
|
|
@@ -526,8 +533,6 @@ function getChildArcsFan(pd) {
|
|
|
526
533
|
return child_arcs;
|
|
527
534
|
}
|
|
528
535
|
|
|
529
|
-
// src/radial/radialLayout.js
|
|
530
|
-
|
|
531
536
|
/**
|
|
532
537
|
* radialLayout(node, opts?)
|
|
533
538
|
* opts:
|
|
@@ -573,7 +578,7 @@ function radialLayout(node, opts = {}) {
|
|
|
573
578
|
|
|
574
579
|
// per-child arcs for half-arc highlighting if you already use them
|
|
575
580
|
let child_arcs = [];
|
|
576
|
-
if (
|
|
581
|
+
if (arcsStyle === "fan") {
|
|
577
582
|
child_arcs = getChildArcsFan(pd);
|
|
578
583
|
} else {
|
|
579
584
|
child_arcs = getChildArcs(pd);
|
|
@@ -1434,7 +1439,10 @@ function drawPhylogeny(
|
|
|
1434
1439
|
lineLayer.selectAll("*").remove();
|
|
1435
1440
|
arcLayer.selectAll("*").remove();
|
|
1436
1441
|
|
|
1437
|
-
let cur = typeof target === "number"
|
|
1442
|
+
let cur = (typeof target === "number" || typeof target === "string")
|
|
1443
|
+
? byId.get(target)
|
|
1444
|
+
: target;
|
|
1445
|
+
|
|
1438
1446
|
if (!cur) return;
|
|
1439
1447
|
|
|
1440
1448
|
let first = true;
|
|
@@ -1473,6 +1481,14 @@ function drawPhylogeny(
|
|
|
1473
1481
|
}
|
|
1474
1482
|
|
|
1475
1483
|
if (a) {
|
|
1484
|
+
console.log("Drawing arc:", {
|
|
1485
|
+
childId: cur.thisId,
|
|
1486
|
+
startDeg: (a.start * 180 / Math.PI).toFixed(2),
|
|
1487
|
+
endDeg: (a.end * 180 / Math.PI).toFixed(2),
|
|
1488
|
+
sweep: a.sweep,
|
|
1489
|
+
radius: a.radius
|
|
1490
|
+
});
|
|
1491
|
+
|
|
1476
1492
|
arcLayer
|
|
1477
1493
|
.append("path")
|
|
1478
1494
|
.attr("d", pathFromArcRecord(a))
|