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

Image in the Node

Open reyicare opened this issue 6 years ago • 2 comments

Hi, I'm trying to display an image in background of the div for the Node. It's possible to fill a color but not an image. The image is loading correctly by the browser.

This is my code for the Tree : <Tree data={[myTree]} translate={this.state.translate} orientation="vertical" collapsible={false} nodeSvgShape={{shape: "none"}} allowForeignObjects scaleExtent={{min: 0.5, max: 3}} nodeSize={{x: 300, y: 200}} nodeLabelComponent={{ render: <Nodes/>, foreignObjectWrapper: { style: { width: 100, height: 50, x: -50, y: -25 } } }}/>

and the render of the node is like this :

<div className={"diamond"} style={{ height:"100%", width:"100%", minHeight: 50, textAlign: "center", background:url("img/diamond.png") }}> </div>);

How can I display an image in background of a div? Thanks

And How can I modify your lib in live development? Now I've create a link between the lib and my project but each time I modify something, I need to rebuild your project and that's not easy for debug. Thanks

reyicare avatar Apr 18 '18 05:04 reyicare

any luck so far ?

usman-ali-siddiqui avatar Sep 19 '18 11:09 usman-ali-siddiqui

This may help? #96

jsib0 avatar Aug 20 '19 00:08 jsib0