1

How can I add multiple parent for a child node in family tree diagram in GOJS. Are there any parameters or any lines of codes to do so ?

I want to generate image like below.

enter image description here

Sagar Dev Timilsina
  • 1,310
  • 15
  • 32

1 Answers1

1

Do you mean something like http://gojs.net/latest/samples/genogram.html? That is what most people use when they want to show both parents as separate nodes, potentially each with their own relationships.

The http://gojs.net/latest/samples/familyTree.html sample uses a TreeModel, not a GraphLinksModel, so it cannot describe a graph where nodes might have multiple "tree" parents. You have to use a GraphLinksModel for what you describe.

Furthermore, that Family Tree sample uses TreeLayout, which only works well on tree-structured graphs. You want to use LayeredDigraphLayout instead.

So to get what you have drawn, use a GraphLinksModel and LayeredDigraphLayout.

Walter Northwoods
  • 4,061
  • 2
  • 10
  • 16