@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.cjs
CHANGED
|
@@ -1515,8 +1515,10 @@ function drawPhylogeny(
|
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
1517
|
// maps for fast lookup on hover (childId → spoke / arc)
|
|
1518
|
-
const
|
|
1519
|
-
const
|
|
1518
|
+
const key = (x) => (typeof x === "string" ? +x : x);
|
|
1519
|
+
const spokeByChild = new Map(rad.radii.map(s => [key(s.childId ?? s.thisId ?? s.id1), s]));
|
|
1520
|
+
const arcByChild = new Map(rad.child_arcs.map(a => [key(a.childId), a]));
|
|
1521
|
+
|
|
1520
1522
|
|
|
1521
1523
|
// ===== LABELS =====
|
|
1522
1524
|
// Labels — make them follow the tip position used by the current mode
|
|
@@ -1622,13 +1624,17 @@ function drawPhylogeny(
|
|
|
1622
1624
|
// ----- half-arc at parent radius (parent.angle → child.angle) -----
|
|
1623
1625
|
const a = arcByChild.get(cur.thisId);
|
|
1624
1626
|
if (a) {
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1627
|
+
function pathFromArcRecord(rec) {
|
|
1628
|
+
const R = radiusPx(rec.radius);
|
|
1629
|
+
return rec.sweep == null
|
|
1630
|
+
? describeArc(centerX, centerY, R, rec.start, rec.end)
|
|
1631
|
+
: describeArcSweep(centerX, centerY, R, rec.start, rec.end, rec.sweep);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1628
1634
|
|
|
1629
1635
|
arcLayer
|
|
1630
1636
|
.append("path")
|
|
1631
|
-
.attr("d",
|
|
1637
|
+
.attr("d", pathFromArcRecord(a))
|
|
1632
1638
|
.attr("fill", "none")
|
|
1633
1639
|
.attr("stroke", stroke)
|
|
1634
1640
|
.attr("stroke-width", width);
|
|
@@ -1885,6 +1891,7 @@ exports.describeArcSweep = describeArcSweep;
|
|
|
1885
1891
|
exports.drawPhylogeny = drawPhylogeny;
|
|
1886
1892
|
exports.parentFisheye = parentFisheye;
|
|
1887
1893
|
exports.phisheye = phisheye;
|
|
1894
|
+
exports.polarToCartesian = polarToCartesian;
|
|
1888
1895
|
exports.radialLayout = radialLayout;
|
|
1889
1896
|
exports.readTree = readTree;
|
|
1890
1897
|
exports.rectangleLayout = rectangleLayout;
|