Closed mbostock closed 2 years ago
Demo here: https://observablehq.com/d/067a15f32eee749a
I think d3.stratify should not impute a root node "/" if there is only one explicit root (e.g., "/flare"). Update: done.
Would it make sense to accept the path being returned as an array?
Maybe. At the least if we don’t, we should allow escaping of backslashes…
I can try to do the array-based approach. I think we’ll still need some normalization so that "/foo/bar".split("/") and "foo/bar".split("/") are considered equivalent.
This new d3.stratify feature imputes internal nodes using the specified path function, which returns slash-separated ids (as per a typical UNIX-y file system). Alternative to #184. Fixes #33.