Skip to content

Commit b182c91

Browse files
committed
Add check to prevent negative branch lengths
1 parent 6800b94 commit b182c91

File tree

5 files changed

+254
-123
lines changed

5 files changed

+254
-123
lines changed

dist/tidytree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ var TidyTree = (function () {
13131313
.hierarchy(this.data, d => d.children)
13141314
.eachBefore(d => {
13151315
d.value =
1316-
(d.parent ? d.parent.value : 0) + (d.data.length ? d.data.length : 0);
1316+
(d.parent ? d.parent.value : 0) + (d.data.length ? Math.abs(d.data.length) : 0);
13171317
if (d.value < this.range[0]) this.range[0] = d.value;
13181318
if (d.value > this.range[1]) this.range[1] = d.value;
13191319
})

dist/tidytree.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)