Options
All
  • Public
  • Public/Protected
  • All
Menu

The Node object.

Basic usage:

let node = familyTree.getNode(2);

Full example:

let familyTree = new FamilyTree2(document.getElementById('tree'));

familyTree.onLoaded(() => {
let node = familyTree.getNode(2);
//...
});

familyTree.addFamilyMembers([
{ id: 1, spouseIds: [2], childIds: [3, 4] },
{ id: 2, childIds: [3, 4] },
{ id: 3 },
{ id: 4 }
]).draw(1);

Hierarchy

  • Node

Index

Properties

bottom: number

The bottom Y point of the node.

let bottom = node.bottom;
children: (string | number)[]

Node children ids

let children = node.children;
collapsedChildren: (string | number)[]

Collpased children ids

let collapsedChildren = node.collapsedChildren;
collapsedParents: (string | number)[]

The collpased parens of the node

let collapsedParents = node.collapsedParents;
collapsedSiblings: (string | number)[]

Collpased siblings ids

let collapsedSiblings = node.collapsedSiblings;
collapsedSpouses: (string | number)[]

Collpased spouses ids

let collapsedSpouses = node.collapsedSpouses;
element: HTMLElement

The HTML element of the node

let element = node.element;
familyMember: FamilyMember

The family tree data of the node

let familyMember = node.familyMember;
fatherId: string | number

Node father id

let fatherId = node.fatherId;
height: number

The height of the node.

let height = node.height;
id: string | number

The id of the node

let id = node.id;
isStepParent: boolean

True if it is step parent

let isStepParent = node.isStepParent;
isUnmarriedPartner: boolean

True if it is unmarried partner

let isUnmarriedPartner = node.isUnmarriedPartner;
left: number

The left X point of the node.

let left = node.left;
level: number

The node level

let level = node.level;
linkToChildrenIndex: number

Link position in order the link to not overlap

let linkToChildrenIndex = node.linkToChildrenIndex;
linkToParentsIndex: number

Link position in order the link to not overlap

let linkToParentsIndex = node.linkToParentsIndex;
motherId: string | number

Node mother id

let motherId = node.motherId;
nonDottedId: string | number
parents: (string | number)[]

Node parents

let parents = node.parents;
relationshipType: string

The relationship type of the node

let relationshipType = node.relationshipType;
right: number

The right X point of the node.

let right = node.right;
selected: boolean

True if the node is selected

let selected = node.selected;
siblings: (string | number)[]

Node siblings ids

let siblings = node.siblings;
spouses: (string | number)[]

Node spouses ids

let spouses = node.spouses;
stroke: string

The stroke color of the node

let stroke = node.stroke;
strokeWidth: number

The stroke width of the node

let strokeWidth = node.strokeWidth;
templateId: string

The template id of the node (depending on the relationship type)

let templateId = node.templateId;
top: number

The top Y point of the node.

let top = node.top;
width: number

The width of the node.

let width = node.width;

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Static method

Settings

Theme

Generated using TypeDoc