After upgrading to d3.js v4.1.1, this line:
d3.layout.tree()
produces an error:
Cannot read property 'tree' of undefined
It seems like the tree layout has been removed from v4? https://github.com/d3/d3/blob/master/API.md
The examples still use the v3 API: http://bl.ocks.org/mbostock/1093025
Is the layout really gone or has it been renamed?
As of D3 v4.0 (June 2016), the tree layout has been renamed. See:
https://github.com/d3/d3/blob/master/CHANGES.md#hierarchies-d3-hierarchy
Pursuant to the great namespace flattening:
- d3.layout.cluster ↦ d3.cluster
- d3.layout.hierarchy ↦ d3.hierarchy
- d3.layout.pack ↦ d3.pack
- d3.layout.partition ↦ d3.partition
- d3.layout.tree ↦ d3.tree
- d3.layout.treemap ↦ d3.treemap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With