Add simple tree graph mode #4
@ -25,7 +25,7 @@ const SPOUSE_SPACING = 10;
|
||||
/**
|
||||
* Space between two siblings hierachy
|
||||
*/
|
||||
const SIBLINGS_SPACING = 20;
|
||||
const SIBLINGS_SPACING = 10;
|
||||
|
||||
/**
|
||||
* Vertical space between two generations
|
||||
@ -111,7 +111,6 @@ function buildSimpleDownTreeNode(
|
||||
let levelWidth: number;
|
||||
if (node.spouse) {
|
||||
levelWidth =
|
||||
CARD_SPACING +
|
||||
SPOUSE_SPACING +
|
||||
2 *
|
||||
Math.max(
|
||||
@ -119,7 +118,7 @@ function buildSimpleDownTreeNode(
|
||||
memberCardWidth(node.spouse.member)
|
||||
);
|
||||
} else {
|
||||
levelWidth = memberCardWidth(node.member) + CARD_SPACING;
|
||||
levelWidth = memberCardWidth(node.member);
|
||||
}
|
||||
|
||||
// Compute down level width
|
||||
@ -217,6 +216,10 @@ function NodeArea(p: {
|
||||
parent_x_offset + Math.floor(memberCardWidth(p.node.member) / 2);
|
||||
let parentLinkY = p.y;
|
||||
|
||||
// Remove ugly little shifts
|
||||
if (Math.abs(parentLinkX - (p.childrenLinkDestX ?? 0)) < 10)
|
||||
parentLinkX = p.childrenLinkDestX!;
|
||||
|
||||
let childrenLinkX: number;
|
||||
let childrenLinkY: number;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user