You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`data`|`array`<br/>`object`|| required |`undefined`| Single-element array containing the root node object (see `myTreeData` above). <br/> Passing the root node object without an array wrapping it is also possible. <br /><br /> `react-d3-tree` will automatically attach a unique `id` attribute to each node in the DOM, as well as `data-source-id` & `data-target-id` attributes to each link connecting two nodes. |
95
+
|`svgClassName`|`string`|||`undefined`| Allows for additional className(s) to be passed to the `svg` element wrapping the tree. |
95
96
|`nodeSvgShape`|`object`| see [Node shapes](#node-shapes)||`{shape: 'circle', shapeProps: {r: 10}}`| Sets a specific SVG shape element + shapeProps to be used for each node. |
96
97
|`nodeLabelComponent`|`object`| see [Using foreignObjects](#using-foreignobjects)||`null`| Allows using a React component as a node label; requires `allowForeignObjects` to be set. |
97
98
|`onClick`|`func`|||`undefined`| Callback function to be called when a node is clicked. <br /><br />Has the function signature `(nodeData, evt)`. The clicked node's data object is passed as first parameter, event object as second. |
@@ -103,6 +104,7 @@ class MyComponent extends React.Component {
103
104
|`onUpdate`|`func`|||`undefined`| Callback function to be called when the inner D3 component updates. That is - on every zoom or translate event, or when tree branches are toggled. <br /><br />Has the function signature `(updateTarget: {targetNode, currentTranslate, currentZoom})`. |
104
105
|`orientation`|`string` (enum) |`horizontal``vertical`||`horizontal`|`horizontal` - Tree expands left-to-right. <br /><br /> `vertical` - Tree expands top-to-bottom. |
105
106
|`translate`|`object`|||`{x: 0, y: 0}`| Translates the graph along the x/y axis by the specified amount of pixels (avoids the graph being stuck in the top left canvas corner). |
107
+
|`pathClassFunc`|`func`|`customFunc(linkData, orientation)`||`undefined`| Allows for additional className(s) to be passed to links. |
106
108
|`pathFunc`|`string (enum)`/`func`|`diagonal`<br/>`elbow`<br/>`straight`<br/>`customFunc(linkData, orientation)`||`diagonal`|`diagonal` - Smooth, curved edges between parent-child nodes. <br /><br /> `elbow` - Sharp edges at right angles between parent-child nodes. <br /><br /> `straight` - Straight lines between parent-child nodes. <br /><br /> `customFunc` - Custom draw function that accepts `linkData` as its first param and `orientation` as its second. |
107
109
|`collapsible`|`bool`|||`true`| Toggles ability to collapse/expand the tree's nodes by clicking them. |
108
110
|`useCollapseData`|`bool`| see [Pre-defining a node's `_collapsed` state](#pre-defining-a-nodes-_collapsed-state)||`false`| Toggles whether the tree should automatically use any `_collapsed: bool` properties it finds on nodes in the passed data set to configure its initial layout. |
0 commit comments