Skip to content
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

Bug in tree layout algorithm #169

Open
vkaravir opened this issue Sep 3, 2014 · 0 comments
Open

Bug in tree layout algorithm #169

vkaravir opened this issue Sep 3, 2014 · 0 comments

Comments

@vkaravir
Copy link
Owner

vkaravir commented Sep 3, 2014

For common trees, the tree layout can position nodes incorrectly in some cases. Here's an example:

var tree = new jsav.ds.tree();

var r = tree.root(1);
r.addChild(2);
r.addChild(3);
r.addChild("");
r.addChild(4);

r.child(0).addChild(5);
r.child(0).addChild(6);

r.child(1).addChild(7);
r.child(1).addChild(8);

r.child(3).addChild(9);
r.child(3).addChild(10);

tree.layout();

Which results in a tree like this:
screen shot 2014-09-03 at 10 14 45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant