map = d3.layout.pack().size(size);
map.nodes({children: centers});
如何在d3 v4 +
中实现此目的我试图实现:
var getCenters = function (vname, size) {
var centers, map;
centers = _.uniq(_.pluck(rawData, vname)).map(function (d) {
return {name: d, value: 1};
});
map = d3.layout.pack().size(size);
map.nodes({children: centers});
return centers;
};