react-d3-tree icon indicating copy to clipboard operation
react-d3-tree copied to clipboard

Allow User-Defined Collapsed State for Nodes, Defaults to False if Not Specified

Open kamil-zachradnik opened this issue 1 year ago • 2 comments

This update introduces the ability for users to specify which nodes should be collapsed. Previously, it wasn't possible to dynamically control the initial open or closed state of nodes when loading data from an API. With this change, you can now define your node structure with the __rd3t property. By adding __rd3t: { collapsed: true }, the node will be initialized in a collapsed state. This enhancement provides greater flexibility in managing node visibility when working with dynamic data.

kamil-zachradnik avatar Nov 04 '24 15:11 kamil-zachradnik

@bkrem Please take a look at this as soon as you can. Doing a manual patch right now on each build run to allow control over the collapsed state and had to switch to npm from pnpm for it which has increased build time 3x! Many people are relying on this change:

image

ShazimC avatar Jan 16 '25 00:01 ShazimC

@bkrem please

ShazimC avatar May 15 '25 00:05 ShazimC