@euphrasiologist/lwphylo 1.2.10 → 1.2.12

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
@@ -1291,6 +1291,7 @@ function drawPhylogeny(
1291
1291
  .scaleLinear()
1292
1292
  .domain([-scaleRadial, scaleRadial])
1293
1293
  .range([h, 0]);
1294
+
1294
1295
  const radiusPx = (r) => r * (w / (2 * scaleRadial));
1295
1296
 
1296
1297
  // ===== INDEXES / HELPERS =====
@@ -1344,14 +1345,24 @@ function drawPhylogeny(
1344
1345
  .data(rad.arcs)
1345
1346
  .join("path")
1346
1347
  .attr("d", (d) =>
1347
- describeArc(
1348
- centerX,
1349
- centerY,
1350
- Math.max(0, radiusPx(d.radius)),
1351
- d.start,
1352
- d.end
1353
- )
1348
+ d.sweep == null
1349
+ ? describeArc(
1350
+ centerX,
1351
+ centerY,
1352
+ radiusPx(d.radius),
1353
+ d.start,
1354
+ d.end
1355
+ )
1356
+ : describeArcSweep(
1357
+ centerX,
1358
+ centerY,
1359
+ radiusPx(d.radius),
1360
+ d.start,
1361
+ d.end,
1362
+ d.sweep
1363
+ )
1354
1364
  )
1365
+
1355
1366
  .attr("fill", "none")
1356
1367
  .attr("stroke", "#777")
1357
1368
  .attr("stroke-width", strokeWidth);
@@ -1475,7 +1486,7 @@ function drawPhylogeny(
1475
1486
 
1476
1487
  // label hover
1477
1488
  labels
1478
- .on("mouseenter", function(event, d) {
1489
+ .on("mouseenter", function(_event, d) {
1479
1490
  drawRadialPath(d, hoverLines, hoverArcs, hoverStroke, hoverWidth);
1480
1491
  d3.select(this).select("text").attr("font-weight", 600);
1481
1492
  })
@@ -1532,15 +1543,23 @@ function drawPhylogeny(
1532
1543
  if (a) {
1533
1544
  arcLayer
1534
1545
  .append("path")
1535
- .attr(
1536
- "d",
1537
- describeArc(
1538
- centerX,
1539
- centerY,
1540
- Math.max(0, radiusPx(a.radius)),
1541
- a.start,
1542
- a.end
1543
- )
1546
+ .attr("d", (d) =>
1547
+ d.sweep == null
1548
+ ? describeArc(
1549
+ centerX,
1550
+ centerY,
1551
+ radiusPx(d.radius),
1552
+ d.start,
1553
+ d.end
1554
+ )
1555
+ : describeArcSweep(
1556
+ centerX,
1557
+ centerY,
1558
+ radiusPx(d.radius),
1559
+ d.start,
1560
+ d.end,
1561
+ d.sweep
1562
+ )
1544
1563
  )
1545
1564
  .attr("fill", "none")
1546
1565
  .attr("stroke", stroke)