diff --git a/geneit_app/src/widgets/simple_family_tree/SimpleFamilyTree.tsx b/geneit_app/src/widgets/simple_family_tree/SimpleFamilyTree.tsx index 88e7eac..e3de815 100644 --- a/geneit_app/src/widgets/simple_family_tree/SimpleFamilyTree.tsx +++ b/geneit_app/src/widgets/simple_family_tree/SimpleFamilyTree.tsx @@ -6,12 +6,30 @@ import { getTextWidth } from "../../utils/render_utils"; const FACE_WIDTH = 60; const FACE_HEIGHT = 70; + +/** + * Vertical space between faces and text + */ const FACE_TEXT_SPACING = 2; +/** + * Cards height + */ const CARD_HEIGHT = 103; + +/** + * Space between spouse cards + */ const SPOUSE_SPACING = 10; -const CARD_SPACING = 20; + +/** + * Space between two siblings hierachy + */ const SIBLINGS_SPACING = 20; + +/** + * Vertical space between two generations + */ const LEVEL_SPACING = 25; const NAME_FONT = "13px Roboto"; @@ -106,7 +124,8 @@ function buildSimpleDownTreeNode( // Compute down level width const downWidth = - SIBLINGS_SPACING * node.down.length + + SIBLINGS_SPACING * node.down.length - + SIBLINGS_SPACING + node.down.reduce((prev, n) => prev + n.width, 0); node.parentWidth = levelWidth;