Multiple partners in a family tree in d3.js?

安稳与你 提交于 2019-11-30 11:15:09

@medder thanks for the appreciation!

To do that I have added a hidden node between john and mistress.

And added a child to that hidden node, so it appears as if john and mistress have a child "Hidden Son" So the JSON looks like

{
    name: "Mistress",
    id: 9000,
    no_parent: true
  }, {
    name: "",//this is the new node between Mistress and John
    id: 100,
    no_parent: true,//it has no parents
    hidden: true,
    children: [{
      // so this hidden node will have a child 
      // which will make it appear as if john and mistress has a child.
      name: "Hidden Son",
      id: 9001
    }]
  }, {
    name: "John",
    id: 16,
    no_parent: true
  },

Working code here

Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!