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

Accept iterables. #155

Merged
merged 27 commits into from
Aug 23, 2020
Merged

Accept iterables. #155

merged 27 commits into from
Aug 23, 2020

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Nov 16, 2019

Fixes #94.
Fixes #140.
Fixes #154.
Fixes #67.

@mbostock mbostock requested a review from Fil November 17, 2019 02:45
Copy link
Member

@Fil Fil left a 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?

README.md Show resolved Hide resolved
var tape = require("tape"),
d3 = require("../../");

tape("d3.hierarchy(data, children) supports iterable children", function(test) {
Copy link
Member

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

@mbostock
Copy link
Member Author

Sure, I’d love test contributions.

@mbostock
Copy link
Member Author

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.

@mbostock
Copy link
Member Author

mbostock commented Nov 19, 2019

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);

@Fil

This comment has been minimized.

Fil and others added 3 commits August 17, 2020 12:07
Co-authored-by: Mike Bostock <mbostock@gmail.com>
rescale epsilon to the circles' magnitude
@Fil Fil merged commit 6f7c5ed into master Aug 23, 2020
@Fil Fil deleted the two branch August 23, 2020 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants