Agent Skill
2/7/2026

balkan-family-tree

Comprehensive skill for working with Balkan Family Tree JS libraries (V1 and V2). Use when creating family tree visualizations, genealogy applications, org charts with family relationships, or when migrating between library versions. Covers initialization, data structures, templates, events, node manipulation, and V1→V2 migration patterns.

V
viascopi
0GitHub Stars
1Views
npx skills add ViaScopi/balkan-family-tree-plugin

SKILL.md

Namebalkan-family-tree
DescriptionComprehensive skill for working with Balkan Family Tree JS libraries (V1 and V2). Use when creating family tree visualizations, genealogy applications, org charts with family relationships, or when migrating between library versions. Covers initialization, data structures, templates, events, node manipulation, and V1→V2 migration patterns.

name: balkan-family-tree description: Comprehensive skill for working with Balkan Family Tree JS libraries (V1 and V2). Use when creating family tree visualizations, genealogy applications, org charts with family relationships, or when migrating between library versions. Covers initialization, data structures, templates, events, node manipulation, and V1→V2 migration patterns. license: MIT - See LICENSE file

Balkan Family Tree JS

Interactive family tree visualization library. Two major versions exist with different APIs.

Version Selection

Choose V2 when...Choose V1 when...
Starting new projectMaintaining existing V1 codebase
Need latest featuresNeed V1-specific integrations
Modern API preferredBackward compatibility required

Quick Reference

V2 (Recommended for new projects)

<script src="https://balkan.app/js/familytree.js"></script>
<div id="tree"></div>
<script>
var family = new FamilyTree(document.getElementById("tree"), {
    nodeBinding: {
        field_0: "name",
        img_0: "img"
    },
    nodes: [
        { id: 1, pids: [2], name: "Amber McKenzie", gender: "female", img: "photo.jpg" },
        { id: 2, pids: [1], name: "Ava Field", gender: "male", img: "photo2.jpg" },
        { id: 3, mid: 1, fid: 2, name: "Peter Stevens", gender: "male" }
    ]
});
</script>

V1 (Legacy)

<script src="https://balkan.app/js/FamilyTree.js"></script>
<div id="tree"></div>
<script>
var family = new FamilyTree(document.getElementById("tree"), {
    template: "john",
    nodeBinding: {
        field_0: "name"
    }
});
family.load([
    { id: 1, pids: [2], name: "Amber" },
    { id: 2, pids: [1], name: "Ava" },
    { id: 3, mid: 1, fid: 2, name: "Peter" }
]);
</script>

Core Data Structure (Both Versions)

{
    id: Number|String,      // Unique identifier (required)
    pids: Array,            // Partner IDs
    mid: Number|String,     // Mother ID
    fid: Number|String,     // Father ID
    name: String,           // Display name
    gender: "male"|"female",
    img: String,            // Photo URL
    // Custom fields allowed
}

Detailed Documentation

Common Tasks

Adding Nodes Programmatically

V2:

family.addNode({ id: 4, mid: 1, fid: 2, name: "New Child", gender: "female" });

V1:

family.add({ id: 4, mid: 1, fid: 2, name: "New Child" });

Handling Events

V2:

family.onNodeClick((args) => {
    console.log("Clicked:", args.node);
});

V1:

family.on("click", function(sender, args) {
    console.log("Clicked:", args.node);
});

Exporting

V2:

family.exportPDF();
family.exportPNG();
family.exportSVG();

V1:

FamilyTree.pdfPrevUI.show(family, { format: "A4" });
FamilyTree.exportPNG(family, {});

Workflow

  1. New Project: Read references/v2-guide.md → implement with V2 API
  2. Existing V1 Project: Read references/v1-guide.md → maintain with V1 API
  3. Migration: Read references/migration-v1-to-v2.md → convert systematically
Skills Info
Original Name:balkan-family-treeAuthor:viascopi