phylotree 2.6.0 → 2.7.0
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/README.md +49 -5
- package/bin/phylotree-neighbor-join.js +4 -5
- package/bin/root-to-tip.js +1 -1
- package/bin/tip-date-extractor.js +26 -18
- package/dist/phylotree-menus.css +93 -0
- package/dist/phylotree.d.ts +509 -241
- package/dist/phylotree.js +5023 -1515
- package/dist/phylotree.min.js +1 -1
- package/package.json +25 -27
- package/src/branches.js +58 -34
- package/src/clustering/cluster-picker.js +18 -2
- package/src/clustering/phylopart.js +14 -6
- package/src/export.js +1 -1
- package/src/extract-dates.js +3 -3
- package/src/formats/beast.js +5 -1
- package/src/formats/newick.js +43 -7
- package/src/formats/nexml.js +87 -30
- package/src/formats/nexus.js +112 -32
- package/src/formats/phyloxml.js +74 -15
- package/src/formats/registry.js +5 -1
- package/src/index.js +1 -0
- package/src/main.js +76 -25
- package/src/metrics/center-of-tree.js +4 -2
- package/src/metrics/compute-midpoint.js +7 -1
- package/src/metrics/pairwise-distances.js +4 -2
- package/src/metrics/root-to-tip.js +43 -10
- package/src/metrics/sackins.js +7 -1
- package/src/msa-parsers/fasta.js +9 -12
- package/src/neighbor-join.js +107 -75
- package/src/nodes.js +43 -31
- package/src/render/clades.js +16 -4
- package/src/render/draw.js +128 -86
- package/src/render/edges.js +17 -8
- package/src/render/events.js +2 -3
- package/src/render/menus.js +110 -10
- package/src/render/nodes.js +42 -16
- package/src/render/options.js +3 -1
- package/src/render/selection-sets.js +30 -14
- package/src/render/unrooted.js +90 -12
- package/src/rooting.js +12 -3
- package/src/traversal.js +4 -3
package/src/traversal.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _ from "lodash";
|
|
2
1
|
|
|
3
2
|
export function postOrder(node, callback, backtrack) {
|
|
4
3
|
|
|
@@ -82,7 +81,9 @@ export function leftChildRightSibling(root) {
|
|
|
82
81
|
n.children[0].data.multiway_parent = n;
|
|
83
82
|
|
|
84
83
|
// right child is the sibling
|
|
85
|
-
n.children[1]
|
|
84
|
+
if (n.children[1]) {
|
|
85
|
+
n.children[1].data.multiway_parent = n.parent;
|
|
86
|
+
}
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
}
|
|
@@ -91,7 +92,7 @@ export function leftChildRightSibling(root) {
|
|
|
91
92
|
postOrder(root, declareTrueParent);
|
|
92
93
|
|
|
93
94
|
// return edge list
|
|
94
|
-
let edge_list =
|
|
95
|
+
let edge_list = root.descendants().map(n => {
|
|
95
96
|
|
|
96
97
|
let source = n.data.multiway_parent;
|
|
97
98
|
let name = "unknown";
|