-
Notifications
You must be signed in to change notification settings - Fork 313
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
Accept iterables. #155
Accept iterables. #155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a few of the functions are not tested (each, find…). Is this something that could be useful?
var tape = require("tape"), | ||
d3 = require("../../"); | ||
|
||
tape("d3.hierarchy(data, children) supports iterable children", function(test) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a detail, but the "children" argument listed in this comment is not used
Sure, I’d love test contributions. |
I made some tweaks so that you can pass a rollup or group Map directly to d3.hierarchy and it’ll work out of the box, and I’ve been tinkering with the d3-hierarchy notebooks to make it easier to override the data (e.g., using d3.stratify or d3.rollup without needing to change the rest of the code). Let me know if you have any thoughts there. |
One joyful discovery is that, now that hierarchies are iterable, they work beautifully with the new d3-array, e.g. const [x0, x1] = d3.extent(root, d => d.x); |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Mike Bostock <mbostock@gmail.com>
rescale epsilon to the circles' magnitude
Fixes #94.
Fixes #140.
Fixes #154.
Fixes #67.