@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.cjs CHANGED
@@ -1312,6 +1312,7 @@ function drawPhylogeny(
1312
1312
  .scaleLinear()
1313
1313
  .domain([-scaleRadial, scaleRadial])
1314
1314
  .range([h, 0]);
1315
+
1315
1316
  const radiusPx = (r) => r * (w / (2 * scaleRadial));
1316
1317
 
1317
1318
  // ===== INDEXES / HELPERS =====
@@ -1365,14 +1366,24 @@ function drawPhylogeny(
1365
1366
  .data(rad.arcs)
1366
1367
  .join("path")
1367
1368
  .attr("d", (d) =>
1368
- describeArc(
1369
- centerX,
1370
- centerY,
1371
- Math.max(0, radiusPx(d.radius)),
1372
- d.start,
1373
- d.end
1374
- )
1369
+ d.sweep == null
1370
+ ? describeArc(
1371
+ centerX,
1372
+ centerY,
1373
+ radiusPx(d.radius),
1374
+ d.start,
1375
+ d.end
1376
+ )
1377
+ : describeArcSweep(
1378
+ centerX,
1379
+ centerY,
1380
+ radiusPx(d.radius),
1381
+ d.start,
1382
+ d.end,
1383
+ d.sweep
1384
+ )
1375
1385
  )
1386
+
1376
1387
  .attr("fill", "none")
1377
1388
  .attr("stroke", "#777")
1378
1389
  .attr("stroke-width", strokeWidth);
@@ -1496,7 +1507,7 @@ function drawPhylogeny(
1496
1507
 
1497
1508
  // label hover
1498
1509
  labels
1499
- .on("mouseenter", function(event, d) {
1510
+ .on("mouseenter", function(_event, d) {
1500
1511
  drawRadialPath(d, hoverLines, hoverArcs, hoverStroke, hoverWidth);
1501
1512
  d3__namespace.select(this).select("text").attr("font-weight", 600);
1502
1513
  })
@@ -1553,15 +1564,23 @@ function drawPhylogeny(
1553
1564
  if (a) {
1554
1565
  arcLayer
1555
1566
  .append("path")
1556
- .attr(
1557
- "d",
1558
- describeArc(
1559
- centerX,
1560
- centerY,
1561
- Math.max(0, radiusPx(a.radius)),
1562
- a.start,
1563
- a.end
1564
- )
1567
+ .attr("d", (d) =>
1568
+ d.sweep == null
1569
+ ? describeArc(
1570
+ centerX,
1571
+ centerY,
1572
+ radiusPx(d.radius),
1573
+ d.start,
1574
+ d.end
1575
+ )
1576
+ : describeArcSweep(
1577
+ centerX,
1578
+ centerY,
1579
+ radiusPx(d.radius),
1580
+ d.start,
1581
+ d.end,
1582
+ d.sweep
1583
+ )
1565
1584
  )
1566
1585
  .attr("fill", "none")
1567
1586
  .attr("stroke", stroke)