From f86cf3b887d87106dd4bd1128304bd0986c18607 Mon Sep 17 00:00:00 2001 From: gbanyan Date: Tue, 16 Dec 2025 11:18:50 +0800 Subject: [PATCH] Adjust the label a little --- src/components/PedigreeCanvas/hooks/useD3Pedigree.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/PedigreeCanvas/hooks/useD3Pedigree.ts b/src/components/PedigreeCanvas/hooks/useD3Pedigree.ts index 1b51991..bc73f14 100644 --- a/src/components/PedigreeCanvas/hooks/useD3Pedigree.ts +++ b/src/components/PedigreeCanvas/hooks/useD3Pedigree.ts @@ -446,13 +446,15 @@ function renderPersons( .attr('fill', 'none'); } - // Label + // Label (positioned below connection lines) + // Vertical lines to children end at childY - halfSymbol = parentY + verticalSpacing - 20 = parentY + 80 + // So label must be > 80 to avoid overlap. Using 85. if (options.showLabels && person.metadata.label) { personGroup .append('text') .attr('class', 'person-label') .attr('x', 0) - .attr('y', options.symbolSize / 2 + 15) + .attr('y', options.symbolSize / 2 + 65) .attr('text-anchor', 'middle') .attr('font-size', '12px') .attr('font-family', 'sans-serif') @@ -465,7 +467,7 @@ function renderPersons( .append('text') .attr('class', 'person-id') .attr('x', 0) - .attr('y', options.symbolSize / 2 + 15) + .attr('y', options.symbolSize / 2 + 65) .attr('text-anchor', 'middle') .attr('font-size', '11px') .attr('font-family', 'sans-serif')