@euphrasiologist/lwphylo 1.2.9 → 1.2.11
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 +39 -12
- package/dist/drawPhylogeny.cjs.map +1 -1
- package/dist/drawPhylogeny.esm.js +39 -12
- 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 +24 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1121,7 +1121,7 @@ function drawPhylogeny(
|
|
|
1121
1121
|
const byId = new Map(horizontal.map((d) => [d.thisId, d]));
|
|
1122
1122
|
const tipById = new Map(tips.map((d) => [d.thisId, d]));
|
|
1123
1123
|
const tipByLabel = new Map(tips.map((d) => [d.thisLabel, d]));
|
|
1124
|
-
const rootToTip = makeRootToTipGetter(byId, { prefer: "x1" });
|
|
1124
|
+
const rootToTip = makeRootToTipGetter(byId, { prefer: "x1" });
|
|
1125
1125
|
|
|
1126
1126
|
const maxY = d3__namespace.max(horizontal, (d) => d.y1);
|
|
1127
1127
|
const minY = d3__namespace.min(horizontal, (d) => d.y1);
|
|
@@ -1283,7 +1283,10 @@ function drawPhylogeny(
|
|
|
1283
1283
|
return svg.node();
|
|
1284
1284
|
} else if (layout === "radial") {
|
|
1285
1285
|
const parsedTree = readTree(treeText);
|
|
1286
|
-
const rad = radialLayout(parsedTree
|
|
1286
|
+
const rad = radialLayout(parsedTree, {
|
|
1287
|
+
angleStrategy: "fan",
|
|
1288
|
+
arcsStyle: "fan"
|
|
1289
|
+
});
|
|
1287
1290
|
|
|
1288
1291
|
// ===== MODE =====
|
|
1289
1292
|
const TIP_MODE = radialMode; // "phylo" (shorten to original tips) or "outer" (project to one circle)
|
|
@@ -1309,6 +1312,7 @@ function drawPhylogeny(
|
|
|
1309
1312
|
.scaleLinear()
|
|
1310
1313
|
.domain([-scaleRadial, scaleRadial])
|
|
1311
1314
|
.range([h, 0]);
|
|
1315
|
+
|
|
1312
1316
|
const radiusPx = (r) => r * (w / (2 * scaleRadial));
|
|
1313
1317
|
|
|
1314
1318
|
// ===== INDEXES / HELPERS =====
|
|
@@ -1493,7 +1497,7 @@ function drawPhylogeny(
|
|
|
1493
1497
|
|
|
1494
1498
|
// label hover
|
|
1495
1499
|
labels
|
|
1496
|
-
.on("mouseenter", function(
|
|
1500
|
+
.on("mouseenter", function(_event, d) {
|
|
1497
1501
|
drawRadialPath(d, hoverLines, hoverArcs, hoverStroke, hoverWidth);
|
|
1498
1502
|
d3__namespace.select(this).select("text").attr("font-weight", 600);
|
|
1499
1503
|
})
|
|
@@ -1550,15 +1554,23 @@ function drawPhylogeny(
|
|
|
1550
1554
|
if (a) {
|
|
1551
1555
|
arcLayer
|
|
1552
1556
|
.append("path")
|
|
1553
|
-
.attr(
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1557
|
+
.attr("d", (d) =>
|
|
1558
|
+
d.sweep == null
|
|
1559
|
+
? describeArc(
|
|
1560
|
+
centerX,
|
|
1561
|
+
centerY,
|
|
1562
|
+
radiusPx(d.radius),
|
|
1563
|
+
d.start,
|
|
1564
|
+
d.end
|
|
1565
|
+
)
|
|
1566
|
+
: describeArcSweep(
|
|
1567
|
+
centerX,
|
|
1568
|
+
centerY,
|
|
1569
|
+
radiusPx(d.radius),
|
|
1570
|
+
d.start,
|
|
1571
|
+
d.end,
|
|
1572
|
+
d.sweep
|
|
1573
|
+
)
|
|
1562
1574
|
)
|
|
1563
1575
|
.attr("fill", "none")
|
|
1564
1576
|
.attr("stroke", stroke)
|