@euphrasiologist/lwphylo 1.2.15 → 1.2.17
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 +12 -6
- package/dist/drawPhylogeny.cjs.map +1 -1
- package/dist/drawPhylogeny.esm.js +12 -6
- 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 +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1494,8 +1494,10 @@ function drawPhylogeny(
|
|
|
1494
1494
|
}
|
|
1495
1495
|
|
|
1496
1496
|
// maps for fast lookup on hover (childId → spoke / arc)
|
|
1497
|
-
const
|
|
1498
|
-
const
|
|
1497
|
+
const key = (x) => (typeof x === "string" ? +x : x);
|
|
1498
|
+
const spokeByChild = new Map(rad.radii.map(s => [key(s.childId ?? s.thisId ?? s.id1), s]));
|
|
1499
|
+
const arcByChild = new Map(rad.child_arcs.map(a => [key(a.childId), a]));
|
|
1500
|
+
|
|
1499
1501
|
|
|
1500
1502
|
// ===== LABELS =====
|
|
1501
1503
|
// Labels — make them follow the tip position used by the current mode
|
|
@@ -1601,13 +1603,17 @@ function drawPhylogeny(
|
|
|
1601
1603
|
// ----- half-arc at parent radius (parent.angle → child.angle) -----
|
|
1602
1604
|
const a = arcByChild.get(cur.thisId);
|
|
1603
1605
|
if (a) {
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1606
|
+
function pathFromArcRecord(rec) {
|
|
1607
|
+
const R = radiusPx(rec.radius);
|
|
1608
|
+
return rec.sweep == null
|
|
1609
|
+
? describeArc(centerX, centerY, R, rec.start, rec.end)
|
|
1610
|
+
: describeArcSweep(centerX, centerY, R, rec.start, rec.end, rec.sweep);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1607
1613
|
|
|
1608
1614
|
arcLayer
|
|
1609
1615
|
.append("path")
|
|
1610
|
-
.attr("d",
|
|
1616
|
+
.attr("d", pathFromArcRecord(a))
|
|
1611
1617
|
.attr("fill", "none")
|
|
1612
1618
|
.attr("stroke", stroke)
|
|
1613
1619
|
.attr("stroke-width", width);
|
|
@@ -1859,5 +1865,5 @@ function drawPhylogeny(
|
|
|
1859
1865
|
}
|
|
1860
1866
|
}
|
|
1861
1867
|
|
|
1862
|
-
export { describeArc, describeArcSweep, drawPhylogeny, parentFisheye, phisheye, radialLayout, readTree, rectangleLayout, subTree, unrooted };
|
|
1868
|
+
export { describeArc, describeArcSweep, drawPhylogeny, parentFisheye, phisheye, polarToCartesian, radialLayout, readTree, rectangleLayout, subTree, unrooted };
|
|
1863
1869
|
//# sourceMappingURL=index.js.map
|