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
525 stars 140 forks source link

How can I decrease height of mariagge 2nd line #130

Open dungla2011 opened 2 years ago

dungla2011 commented 2 years ago

image

Thank you!

y377 commented 2 years ago
[
{
    "name": "Father", // The name of the node
    "class": "node", // The CSS class of the node
    "textClass": "nodeText", // The CSS class of the text in the node
    "depthOffset": 1, // Generational height offset
    "marriages": [
    { // Marriages is a list of nodes
        "spouse":
        { // Each marriage has one spouse
            "name": "Mother",
        },
        "children": [
        { // List of children nodes
            "name": "Child",
        }]
    }],
    "extra":
    {} // Custom data passed to renderers
}]
dungla2011 commented 2 years ago

I have not resolved it:

https://giapha.galaxycloud.vn/le-nguyen-hoang.aj861518.sdata

image

eroffa commented 1 year ago

Try playing with these functions:

nodeHeightSeperation: function(nodeWidth, nodeMaxHeight) {
  return nodeMaxHeight * 1.5; // nodeMaxHeight * 2 and so on
},

And

nodeSize: function(nodes, width, textRenderer) {
  _.map(nodes, function (n) {
    n.cWidth = 150; // 300 and so on
    n.cHeight = 150; // 300 and so on
  });

return [250, 250]; // 500, 500 and so on
},