Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't have any configration for displaying child node to single parent node #7

Open
divbhalala opened this issue Sep 6, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@divbhalala
Copy link

divbhalala commented Sep 6, 2021

i am not able to find any configration for displaying child node to single parent node
you can see this in below screenshot

https://prnt.sc/1re7iiy

@divsbhalala
Copy link

image

@SanichKotikov
Copy link
Owner

Hi,

Not sure what the problem is. If you need add child for one spouse only, just do it.

@divbhalala
Copy link
Author

@SanichKotikov please check this https://codesandbox.io/s/weevusissue-uvuk0 . In child-issue option I have added one child to female node but it can not appearing.

@SanichKotikov
Copy link
Owner

I see only 3 nodes in the json file, but u want to see 4. Nodes will not appear out of nothing.

@divbhalala
Copy link
Author

divbhalala commented Sep 20, 2021

I was testing it. please check that now.There is added one children with only one parent in their parents list.

@divbhalala
Copy link
Author

divbhalala commented Sep 20, 2021

@SanichKotikov here is JSON data that i am using for that
[ { "id": "aoF9dn5Ew", "gender": "male", "spouses": [ { "id": "tdRwdtR54", "type": "divorced" } ], "siblings": [], "parents": [], "children": [ { "id": "dyTpfj6st", "type": "blood" } ] }, { "id": "tdRwdtR54", "gender": "female", "parents": [], "siblings": [], "spouses": [ { "id": "aoF9dn5Ew", "type": "divorced" } ], "children": [ { "id": "dyTpfj6st", "type": "blood" }, { "id": "dyTpfj6st_single", "type": "blood" } ] }, { "id": "dyTpfj6st", "gender": "male", "spouses": [], "siblings": [], "parents": [ { "id": "aoF9dn5Ew", "type": "blood" } ], "children": [] }, { "id": "dyTpfj6st_single", "gender": "male", "spouses": [], "siblings": [], "parents": [ { "id": "tdRwdtR54", "type": "blood" } ], "children": [] } ]

https://codesandbox.io/s/weevusissue-uvuk0

https://prnt.sc/1sylmka

@SanichKotikov SanichKotikov added the enhancement New feature or request label Sep 22, 2021
@SanichKotikov
Copy link
Owner

This is impossible in current version of the library. I'll add this case to my roadmap and will try to implement when I have some time. Right now, as a workaround, you have to define second parent (with another type of spouse relation) for this hidden node.

@divbhalala
Copy link
Author

Ok thanks

@LavransBjerkestrand
Copy link

Great library, thanks for making it open source.

... define second parent (with another type of spouse relation) for this hidden node.

@divbhalala were you able to get this to work?

I'm trying but not sure if it's actually possible. Is this what you had in mind?

stackblitz

Nodes:

[
  {
    id: 'father',
    gender: 'male',
    children: [
      { id: 'child-1', type: 'blood' },
      { id: 'child-2', type: 'blood' },
    ],
    parents: [],
    siblings: [],
    spouses: [
      { id: 'spouse-1', type: 'married' },
      { id: 'spouse-2', type: 'divorced' },
    ],
  },
  {
    id: 'spouse-1',
    gender: 'female',
    children: [{ id: 'child-1', type: 'blood' }],
    parents: [],
    siblings: [],
    spouses: [{ id: 'father', type: 'married' }],
  },
  {
    id: 'spouse-2',
    gender: 'female',
    children: [{ id: 'child-2', type: 'blood' }],
    parents: [],
    siblings: [],
    spouses: [{ id: 'father', type: 'divorced' }],
  },
  {
    id: 'child-1',
    gender: 'male',
    children: [],
    parents: [
      { id: 'father', type: 'blood' },
      { id: 'spouse-1', type: 'blood' },
    ],
    siblings: [{ id: 'child-2', type: 'half' }],
    spouses: [],
  },
  {
    id: 'child-2',
    gender: 'male',
    children: [],
    parents: [
      { id: 'father', type: 'blood' },
      { id: 'spouse-2', type: 'blood' },
    ],
    siblings: [{ id: 'child-1', type: 'half' }],
    spouses: [],
  },
]
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants