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
521 stars 139 forks source link

Make all node the same maximal height #83

Closed jpdaut closed 5 years ago

jpdaut commented 5 years ago

Names in my tree wrap into 2 lines or 3 lines depending on their length. This makes the nodes different heights. It would look better if all nodes were the same height. Is there a way to force all nodes to have the same height = height of the highest node?

ErikGartner commented 5 years ago

Yes, by using the custom node renderer call back you can use any HTML / CSS to style and format your nodes. https://jsfiddle.net/tpde0cer/998/

/Erik

jpdaut commented 5 years ago

So in nodeRenderer I changed from : node += 'style="height:100%;width:100%;" ';

to a fixed pixel height, 125px : node += 'style="height:125px;width:100%;" ';

This works because the lower div overflows visible outside the SVG area :

Anne Mauvenist

I originally thought the SVG element itself should be scaled (to a fixed height)

But you're saying have the lower DIV over the SVG area like this, and it's ok?