react-d3-tree
react-d3-tree copied to clipboard
NodeSizes relative to the Foreign Object size.
It would be nice to render nodes with a width and height relative to the size of Foreign Object.
Now we can do just like that nodeSize={{x: 300, y: 380}}.
Which causes:
Hi @VovaCHTB,
Great point 👍 Thank you for adding the image, really demonstrates what the problem with the fixed Node/ForeignObject ratio is.
I had a quick think through this and the primary issue here is that letting the ForeignObject
override it's Node
's dimensions breaks the parent-child relationship between Node-ForeignObject.
I know this would be possible via the context API but it's going to take some planning.
In the meantime if you have an approach you think would work feel free to add a PR, since I'm not sure when I'll have the spare time to address this considering there are some older requested changes that have been requested by multiple people.
Add this please, maybe this library will help you in implementation
https://www.npmjs.com/package/d3-flextree