react-d3-tree
react-d3-tree copied to clipboard
Image in the Node
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
any luck so far ?
This may help? #96