Releases: bkrem/react-d3-tree
Releases · bkrem/react-d3-tree
v3.3.2
v3.3.1
v3.3.0
v3.2.1
Summary
- Event handlers (
onNodeClick
,onNodeMouseOver
,onNodeMouseOut
) defined onTree
are now passed to therenderCustomNodeElement
function as props by default (thank you @lucasdellabella)
Changeset
v3.2.0
- docs: tweaks prop documentation for
hasInteractiveNodes
38b2c4a - refactor(demo): simplifes
MixedNodeInputElement
example be623ac - fix(demo): fixes order of custom node element options 75c4b73
- Add 'hasInteractiveNodes' prop to Tree that enables/disables d3 drag and pan handlers on foreignObject nodes (#370, thank you @chingmunn) cfec09a
v3.1.1
v3.1.0
v3.0.0
- refactor: aligns
onNode
handler parameter signatures withonLink
handlers (#349)- BREAKING CHANGE: All top-level
onNode
handlers now passnode: HierarchyPointNode<TreeNodeDatum>
as their first parameter instead of previousnode: 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 inv3.x
by simply accessing thedata
property on the passednode
:- v2:
onNodeClick={ (node, event) => { console.log(node) } }
- v3:
onNodeClick={ (node, event) => { console.log(node.data) } }
- v2:
- The change aligns
Node
handlers with those ofLink
, which already returnHierarchyPointNode<TreeNodeDatum>
for theirsourceNode
andtargetNode
parameters. - See the updated type definition for
TreeNodeEventCallback
for more details.
- BREAKING CHANGE: All top-level
v2.0.4
- fix(zoomable): allows for dragging without scaling if
props.zoomable
is set tofalse
. - fix(ts): widens type for
RawNodeDatum["attributes"]
(#350)attributes
was made unintentionally restrictive during the v2 refactor to Typescript, by moving from a loose implicitobject
type toRecord<string,string>
.- This change widens the used
Record
type to additionally acceptnumber
andboolean
primitives as possible values. - See the
RawNodeDatum
docs for more details.