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

[REQUEST] dotted line for divorced marriage #128

Open sihendri opened 2 years ago

sihendri commented 2 years ago

Hi...

I love your works. It help a lot creating my family tree. I don't want to call this as an issue. I just want to request to add a feature: dotted line for a divorced marriage.

I need to keep that information and display it on the tree, in case there is an ex couples have children, just to find out who is their biological parents... so the line to the children still from their biological parents.

and is it possible to have more than one spouse? because my great great grandparents have 3 wives..

sorry if hard for you to understand my words. English is not my primary language

nelind3 commented 2 years ago

Multiple spouses is easy just add another marriage object to the marriages array with the spouse and children like so:

"marriages": [
        {
            "spouse": {
                "name": "spouse0"
            }
        },
        {
            "spouse": {
                "name": "spouse1"
            },
            "children": {
               "name":  "child0"
        }
    ]
m-miller commented 1 year ago

The above overwrites spouse0 with spouse1 in the graph, does not add another node. I'm also looking to add a second marriage to an individual. Any ideas on where to start?

eroffa commented 1 year ago

The above overwrites spouse0 with spouse1 in the graph, does not add another node. I'm also looking to add a second marriage to an individual. Any ideas on where to start?

treeData = [{
  "name": "Men",
  "marriages": [{
    "spouse": {
      "name": "Women 1",
    },
  },
  {
    "spouse": {
      "name": "Women 2",
    },
  }],
}];

dTree.init(treeData, $options);