BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
60 stars 17 forks source link

Wedding anniversary/date #145

Open unclebay143 opened 1 month ago

unclebay143 commented 1 month ago

Is it possible to somehow add the date of marriage between partners?

ZornitsaPesheva commented 1 month ago

Created this code example for you: https://code.balkan.app/familytree-js/ate-of-marriage#JS

unclebay143 commented 1 month ago

Created this code example for you: https://code.balkan.app/familytree-js/ate-of-marriage#JS

thanks @ZornitsaPesheva, this is useful for rendering. However, what I'm requesting is adding the date in the generated family js and handling for multiple partners.

my thought:

[
  { id: 1, pids: [3], name: 'Amber McKenzie', gender: 'female', weddingDate: { pid: 3, date: '01.01.1999' } },
  { id: 2, pids: [3], name: 'Janet', gender: 'female', weddingDate: { pid: 3, date: '25.12.2001' } },
  {
    id: 3,
    pids: [1, 2],
    name: 'Ava Field',
    gender: 'male',
    weddingDate: { pid: 1, date: '01.01.1999', pid: 2, date: '25.12.2001' },
  },
];

Does something like this exist? Or how would you approach this?

Thanks

ZornitsaPesheva commented 1 month ago

What if 1 and 2 have more partners? How the data will look then?

unclebay143 commented 1 month ago

What if 1 and 2 have more partners? How the data will look then?

Shoot! Should be an array of objects

i.e weddingDates: [{ pid: 1, date: '01.01.1999'}, {pid: 2, date: '25.12.2001' }],

[
  { id: 1, pids: [3], name: 'Amber McKenzie', gender: 'female', weddingDates: [{ pid: 3, date: '01.01.1999' }] },
  { id: 2, pids: [3], name: 'Janet', gender: 'female', weddingDates: [{ pid: 3, date: '25.12.2001' }] },
  {
    id: 3,
    pids: [1, 2],
    name: 'Ava Field',
    gender: 'male',
    weddingDates: [{ pid: 1, date: '01.01.1999'}, {pid: 2, date: '25.12.2001' }],
  },
];

Also thinking how to avoid partners having different wedding dates at some point. We can always search for the other partner and update the dates when either of the partners are updated.

wdyt?

ZornitsaPesheva commented 1 month ago

I have created this example. but it is not perfect for sure: https://code.balkan.app/familytree-js/date-of-marriage#JS

unclebay143 commented 1 month ago

Oh shoot! Thought I hit the comment button!

This looks great.... This can be improved for sure if needed, it's a good start.