/d3-org-tree

A highly customizable org tree built with d3.js v5

Primary LanguageJavaScriptMIT LicenseMIT

d3-org-tree

A highly customizable org tree built with d3.js v5

image

Installing

npm i d3-org-tree

Usage

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()