-
-
-
-
+
+
+
+
+
📥 Download GEDCOM
@@ -470,8 +471,8 @@ function initializeFamilyTree() {
enabled: true,
direction: 'UD',
sortMethod: 'directed',
- nodeSpacing: 150,
- levelSeparation: 120,
+ nodeSpacing: 180,
+ levelSeparation: 140,
shakeTowards: 'roots'
}
},
@@ -616,20 +617,27 @@ function showGeneration(type) {
let visibleNodes;
switch(type) {
- case 'gen1-3':
- visibleNodes = ['adam', 'eve', 'cain', 'abel', 'seth', 'enoch_cain', 'enos'];
+ case 'gen1-5':
+ // Adam to Mahalaleel (5 generations)
+ visibleNodes = getAllConnectedNodes(['adam', 'eve', 'cain', 'abel', 'seth', 'enoch_cain', 'enos', 'irad', 'cainan', 'mahalaleel']);
break;
- case 'gen4-6':
- visibleNodes = ['cainan', 'mahalaleel', 'jared', 'irad', 'mehujael', 'methusael'];
+ case 'gen3-7':
+ // Enos to Enoch (5 generations)
+ visibleNodes = getAllConnectedNodes(['enos', 'cainan', 'mahalaleel', 'jared', 'enoch_seth', 'mehujael', 'methusael']);
break;
- case 'gen7-10':
- visibleNodes = ['enoch_seth', 'methuselah', 'lamech_seth', 'lamech_cain', 'noah', 'shem', 'ham', 'japheth'];
+ case 'gen5-9':
+ // Mahalaleel to Lamech (5 generations)
+ visibleNodes = getAllConnectedNodes(['mahalaleel', 'jared', 'enoch_seth', 'methuselah', 'lamech_seth', 'lamech_cain']);
+ break;
+ case 'gen7-11':
+ // Enoch to Noah's grandsons (5 generations)
+ visibleNodes = getAllConnectedNodes(['enoch_seth', 'methuselah', 'lamech_seth', 'noah', 'shem', 'ham', 'japheth']);
break;
case 'cain-line':
- visibleNodes = ['adam', 'eve', 'cain', 'enoch_cain', 'irad', 'mehujael', 'methusael', 'lamech_cain', 'jabal', 'jubal', 'tubalcain'];
+ visibleNodes = getAllConnectedNodes(['adam', 'eve', 'cain', 'enoch_cain', 'irad', 'mehujael', 'methusael', 'lamech_cain', 'jabal', 'jubal', 'tubalcain']);
break;
case 'seth-line':
- visibleNodes = ['adam', 'eve', 'seth', 'enos', 'cainan', 'mahalaleel', 'jared', 'enoch_seth', 'methuselah', 'lamech_seth', 'noah', 'shem', 'ham', 'japheth'];
+ visibleNodes = getAllConnectedNodes(['adam', 'eve', 'seth', 'enos', 'cainan', 'mahalaleel', 'jared', 'enoch_seth', 'methuselah', 'lamech_seth', 'noah', 'shem', 'ham', 'japheth']);
break;
default:
visibleNodes = Object.keys(familyData);
@@ -677,6 +685,29 @@ function fitToScreen() {
});
}
+function getAllConnectedNodes(nodeList) {
+ // Helper function to get all nodes and their spouses
+ const connected = new Set();
+
+ nodeList.forEach(nodeId => {
+ if (familyData[nodeId]) {
+ connected.add(nodeId);
+ // Add spouse if they exist
+ const person = familyData[nodeId];
+ if (person.spouse) {
+ // Find spouse ID
+ Object.keys(familyData).forEach(id => {
+ if (familyData[id].name === person.spouse) {
+ connected.add(id);
+ }
+ });
+ }
+ }
+ });
+
+ return Array.from(connected);
+}
+
function centerOnPersonAndDescendants(personId) {
const person = familyData[personId];
if (!person) return;
@@ -759,6 +790,11 @@ function centerOnPersonAndDescendants(personId) {
// Initialize the family tree when the page loads
document.addEventListener('DOMContentLoaded', function() {
initializeFamilyTree();
+
+ // Start with first 5 generations by default
+ setTimeout(() => {
+ showGeneration('gen1-5');
+ }, 1000);
});