d3__WEBPACK_IMPORTED_MODULE_0__.hierarchy is not a function
mbasakCinedigmInd opened this issue · comments
megha basak commented
trying to use hierarchical bar graph but "d3__WEBPACK_IMPORTED_MODULE_0__.hierarchy is not a function" issue is showing
const root = d3
.hierarchy(data)
.sum(d => d.value)
.sort((a, b) => b.value - a.value)
.eachAfter(
d =>
(d.index = d.parent ? (d.parent.index = d.parent.index + 1 || 0) : 0)
);
"react": "^18.2.0"
"d3": "^3.5.17",