-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tree.scale_bar() returns undefined, maybe an edge case? #7
Comments
Yes, the scale was set based on the first branch length, if it is zero it returned NaN. |
@emepyc I updated to latest in npm, and it's working now. Thanks so much! We are going-live with the tnt.tree and the biojs msa component this week, I will post a note on Gitter if you want to take look. |
Oops just noticed one minor thing, I think you left some console.log() in the tree.js file. |
Yay! sorry, just fixed it (v0.1.9) |
Thanks :) |
btw, I'd love to take a look at your implementation once you have something live! :-) |
Hi Miguel, we have noticed that in some of our trees, the tnt.tree is unable to calculate the distance. For the tree below,
tree.scale_bar(100, 'pixels');
returnsundefined
.This only happens with some of our trees- and I suspect it has something to do with zero- length branches, but I cannot see what is going wrong in the code. Please let me know if you have any ideas or fixes.
Here is the newick
Also note the tree displays fine with
scale(true)
, it's just thescale_bar()
calculation that fails.The text was updated successfully, but these errors were encountered: