Skip to content

v3.0.0

Compare
Choose a tag to compare
@bkrem bkrem released this 24 Jun 16:39
· 106 commits to master since this release
  • refactor: aligns onNode handler parameter signatures with onLink handlers (#349)
    • BREAKING CHANGE: All top-level onNode handlers now pass node: HierarchyPointNode<TreeNodeDatum> as their first parameter instead of previous node: TreeNodeDatum.
    • This change affects the following event handlers: onNodeClick, onNodeMouseOver, onNodeMouseOut.
    • If you're currently using v2.x, you can preserve your existing handler behaviour in v3.x by simply accessing the data property on the passed node:
      • v2: onNodeClick={ (node, event) => { console.log(node) } }
      • v3: onNodeClick={ (node, event) => { console.log(node.data) } }
    • The change aligns Node handlers with those of Link, which already return HierarchyPointNode<TreeNodeDatum> for their sourceNode and targetNode parameters.
    • See the updated type definition for TreeNodeEventCallback for more details.