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

Sort nodes by depth then sibling order. #16

Closed
mbostock opened this issue Nov 3, 2015 · 1 comment
Closed

Sort nodes by depth then sibling order. #16

mbostock opened this issue Nov 3, 2015 · 1 comment

Comments

@mbostock
Copy link
Member

mbostock commented Nov 3, 2015

Currently nodes are returned in pre-order depth-first traversal. This means that siblings are adjacent and in their original order.

I believe it would be preferable to return nodes in breadth-first traversal order, by ascending depth. The root is first, as before, and then siblings are returned in the order defined by hierarchy.sort, defaulting to descending value. Thus, nodes at depth i + 1 are always drawn on top of nodes of depth i—not just their direct ancestors.

@mbostock mbostock changed the title Layouts should return nodes sorted by depth, then sibling order. Sort nodes by depth then sibling order. Nov 3, 2015
@mbostock mbostock mentioned this issue Nov 4, 2015
16 tasks
@mbostock
Copy link
Member Author

Fixed in #14.

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

No branches or pull requests

1 participant