d3/d3-hierarchy

Make hierarchies immutable?

mbostock opened this issue · 2 comments

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.

Immutability FTW!

Duplicate of #62.