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
Copy file name to clipboardExpand all lines: README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,9 @@ class MyComponent extends React.Component {
97
97
|`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. |
98
98
|`onMouseOver`|`func`|||`undefined`| Callback function to be called when mouse enters the space belonging to a node. <br /><br />Has the function signature `(nodeData, evt)`. The clicked node's data object is passed as first parameter, event object as second. |
99
99
|`onMouseOut`|`func`|||`undefined`| Callback function to be called when mouse leaves the space belonging to a node. <br /><br />Has the function signature `(nodeData, evt)`. The clicked node's data object is passed as first parameter, event object as second. |
100
+
|`onLinkClick`|`func`|||`undefined`| Callback function to be called when a link is clicked. <br /><br />Has the function signature `(linkSource, linkTarget, evt)`. The clicked link's parent data object is passed as first parameter, the child's as second, the event object as third. |
101
+
|`onLinkMouseOver`|`func`|||`undefined`| Callback function to be called when mouse enters the space belonging to a link. <br /><br />Has the function signature `(linkSource, linkTarget, evt)`. The clicked link's parent data object is passed as first parameter, the child's as second, the event object as third. |
102
+
|`onLinkMouseOut`|`func`|||`undefined`| Callback function to be called when mouse leaves the space belonging to a link. <br /><br />Has the function signature `(linkSource, linkTarget, evt)`. The clicked link's parent data object is passed as first parameter, the child's as second, the event object as third. |
100
103
|`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. The node's data object, as well as zoom level and coordinates are passed to the callback. |
101
104
|`orientation`|`string` (enum) |`horizontal``vertical`||`horizontal`|`horizontal` - Tree expands left-to-right. <br /><br /> `vertical` - Tree expands top-to-bottom. |
102
105
|`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). |
@@ -143,10 +146,10 @@ const svgSquare = {
143
146
To avoid rendering any node element, simply set `nodeSvgShape` to `{ shape: 'none' }`.
144
147
145
148
### Overridable `shapeProps`
146
-
`shapeProps` is currently merged with `node.circle`/`leafNode.circle` (see [Styling](#styling)).
149
+
`shapeProps` is currently merged with `node.circle`/`leafNode.circle` (see [Styling](#styling)).
147
150
148
-
This means any properties passed in `shapeProps` will be overridden by **properties with the same key** in the `node.circle`/`leafNode.circle` style props.
149
-
This is to prevent breaking the legacy usage of `circleRadius` + styling via `node/leafNode` properties until it is deprecated fully in v2.
151
+
This means any properties passed in `shapeProps` will be overridden by **properties with the same key** in the `node.circle`/`leafNode.circle` style props.
152
+
This is to prevent breaking the legacy usage of `circleRadius` + styling via `node/leafNode` properties until it is deprecated fully in v2.
150
153
151
154
**From v1.5.x onwards, it is therefore recommended to pass all node styling properties through `shapeProps`**.
0 commit comments