├── README.md
├── bower.json
├── familytree.d.ts
├── familytree.js
└── package.json
/README.md:
--------------------------------------------------------------------------------
1 | #  FamilyTree JS
2 | Build family tree app with BALKAN FamilyTree JS JavaScript library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
3 |
4 | 
5 |
6 |
7 | ## [Demos](https://balkan.app/FamilyTreeJS/Demos/BasicUsage) [Docs](https://balkan.app/FamilyTreeJS/Docs/GettingStarted) [Download](https://balkan.app/FamilyTreeJS/Download) [Support](https://balkan.app/FamilyTreeJS/Support)
8 |
9 | ## Features
10 | - Supports both local data and remote data (JSON)
11 | - Smooth expand/collapse effects
12 | - Align the chart in 8 orientations
13 | - Supports pan and zoom
14 | - Edit Form
15 | - Node Customization
16 | - Search
17 | - Scroll Bars
18 | - Lazy Loading
19 | - Exporting
20 |
21 | ## Installation
22 | Option 1 - [standalone build](https://balkan.app/FamilyTreeJS/Docs/GettingStarted)
23 |
24 | Option 2 - NPM
25 | ```
26 | npm i @balkangraph/familytree.js
27 | ```
28 |
29 | Option 3 - Bower
30 | ```
31 | bower install familytree.js
32 | ```
33 |
34 |
35 | ## Usage
36 | ```
37 |
38 |
39 |
51 | ```
52 |
53 | ## 1 click to talk 2 us
54 |
55 | [](https://webcall.me/BALKANGraph)
56 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "familytree.js",
3 | "authors": [
4 | "BALKAN App"
5 | ],
6 | "description": "FamilyTree JS is a simple, flexible and highly customizable origami JavaScript library.",
7 | "main": "familytree.js",
8 | "keywords": [
9 | "tree",
10 | "family tree",
11 | "origami",
12 | "hierarchy"
13 | ],
14 | "license": "MIT",
15 | "homepage": "https://balkangraph.com"
16 | }
--------------------------------------------------------------------------------
/familytree.d.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 | declare class FamilyTree {
4 |
5 | static icon: {
6 | png: (w: string| number, h: string | number, c: string) => string,
7 | pdf: (w: string | number| number, h: string | number, c: string) => string,
8 | svg: (w: string| number, h: string| number, c: string | number) => string,
9 | csv: (w: string| number, h: string| number, c: string| number) => string,
10 | excel: (w: string| number, h: string| number, c: string| number) => string,
11 | edit: (w: string| number, h: string| number, c: string| number) => string,
12 | details: (w: string| number, h: string| number, c: string| number) => string,
13 | remove: (w: string| number, h: string| number, c: string| number) => string,
14 | add: (w: string| number, h: string| number, c: string| number) => string,
15 | xml: (w: string| number, h: string| number, c: string| number) => string,
16 | link: (w: string| number, h: string| number, c: string| number) => string,
17 | happy: (w: string| number, h: string| number, c: string| number) => string,
18 | sad: (w: string| number, h: string| number, c: string| number) => string,
19 | share: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
20 | user: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
21 | addUser: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
22 | close: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
23 | ft: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string
24 | }
25 |
26 | /**
27 | * Hides the tree menu
28 | * @param redraw
29 | * @param callback called at the end of the animation
30 | */
31 | hideTreeMenu(redraw: boolean, callback?: () => void): void;
32 |
33 | /**
34 | * Shows tree menu
35 | * @param id node id
36 | * @param callback called at the end of the animation
37 | */
38 | showTreeMenu(id: string | number, callback?: () => void): void;
39 |
40 |
41 | /**
42 | * Adds child
43 | * @param data child node data
44 | * @param callback called at the end of the animation
45 | * @param fireEvent indicates if the update event will be called or not
46 | * {@link https://balkan.app/FamilyTreeJS/Docs/CreateProgrammatically | See doc...}
47 | */
48 | addChildNode(data: object, callback?: () => void, fireEvent?: boolean): void;
49 |
50 |
51 | /**
52 | * Adds child and partner
53 | * @param id id of the existing partner node
54 | * @param childData child data
55 | * @param partnerData partner data
56 | * @param callback called at the end of the animation
57 | * @param fireEvent indicates if the update event will be called or not
58 | * {@link https://balkan.app/FamilyTreeJS/Docs/CreateProgrammatically | See doc...}
59 | */
60 | addChildAndPartnerNodes(id: string | number, childData: object, partnerData: object, callback?: () => void, fireEvent?: boolean): void;
61 |
62 | /**
63 | *
64 | * @param id id of the existing partner node
65 | * @param childIds ids of the child nodes
66 | * @param partnerData partner data
67 | * @param callback called at the end of the animation
68 | * @param fireEvent indicates if the update event will be called or not
69 | * {@link https://balkan.app/FamilyTreeJS/Docs/CreateProgrammatically | See doc...}
70 | */
71 | addPartnerAndParentNodes(id: string | number, childIds: Array, partnerData: object, callback?: () => void, fireEvent?: boolean): void;
72 |
73 |
74 | /**
75 | * Adds partner node
76 | *
77 | * data.pids partner id should be an existing id
78 | * @param data new added partner data
79 | * @param callback called at the end of the animation
80 | * @param fireEvent indicates if the update event will be called or not
81 | * {@link https://balkan.app/FamilyTreeJS/Docs/CreateProgrammatically | See doc...}
82 | */
83 | addPartnerNode(data: object, callback?: () => void, fireEvent?: boolean): void;
84 |
85 |
86 | /**
87 | * Adds parrent
88 | * @param childId node child id
89 | * @param type mother or father
90 | * @param data new added parent data
91 | * @param callback called at the end of the animation
92 | * @param fireEvent indicates if the update event will be called or not
93 | * {@link https://balkan.app/FamilyTreeJS/Docs/CreateProgrammatically | See doc...}
94 | */
95 | addParentNode(childId:number | string, type: 'mid' | 'fid', data:object, callback?: () => void, fireEvent?: boolean): void;
96 |
97 |
98 | /**
99 | * Removes node if the node can be removed
100 | * @param id node id to be removed
101 | * @param callback called at the end of the animation
102 | * @param fireEvent indicates if the update event will be called or not
103 | * {@link https://balkan.app/FamilyTreeJS/Docs/CreateProgrammatically | See doc...}
104 | */
105 | removeNode(id:number | string, callback?: () => void, fireEvent?: boolean): void;
106 |
107 | /**
108 | * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
109 | * @category Event Listeners
110 | * @param type A case-sensitive string representing the event type to listen for.
111 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
112 | */
113 | on(type: "init" | "node-tree-menu-show" | "field" | "update" | "renderbuttons" | "label" | "render-link" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "node-layout", listener: (sender: FamilyTree, args?: any, args1?: any, args2?: any) => void | boolean): FamilyTree;
114 |
115 | /**
116 | * Removes an event listener previously registered. The event listener to be removed is identified using a combination of the event type and the event listener function itself. Returns true if success and false if fail.
117 | * @param type A string which specifies the type of event for which to remove an event listener
118 | * @param listener The event listener function of the event handler to remove from the event target
119 | */
120 |
121 | removeListener(type: "init" | "node-tree-menu-show" | "field" | "update" | "renderbuttons" | "label" | "render-link" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "removed" | "ready" | "ripple" | "node-initialized" | "node-layout", listener?: () => void): boolean;
122 |
123 | /**
124 | * Occurs when the node data has been updated, removed or added.
125 | * ```typescript
126 | * var family = new FamilyTree('#tree', {});
127 | * family.onUpdateNode((args) => {
128 | * //return false; to cancel the operation
129 | * });
130 | * ```
131 | * @category Event Listeners
132 | * @param listener
133 | */
134 | onUpdateNode(listener: (this: FamilyTree, args: {
135 | addNodesData: Array