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.
答案 0 :(得分: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.