Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 669 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 669 Bytes

d3-flextree-v4

This is a copy of the d3-flextree D3 plugin updated to be compatible with version 4 of D3.

Usage

This library operates on d3-hierarchy objects. Its API is similar to d3.tree, the main difference being that nodeSize() also accepts a function that will be called for each node.

const flextree = require('d3-flextree-v4');
const tree = flextree().nodeSize((node) => {
  return [
    node.data.width,
    node.data.height
  ];
});

flextree(hierarchy); // adds "x" and "y" properties for each node.