Make hierarchies immutable?
mbostock opened this issue · 2 comments
mbostock commented
Currently the layouts mutate the passed-in hierarchies in-place, but it’d be cleaner if they didn’t. For instance, you could pass the same root node to multiple hierarchy layouts and they would co-exist happily.
You can workaround this now using node.copy, but I think we should consider how we might do this automatically.
curran commented
Immutability FTW!