diff --git a/frontend/src/components/galaxy/__snapshots__/archetypes/belle-famille.txt b/frontend/src/components/galaxy/__snapshots__/archetypes/belle-famille.txt index a30461b..7eac907 100644 --- a/frontend/src/components/galaxy/__snapshots__/archetypes/belle-famille.txt +++ b/frontend/src/components/galaxy/__snapshots__/archetypes/belle-famille.txt @@ -2,12 +2,12 @@ │ ┬────┴ │ - SP────•───SM Pa────•───Ma - │ │ - ┬────────┼────────────────┬ ┼────────┬ - │ │ │ │ │ -S2 S3 S────•────E E2 - │ - ┬───┴────┬ - │ │ - K1 K2 + SP────•───SM Pa────•───Ma + │ │ + ┬────────┼────────┬ ┼────────┬ + │ │ │ │ │ +S2 S3 S────•────E E2 + │ + ┬───┴────┬ + │ │ + K1 K2 diff --git a/frontend/src/components/galaxy/__snapshots__/archetypes/branche-courte.txt b/frontend/src/components/galaxy/__snapshots__/archetypes/branche-courte.txt index b7ab9be..ca6f5cf 100644 --- a/frontend/src/components/galaxy/__snapshots__/archetypes/branche-courte.txt +++ b/frontend/src/components/galaxy/__snapshots__/archetypes/branche-courte.txt @@ -10,12 +10,12 @@ A2────•───A2w │ ┬────┴ │ -A3────•───A3w B0────•───B0w - │ │ - ┬────┴ ┬────────────────┴────┬ - │ │ │ - X────•────Y S - │ - ┼ - │ - K +A3────•───A3w B0────•───B0w + │ │ + ┴─┬ ┬──────┴────┬ + │ │ │ + X────•────Y S + │ + ┼ + │ + K diff --git a/frontend/src/components/galaxy/__snapshots__/archetypes/issue-67.txt b/frontend/src/components/galaxy/__snapshots__/archetypes/issue-67.txt index 0b726fb..a2207d7 100644 --- a/frontend/src/components/galaxy/__snapshots__/archetypes/issue-67.txt +++ b/frontend/src/components/galaxy/__snapshots__/archetypes/issue-67.txt @@ -2,16 +2,16 @@ GGGa───•──GGGb │ ┬────┴ │ - GGa───•───GGb GGy┄┄┄•┄┄? GGx┄┄┄┄•┄┄? - │ │ │ - ┬────┴ ┬──────┴ ┬─────────────────┴ - │ │ │ - GM1───•───GF1 GM2───•───GF2 - │ │ - ┬────┴ ┬────────────────┴ - │ │ - M────•────F - │ - ┼ - │ - Kid + GGa───•───GGb GGy┄┄┄•┄┄┄? GGx┄┄┄┄•┄┄? + │ │ │ + ┬┴ ┬┴ ┬──────┴ + │ │ │ + GM1───•───GF1 GM2────•───GF2 + │ │ + ┴─┬ ┬──────┴ + │ │ + M─────•────F + │ + ┼ + │ + Kid diff --git a/frontend/src/components/galaxy/__snapshots__/archetypes/marc-nadia.txt b/frontend/src/components/galaxy/__snapshots__/archetypes/marc-nadia.txt index 1600f85..800b0fd 100644 --- a/frontend/src/components/galaxy/__snapshots__/archetypes/marc-nadia.txt +++ b/frontend/src/components/galaxy/__snapshots__/archetypes/marc-nadia.txt @@ -1,9 +1,9 @@ - Pierre───•──Odile Louis──•─Helene - │ │ - ┬────────┬────┴───┬────────────┬ ┬────────┬───┴────┬────────┬────────┬ - │ │ │ │ │ │ │ │ │ -Luc Paul Mireil Nadia──•──Marc Claire Julien Sophie Eric - │ - ┼ - │ - Anais + Pierre───•──Odile Louis──•─Helene + │ │ + ┬────────┬────┴───┬────────┬ ┬────────┬───┴────┬────────┬────────┬ + │ │ │ │ │ │ │ │ │ +Luc Paul Mireil Nadia──•──Marc Claire Julien Sophie Eric + │ + ┼ + │ + Anais diff --git a/frontend/src/components/galaxy/__snapshots__/archetypes/trois-belles-familles.txt b/frontend/src/components/galaxy/__snapshots__/archetypes/trois-belles-familles.txt index 395b0ad..922ee73 100644 --- a/frontend/src/components/galaxy/__snapshots__/archetypes/trois-belles-familles.txt +++ b/frontend/src/components/galaxy/__snapshots__/archetypes/trois-belles-familles.txt @@ -1,9 +1,9 @@ -A────•───Aw B────•───Bw C────•───Cw - │ │ │ - ┬───┴────────────────┬ ┬────┴───┬ ┬────────────────┴ - │ │ │ │ │ -A2 A1────•───B1 B2─────•───C1 - │ │ - ┼ ┼ - │ │ - X Y +A────•───Aw B────•───Bw C────•───Cw + │ │ │ + ┬───┴──────┬ ┬────┴───┬ ┬──────┴ + │ │ │ │ │ +A2 A1────•───B1 B2────•───C1 + │ │ + ┼ ┼ + │ │ + X Y diff --git a/frontend/src/components/galaxy/blockLayout.js b/frontend/src/components/galaxy/blockLayout.js index 2e93517..5ce9f1f 100644 --- a/frontend/src/components/galaxy/blockLayout.js +++ b/frontend/src/components/galaxy/blockLayout.js @@ -349,7 +349,9 @@ function layoutOnce(graphData, referenceId, forcedSide, familyTabs = true) { // Belle-famille en construction : une chaîne dont aucun membre du sang n'est enfant de cette union, mais // dont un membre du sang a ses parents ailleurs, ira sous ces parents-là (le sang de la référence gagne) const duSang = anchor && !kc.some(id => blood.has(id) && parentUnionOf.get(id) === unionId) && kc.some(id => blood.has(id) && byId.get(id)._type === 'person' && parentUnionOf.has(id)) - if (placed.has(kc) || tabOfChain.has(kc) || duSang) { + // Un enfant parti dans un onglet ne laisse pas de place vide : ses parents se centrent sur les enfants dessinés + if (tabOfChain.has(kc)) return + if (placed.has(kc) || duSang) { external.push({ kid, unionId }) externalEdges.add(`${unionId}>${kid}`) childBlocks.push({ ...ghostBlock(kid), unionId }) @@ -547,8 +549,10 @@ function layoutOnce(graphData, referenceId, forcedSide, familyTabs = true) { } // Sur un remariage où l'enfant de la lignée est à un bout, seule sa moitié est réservée : au-dessus des // ex-conjoints, la carte ou la famille du conjoint peut se poser. + // Seule la moitié de l'enfant de la lignée est réservée pour ses parents : au-dessus du conjoint, ses propres + // parents peuvent se poser (Patch, 20/10 : « Louis et Joséphine devraient être au-dessus de Victor ») const parentsSpan = (rx) => { - if (chain.length > 3 && kidOfChain) { + if (kidOfChain && (chain.indexOf(kidOfChain) === 0 || chain.indexOf(kidOfChain) === chain.length - 1)) { const k = rx + offsets.get(kidOfChain) return chain.indexOf(kidOfChain) === 0 ? [rx - FAMILY_GAP, k + byId.get(kidOfChain).width + FAMILY_GAP] : [k - FAMILY_GAP, rx + rowW + FAMILY_GAP] }