@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/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 spokeByChild = new Map(rad.radii.map((s) => [childIdOf(s), s]));
1498
- const arcByChild = new Map((rad.child_arcs ?? []).map((a) => [a.childId, a]));
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
- const pathD = (a.sweep == null)
1605
- ? describeArc(centerX, centerY, radiusPx(a.radius), a.start, a.end)
1606
- : describeArcSweep(centerX, centerY, radiusPx(a.radius), a.start, a.end, a.sweep);
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", pathD)
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