Options
All
  • Public
  • Public/Protected
  • All
Menu

The template link object.

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

let link = familyTree.template.link;

Hierarchy

  • LinkTemplate

Index

Properties

Methods

Properties

stroke?: string

The template link stroke color.

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

familyTree.template.link.stroke = "red";
strokeWidth?: number

The template link stroke width.

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

familyTree.template.link.strokeWidth = 3;

Methods

  • svg(link: Link): string
  • The template link object.

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

    familyTree.template.link.svg = function (link) {
    let strokeDasharray = '';
    let stroke = link.stroke;

    if (link.toNode.familyMember.flag) {
    strokeDasharray = 'stroke-dasharray="4"';
    stroke = 'blue';
    }

    return `<path ${strokeDasharray} style="fill: none; stroke: ${stroke}; stroke-width: ${link.strokeWidth}px;" marker-start="url(#rounded_start)" marker-end="url(#rounded_end)"></path>`;
    };

    Parameters

    • link: Link

    Returns string

Legend

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

Settings

Theme

Generated using TypeDoc