A highly customizable org tree built with d3.js v5
npm i d3-org-tree
import OrgTree from "d3-org-tree";
const orgTree = new OrgTree()
orgTree.container('body') //dom element
.data({}) //data object
.svgWidth(800)
.svgHeight(600)
.initialZoom(.4)
.onNodeClick(d => {
console.log(d + " node clicked")
})
.onNodeAdd(d => {
console.log(d + " node added")
})
.onNodeRemove(d => {
console.log(d + " node removed")
})
.render()