【发布时间】:2023-01-28 01:57:04
【问题描述】:
var chart = new d3.OrgChart()
.container('.chart-container')
.data(dataFlattened)
.nodeWidth((d) => 250)
.initialZoom(0.7)
.nodeHeight((d) => 175)
.childrenMargin((d) => 40)
.compactMarginBetween((d) => 15)
.compactMarginPair((d) => 80)
.nodeContent(function (d, i, arr, state) {
return `*** html content obmitted ***`;
})
.onNodeClick(function (d) {
// d = id of the node clicked
// How to expand and change the color of the node here?
})
.render();
【问题讨论】: