@benportner/js_family_tree
    Preparing search index...

    Interface ClickableNode

    Extends GraphNode with additional properties and methods for interactive family tree visualization. ClickableNode instances represent nodes in the graph that can be expanded, collapsed, and interacted with. In an ideal world, this would be a class definition. Unfortunately, d3-dag doesn't do classes, so we're stuck with this ugly hack. We extend d3-dag's node definition with custom methods and properties by using JavaScript's prototype augmentation feature (see augmentD3DAGNodeClass).

    interface ClickableNode {
        data: NodeData;
        extendable: boolean;
        insertedNodes: ClickableNode[];
        invisibleNeighbors: ClickableNode[];
        isPerson: boolean;
        isUnion: boolean;
        neighbors: ClickableNode[];
        visibleChildren: ClickableNode[];
        visibleNeighbors: ClickableNode[];
        visibleParents: ClickableNode[];
        visiblePartners: ClickableNode[];
        children(): IterableIterator<GraphNode>;
        click(): void;
        hideNeighbors(resetInsertedNodes: boolean): void;
        parents(): IterableIterator<GraphNode>;
        showNeighbors(addInsertedNodes: boolean): void;
        visibleParentIDs(): string[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    data: NodeData
    extendable: boolean

    True if this node can be expanded to show more neighbors.

    insertedNodes: ClickableNode[]

    Nodes that were inserted by expanding this node.

    invisibleNeighbors: ClickableNode[]

    All invisible neighboring nodes (upstream and downstream). Will be unions if called on a person. Will be persons if called on a union.

    isPerson: boolean

    True if this node represents a person.

    isUnion: boolean

    True if this node represents a union (family).

    neighbors: ClickableNode[]

    All neighboring nodes (upstream and downstream).

    visibleChildren: ClickableNode[]

    All visible downstream nodes. Will be unions if called on a person. Will be persons if called on a union.

    visibleNeighbors: ClickableNode[]

    All visible neighboring nodes (upstream and downstream). Will be unions if called on a person. Will be persons if called on a union.

    visibleParents: ClickableNode[]

    All visible upstream nodes. Will be unions if called on a person. Will be persons if called on a union.

    visiblePartners: ClickableNode[]

    All visible partner nodes (other parents of shared children). Will always be persons.

    Methods

    • Handles a click event on this node, toggling expansion/collapse.

      Returns void

    • Collapses this node, hiding its neighbors and previously inserted nodes.

      Parameters

      • resetInsertedNodes: boolean

        If true, resets the insertedBy property of hidden neighbors.

      Returns void

    • Expands this node to show its neighbors and previously inserted nodes.

      Parameters

      • addInsertedNodes: boolean

        If true, marks newly visible neighbors as inserted by this node.

      Returns void

    • Returns the IDs of all visible parent nodes.

      Returns string[]