Closed spacegangster closed 3 years ago
Hi @spacegangster,
How can I orient a tree from leaves to the root? In horizontal layout.
If I'm understanding you correctly, you want the root to be the furthest on the right in this case. Here's an example using the depthFactor
prop with a negative value to invert the tree's direction:
https://codesandbox.io/s/rd3t-v2-custom-event-handlers-forked-6fu87?file=/src/App.js
Or how can I plug-in my own layout function?
You can provide custom path functions that go beyond the predefined ones (straight
, diagonal
, etc) via the pathFunc
prop:
https://github.com/bkrem/react-d3-tree#providing-your-own-pathfunc
Hope that helps!
@bkrem yes, depthFactor it is, thanks!
By layout function plug-in I mean something to patch the x,y coordinates of the nodes themselves.
Hey, thanks a lot for this wonderful project!
How can I orient a tree from leaves to the root? In horizontal layout. Or how can I plug-in my own layout function?
Sorry, if this is a wrong place to ask.