You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I think it’s probably not a good idea to do this, and instead keep d3.hierarchy as minimal as possible. First, it avoids this awkward construct in the common case:
varroot=d3.hierarchy()(data);
And second, we’ll still need node.sum and node.sort if we want to do in-place modifications of an existing hierarchy. Currently, calling node.sum is the only way to implement a stable update of a squarified treemap because it updates node.value without destroying node._squarify (the latter being where the tiling method stores the previously-computed layout). We could of course provide both, but that violates the principle of parsimony, as well as doing some unnecessary work by default (if you don’t want to sum values or sort siblings).
Also, if we supported hierarchy.value and hierarchy.sort, we’d have to add similar methods to d3.stratify for consistency. That’s another reason to stick with node.sum and node.sort, which works with both.
It’d be nice to have an example which uses d3.nest to create a hierarchical visualization. For example:
The text was updated successfully, but these errors were encountered: