react-d3-tree icon indicating copy to clipboard operation
react-d3-tree copied to clipboard

NodeSizes relative to the Foreign Object size.

Open VovaTereschenko opened this issue 5 years ago • 2 comments

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: area

VovaTereschenko avatar Sep 24 '18 19:09 VovaTereschenko

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.

bkrem avatar Oct 10 '18 17:10 bkrem

Add this please, maybe this library will help you in implementation

https://www.npmjs.com/package/d3-flextree

yehor-namiestnikov avatar Jul 10 '21 16:07 yehor-namiestnikov