Skip to content

Commit

Permalink
Merge pull request #449 from stevenweaver/master
Browse files Browse the repository at this point in the history
1.4.2
  • Loading branch information
stevenweaver authored Dec 11, 2023
2 parents d2bcf04 + 3e784bc commit fd26c8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phylotree",
"version": "1.4.1",
"version": "1.4.2",
"main": "dist/phylotree.js",
"unpkg": "dist/phylotree.js",
"jsdelivr": "dist/phylotree.js",
Expand Down
7 changes: 4 additions & 3 deletions src/formats/newick.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,16 @@ function newickParser(nwk_str, options={}) {
* @returns {String} newick - Phylogenetic tree serialized as a Newick string.
*/

// TODO: break this out into two seperate functions
export function getNewick(annotator, root) {

export function getNewick(annotator, root) {
let self = this;

if (!annotator) annotator = d => '';

function nodeDisplay(n) {
// Skip the node if it is hidden
if (n.notshown) return;

if (!isLeafNode(n)) {
element_array.push("(");
n.children.forEach(function(d, i) {
Expand Down Expand Up @@ -273,7 +275,6 @@ export function getNewick(annotator, root) {
nodeDisplay(root || this.nodes);

return element_array.join("")+";";

}

export default newickParser;

0 comments on commit fd26c8c

Please sign in to comment.