-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Additional Transform to Support Flat Hierarchies #3733
Labels
feature-request
For requesting new features or transforms
Comments
For anyone else facing this issue, you can get a result with a series of transforms but it is clunky and native support would still be better.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm currently building tree layouts (https://vega.github.io/vega/examples/tree-layout/) as seen here:
Typically, hierarchical data is stored in source systems in one of two different formats:
The first format is already catered for in Vega by supplying it to a Stratify transform and then a Tree transform. However, I don't believe there is currently any support for the second format which is quite common from my experience. I originally thought the Nest transform would handle these cases but the Nest transform only supports data where all leaves are at the same level. i.e. nest cannot handle something like the following ragged hierarchy (the last record for Accountant stops at a depth of 3 where as others records go to a depth of 4):
Incidentally, it might be an idea to update the documentation on Nest to clarify that only hierarchies with leaves at the same level are supported as it wasn't 100% clear to me until I tested.
In summary, a transform to turn the wide format of example 2 into the narrow format in example 1 before feeding to a stratify would be really helpful. Relevant d3 issues is here: d3/d3-hierarchy#149
The text was updated successfully, but these errors were encountered: