ErikGartner / dTree

A library for visualizing data trees with multiple parents, such as family trees. Built on top of D3.
https://treehouse.gartner.io/ErikGartner/58e58be650453b6d49d7
MIT License
509 stars 135 forks source link

Can we add image ? #141

Closed siddhesh-vartak98 closed 1 year ago

siddhesh-vartak98 commented 1 year ago

I am currently making a family tree. I need to add a photo of each individual. Can I add images to the tree? Image be any shape either circle or square.

ErikGartner commented 1 year ago

Yes you can. You need to add a custom noderenderer (defining how to render each node) and then add a link to the image in the extra attribute of the node.

ErikGartner commented 1 year ago

Something like this https://jsfiddle.net/q8zn5ms4/4/ (the size of the image is really bad but you get the main idea).