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

d3.stratify, but returns a simple JSON structure. #135

Closed
mbostock opened this issue Feb 6, 2019 · 3 comments
Closed

d3.stratify, but returns a simple JSON structure. #135

mbostock opened this issue Feb 6, 2019 · 3 comments

Comments

@mbostock
Copy link
Member

mbostock commented Feb 6, 2019

d3.stratify currently returns a d3.hierarchy instance, but sometimes you just want a simple JSON structure, equivalent to what you would pass to d3.hierarchy. For example, a simple API would be:

d3.hierarchy(d3.stratify(data, d => d.id, d => d.parentId))
@mbostock
Copy link
Member Author

mbostock commented Feb 6, 2019

This will be especially useful if the layouts take a JSON structure as input (rather than a hierarchy instance) so that we can more easily implement immutable layouts #62.

@curran
Copy link

curran commented Mar 28, 2019

Yes, I ran into this desire as well just the other day.

@mbostock
Copy link
Member Author

mbostock commented Dec 9, 2021

Closing due to inactivity.

@mbostock mbostock closed this as completed Dec 9, 2021
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

2 participants