OptionalbranchExtra class names for nodes with children.
OptionalcenteringThe duration, in milliseconds, of the move that centers a clicked node. Needs TreeProps.dimensions.
OptionalcollapsibleWhether nodes expand and collapse when clicked.
The root node. Each node lists its child nodes in children. If you pass an array, Tree
renders only its first element.
Tree gives each node element a unique id attribute, and each link data-source-id and
data-target-id attributes.
OptionaldataIdentifies the tree that data describes. While dataKey stays the same, Tree ignores new
data and keeps rendering its current tree, including nodes added with addChildren and
which nodes are collapsed. To render new data, change dataKey or leave it unset; Tree
then resets to the new data.
OptionaldepthThe distance, in pixels, between depth levels: each node sits at node.depth * depthFactor
along the depth axis. A negative value reverses the tree's direction; 0 puts every node on
the same level. If unset, TreeProps.nodeSize sets the distance.
OptionaldimensionsThe width and height of the tree's container, for example from
getBoundingClientRect().
If set, a clicked node moves to the center of the view.
OptionaldraggableWhether the user can drag the tree to pan it.
OptionalenableAnimates nodes as they expand and collapse, using react-transition-group. Can slow down
large trees.
OptionalhasLimits dragging and zooming to the tree's background, so that inputs and other controls inside nodes work. To drag or zoom from anywhere, hold Shift.
OptionalinitialCollapses every node at this depth or deeper on the first render. The root node has depth
0. If unset, every node starts expanded.
OptionalleafExtra class names for nodes without children.
OptionalnodeThe space, in pixels, that each node takes up: x horizontally, y vertically.
OptionalonCalled with the link's source node, target node, and the event when a link is clicked.
OptionalonCalled with the link's source node, target node, and the event when the pointer leaves a link.
OptionalonCalled with the link's source node, target node, and the event when the pointer moves onto a link.
OptionalonCalled with the node and the event when a node is clicked. The default node calls it on a click on its circle.
OptionalonCalled with the node and the event when the pointer leaves a node.
OptionalonCalled with the node and the event when the pointer moves onto a node.
OptionalonCalled after each zoom or pan, and after each update of the tree, such as a node toggle.
node is the toggled node, or null if no node was toggled.
OptionalorientationThe direction in which the tree grows: horizontal grows left to right, vertical grows
top to bottom. To reverse the direction, pass a negative TreeProps.depthFactor.
OptionalpathReturns extra class names for a link. Tree calls it for each link with the link's
TreeLinkDatum and the tree's orientation.
OptionalpathHow links are drawn: one of the PathFunctionOption values, or a PathFunction that returns
the link's SVG path. For the path syntax, see
the d attribute.
OptionalrenderRenders each node in place of the default node. Tree calls it with
CustomNodeElementProps and renders the returned SVG element.
OptionalrootExtra class names for the root node.
OptionalscaleThe smallest and largest zoom levels when TreeProps.zoomable is true.
OptionalseparationThe space between neighboring nodes, as a multiple of TreeProps.nodeSize: siblings
for nodes with the same parent, nonSiblings for nodes with different parents.
OptionalshouldWhether expanding a node collapses the other nodes at the same depth.
OptionalsvgExtra class names for the tree's svg element.
OptionaltransitionThe duration, in milliseconds, of the expand and collapse animation. Needs TreeProps.enableLegacyTransitions.
OptionaltranslateMoves the tree along the x and y axes, in pixels. At { x: 0, y: 0 }, the root node sits
in the top-left corner of the SVG.
OptionalzoomThe starting zoom level, limited to TreeProps.scaleExtent.
OptionalzoomableWhether the user can zoom the tree, within TreeProps.scaleExtent.
Props accepted by the
Treecomponent.datais the only required prop.