@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/index.js CHANGED
@@ -158,6 +158,13 @@ const TAU$1 = Math.PI * 2;
158
158
  const norm$1 = (t) => ((t % TAU$1) + TAU$1) % TAU$1;
159
159
 
160
160
  function describeArcSweep(cx, cy, r, a0, a1, sweep /*0=CCW,1=CW*/) {
161
+ console.log("describeArcSweep input:", {
162
+ cx, cy, r,
163
+ a0Deg: (a0 * 180 / Math.PI).toFixed(2),
164
+ a1Deg: (a1 * 180 / Math.PI).toFixed(2),
165
+ sweep
166
+ });
167
+
161
168
  const delta = sweep === 0 ? norm$1(a1 - a0) : norm$1(a0 - a1);
162
169
  if (!(r > 0) || delta < 1e-9) return "";
163
170
  const largeArcFlag = delta > Math.PI ? 1 : 0;
@@ -639,8 +646,6 @@ function getChildArcsFan(pd) {
639
646
  return child_arcs;
640
647
  }
641
648
 
642
- // src/radial/radialLayout.js
643
-
644
649
  /**
645
650
  * radialLayout(node, opts?)
646
651
  * opts:
@@ -686,7 +691,7 @@ function radialLayout(node, opts = {}) {
686
691
 
687
692
  // per-child arcs for half-arc highlighting if you already use them
688
693
  let child_arcs = [];
689
- if (opts.arcsStyle === "fan") {
694
+ if (arcsStyle === "fan") {
690
695
  child_arcs = getChildArcsFan(pd);
691
696
  } else {
692
697
  child_arcs = getChildArcs(pd);
@@ -1601,7 +1606,10 @@ function drawPhylogeny(
1601
1606
  lineLayer.selectAll("*").remove();
1602
1607
  arcLayer.selectAll("*").remove();
1603
1608
 
1604
- let cur = typeof target === "number" ? byId.get(target) : target;
1609
+ let cur = (typeof target === "number" || typeof target === "string")
1610
+ ? byId.get(target)
1611
+ : target;
1612
+
1605
1613
  if (!cur) return;
1606
1614
 
1607
1615
  let first = true;
@@ -1640,6 +1648,14 @@ function drawPhylogeny(
1640
1648
  }
1641
1649
 
1642
1650
  if (a) {
1651
+ console.log("Drawing arc:", {
1652
+ childId: cur.thisId,
1653
+ startDeg: (a.start * 180 / Math.PI).toFixed(2),
1654
+ endDeg: (a.end * 180 / Math.PI).toFixed(2),
1655
+ sweep: a.sweep,
1656
+ radius: a.radius
1657
+ });
1658
+
1643
1659
  arcLayer
1644
1660
  .append("path")
1645
1661
  .attr("d", pathFromArcRecord(a))