├── bower.json
├── package.json
├── README.md
└── orgchart.d.ts
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "orgchart.js",
3 | "authors": [
4 | "BALKAN App"
5 | ],
6 | "description": "OrgChart JS is a simple, flexible and highly customizable organization chart plugin.",
7 | "main": "orgchart.js",
8 | "keywords": [
9 | "diagram",
10 | "chart",
11 | "tree",
12 | "orgchart",
13 | "graph",
14 | "svg",
15 | "hierarchy",
16 | "family-tree",
17 | "decision-tree",
18 | "visualization",
19 | "tree-layout",
20 | "hierarchical",
21 | "javascript",
22 | "js",
23 | "html",
24 | "html5"
25 | ],
26 | "license": "MIT",
27 | "homepage": "https://balkan.app"
28 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {"author":{"name":"BALKAN App"},"bugs":{"email":"support@balkan.app","url":"https://github.com/BALKANGraph/OrgChartJS/issues"},"deprecated":false,"description":"Ultimate Organizational Chart JavaScript library, Interactive Diagrams","files":["orgchart.js","orgchart.d.ts","package.json","README.md"],"homepage":"https://balkan.app/","keywords":["diagram","chart","tree","orgchart","graph","svg","hierarchy","family-tree","decision-tree","visualization","tree-layout","hierarchical","javascript","js","html","html5"],"license":"SEE LICENSE IN https://balkan.app","main":"orgchart.js","types":"orgchart.d.ts","name":"@balkangraph/orgchart.js","repository":{"type":"git","url":"https://github.com/BALKANGraph/OrgChartJS"},"dependencies":{},"version":"9.00.03"}
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #  OrgChart JS
2 | Build organizational chart app with BALKAN OrgChart JS JavaScript library. **OrgChart JS** is a simple, flexible and highly customizable organization chart plugin for presenting the structure of your organization and the relationships in an elegant way.
3 |
4 | 
5 |
6 | ## [Demos](https://balkan.app/OrgChartJS/Demos/BasicUsage) [Docs](https://balkan.app/OrgChartJS/Docs/GettingStarted) [Download](https://balkan.app/OrgChartJS/Download) [Support](https://balkan.app/OrgChartJS/Support)
7 |
8 | ## Features
9 | - Supports both local data and remote data (JSON)
10 | - Smooth expand/collapse effects
11 | - Align the chart in 8 orientations
12 | - Allows user to change orgchart structure by drag/drop nodes
13 | - Supports pan and zoom
14 | - Edit Form
15 | - Node Customization
16 | - Search
17 | - Scroll Bars
18 | - Lazy Loading
19 | - Mixed Hierarchy
20 | - Exporting
21 | - Assistant
22 | - Partners
23 | - Sub Trees
24 | - Family Tree
25 |
26 | ## Installation
27 | Option 1 - [standalone build](https://balkan.app/OrgChartJS/Docs/GettingStarted)
28 |
29 | Option 2 - NPM
30 | ```
31 | npm i @balkangraph/orgchart.js
32 | ```
33 |
34 | Option 3 - Bower
35 | ```
36 | bower install orgchart.js
37 | ```
38 |
39 |
40 | ## Usage
41 | ```
42 |
43 |
44 |
56 | ```
57 |
58 |
59 | ## 1 click to talk 2 us
60 |
61 | [](https://webcall.me/BALKANGraph)
62 |
--------------------------------------------------------------------------------
/orgchart.d.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | /**
5 | * ```typescript
6 | *
7 | *
8 | *
9 | *
10 | *
11 | * OrgChartJS
12 | *
16 | *
17 | *
18 | *
19 | *
20 | *
32 | *
33 | *
34 | * ```
35 | */
36 | declare class OrgChart {
37 | /**
38 | * ```typescript
39 | * let chart = new OrgChart('#tree', {});
40 | * ```
41 | * @param element HTML element or string selector for example '#tree'
42 | * @param options configuration options
43 | */
44 | constructor(element?: HTMLElement | string, options?: OrgChart.options);
45 |
46 |
47 | /**
48 | * SVG icons
49 | * @param w - width
50 | * @param h - height
51 | * @param c - color
52 | * @param x - X position
53 | * @param y - Y position
54 | * @returns string with the SVG definition
55 | */
56 | static icon: {
57 | /**
58 | * ```typescript
59 | * let pngIcon = OrgChart.icon.png(24, 24, "#7A7A7A");
60 | * ```
61 | */
62 | png: (w: string| number, h: string | number, c: string) => string,
63 | /**
64 | * ```typescript
65 | * let pdfIcon = OrgChart.icon.pdf(24, 24, "#7A7A7A");
66 | * ```
67 | */
68 | pdf: (w: string | number, h: string | number, c: string) => string,
69 | /**
70 | * ```typescript
71 | * let svgIcon = OrgChart.icon.svg(24, 24, "#7A7A7A");
72 | * ```
73 | */
74 | svg: (w: string| number, h: string| number, c: string | number) => string,
75 | /**
76 | * ```typescript
77 | * let csvIcon = OrgChart.icon.csv(24, 24, "#7A7A7A");
78 | * ```
79 | */
80 | csv: (w: string| number, h: string| number, c: string| number) => string,
81 | /**
82 | * ```typescript
83 | * let excelIcon = OrgChart.icon.excel(24, 24, "#7A7A7A");
84 | * ```
85 | */
86 | excel: (w: string| number, h: string| number, c: string| number) => string,
87 | /**
88 | * ```typescript
89 | * let powerPointIcon = OrgChart.icon.powerpoint(24, 24, "#7A7A7A");
90 | * ```
91 | */
92 | powerpoint: (w: string| number, h: string| number, c: string| number) => string,
93 | /**
94 | * ```typescript
95 | * let powerPointPreviewIcon = OrgChart.icon.pppreview(24, 24, "#7A7A7A");
96 | * ```
97 | */
98 | pppreview: (w: string| number, h: string| number, c: string| number) => string,
99 | /**
100 | * ```typescript
101 | * let editIcon = OrgChart.icon.edit(24, 24, "#7A7A7A");
102 | * ```
103 | */
104 | edit: (w: string| number, h: string| number, c: string| number) => string,
105 | /**
106 | * ```typescript
107 | * let detailsIcon = OrgChart.icon.details(24, 24, "#7A7A7A");
108 | * ```
109 | */
110 | details: (w: string| number, h: string| number, c: string| number) => string,
111 | /**
112 | * ```typescript
113 | * let removeIcon = OrgChart.icon.remove(24, 24, "#7A7A7A");
114 | * ```
115 | */
116 | remove: (w: string| number, h: string| number, c: string| number) => string,
117 | /**
118 | * ```typescript
119 | * let addIcon = OrgChart.icon.add(24, 24, "#7A7A7A");
120 | * ```
121 | */
122 | add: (w: string| number, h: string| number, c: string| number) => string,
123 | /**
124 | * ```typescript
125 | * let xmlIcon = OrgChart.icon.xml(24, 24, "#7A7A7A");
126 | * ```
127 | */
128 | xml: (w: string| number, h: string| number, c: string| number) => string,
129 | /**
130 | * ```typescript
131 | * let visioIcon = OrgChart.icon.visio(24, 24, "#7A7A7A");
132 | * ```
133 | */
134 | visio: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
135 | /**
136 | * ```typescript
137 | * let linkIcon = OrgChart.icon.link(24, 24, "#7A7A7A");
138 | * ```
139 | */
140 | link: (w: string| number, h: string| number, c: string| number) => string,
141 | /**
142 | * ```typescript
143 | * let happyIcon = OrgChart.icon.happy(24, 24, "#7A7A7A");
144 | * ```
145 | */
146 | happy: (w: string| number, h: string| number, c: string| number) => string,
147 | /**
148 | * ```typescript
149 | * let sadIcon = OrgChart.icon.sad(24, 24, "#7A7A7A");
150 | * ```
151 | */
152 | sad: (w: string| number, h: string| number, c: string| number) => string,
153 | /**
154 | * ```typescript
155 | * let shareIcon = OrgChart.icon.share(24, 24, "#7A7A7A");
156 | * ```
157 | */
158 | share: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
159 | /**
160 | * ```typescript
161 | * let userIcon = OrgChart.icon.user(24, 24, "#7A7A7A");
162 | * ```
163 | */
164 | user: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
165 | /**
166 | * ```typescript
167 | * let undoIcon = OrgChart.icon.undo(24, 24, "#7A7A7A");
168 | * ```
169 | */
170 | undo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
171 | /**
172 | * ```typescript
173 | * let redoIcon = OrgChart.icon.redo(24, 24, "#7A7A7A");
174 | * ```
175 | */
176 | redo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
177 |
178 |
179 | /**
180 | * ```typescript
181 | * let fitIcon = OrgChart.icon.fit(24, 24, "#7A7A7A");
182 | * ```
183 | */
184 | fit: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
185 |
186 |
187 | /**
188 | * ```typescript
189 | * let expand_allIcon = OrgChart.icon.expand_all(24, 24, "#7A7A7A");
190 | * ```
191 | */
192 | expand_all: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
193 |
194 | /**
195 | * ```typescript
196 | * let full_screenIcon = OrgChart.icon.full_screen(24, 24, "#7A7A7A");
197 | * ```
198 | */
199 | full_screen: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
200 | /**
201 | * ```typescript
202 | * let zoom_inIcon = OrgChart.icon.zoom_in(24, 24, "#7A7A7A");
203 | * ```
204 | */
205 | zoom_in: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
206 | /**
207 | * ```typescript
208 | * let zoom_outIcon = OrgChart.icon.zoom_out(24, 24, "#7A7A7A");
209 | * ```
210 | */
211 | zoom_out: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
212 | /**
213 | * ```typescript
214 | * let layout_mixedIcon = OrgChart.icon.layout_mixed(24, 24, "#7A7A7A");
215 | * ```
216 | */
217 | layout_mixed: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
218 | /**
219 | * ```typescript
220 | * let layout_normalIcon = OrgChart.icon.layout_normal(24, 24, "#7A7A7A");
221 | * ```
222 | */
223 | layout_normal: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
224 | /**
225 | * ```typescript
226 | * let layout_right_offsetIcon = OrgChart.icon.layout_right_offset(24, 24, "#7A7A7A");
227 | * ```
228 | */
229 | layout_right_offset: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
230 | /**
231 | * ```typescript
232 | * let layout_left_offsetIcon = OrgChart.icon.layout_left_offset(24, 24, "#7A7A7A");
233 | * ```
234 | */
235 | layout_left_offset: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
236 | /**
237 | * ```typescript
238 | * let layout_treeIcon = OrgChart.icon.layout_tree(24, 24, "#7A7A7A");
239 | * ```
240 | */
241 | layout_tree: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
242 | /**
243 | * ```typescript
244 | * let layout_gridIcon = OrgChart.icon.layout_grid(24, 24, "#7A7A7A");
245 | * ```
246 | */
247 | layout_grid: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
248 | /**
249 | * ```typescript
250 | * let cursorIcon = OrgChart.icon.cursor(24, 24, "#7A7A7A");
251 | * ```
252 | */
253 | cursor: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string,
254 |
255 |
256 | }
257 |
258 |
259 |
260 | /**
261 | * Can update link (Does the node is dropping under itself)
262 | * ```typescript
263 | * let canDropTheNode = chart.canUpdateLink(draggedNodeId, droppedNodeId));
264 | * ```
265 | * @param id child id
266 | * @param pid parent id
267 | */
268 | canUpdateLink(id: string | number, pid: string | number): boolean;
269 |
270 |
271 | /**
272 | * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
273 | * ```typescript
274 | * let chart = new OrgChart('#tree', {});
275 | * chart.on('init', function () {
276 | * // console.log("initiated")
277 | * })
278 | * chart.load(nodes);
279 | * ```
280 | * @category Event Listeners
281 | * @param type A case-sensitive string representing the event type to listen for.
282 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
283 | */
284 | on(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener: (sender: OrgChart, args?: any, args1?: any, args2?: any) => void | boolean): OrgChart;
285 |
286 | /**
287 | * 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.
288 | * ```typescript
289 | * let chart = new OrgChart('#tree', {});
290 | * let listener = function(sender, args){
291 | * console.log(sender.removeListener('update', listener));
292 | * };
293 | * chart.on('update', listener);
294 | * chart.load(nodes)
295 | * ```
296 | };
297 |
298 | family.on('update', listener);
299 | * @param type A string which specifies the type of event for which to remove an event listener
300 | * @param listener The event listener function of the event handler to remove from the event target
301 | */
302 | removeListener(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener?: () => void): boolean;
303 |
304 |
305 | /**
306 | * Occurs when the node data has been updated by updateNode method.
307 | * ```typescript
308 | * var chart = new OrgChart('#tree', {});
309 | * chart.onUpdateNode((args) => {
310 | * //return false; to cancel the operation
311 | * });
312 | * ```
313 | * @category Event Listeners
314 | * @param listener
315 | */
316 | onUpdateNode(listener: (args: {
317 | /**
318 | * old node data
319 | */
320 | oldData: nodeData,
321 | /**
322 | * new node data
323 | */
324 | newData: nodeData
325 | }) => void): OrgChart;
326 |
327 | /**
328 | * Occurs when new nodes are added, removed, updated or imported, also when slink or clink is added or removed and after undo or redo operations.
329 | * Use this event listener to synch your server side database with this.config.nodes, this.config.clinks, this.config.slinks etc.
330 | * ```typescript
331 | * var chart = new OrgChart('#tree', {});
332 | * chart.onUpdated(() => {
333 | * //Update your server database with this.config.nodes, this.config.clinks, this.config.slinks etc.
334 | * });
335 | * ```
336 | * @category Event Listeners
337 | */
338 | onUpdated(): OrgChart;
339 |
340 |
341 | /**
342 | * Occurs when a node has been removed by removeNode method.
343 | * ```typescript
344 | * var chart = new OrgChart('#tree', {});
345 | * chart.onRemoveNode((args) => {
346 | * //return false; to cancel the operation
347 | * });
348 | * ```
349 | * @category Event Listeners
350 | * @param listener
351 | */
352 | onRemoveNode(listener: (args: {
353 | /**
354 | * node id
355 | */
356 | id: number | string,
357 | /**
358 | * parent ids and sub tree parents ids that needs to be updated on the server. For example if you remove a node that has children all chilren nodes will change their pid to the parent node id of the removed node.
359 | */
360 | newPidsAndStpidsForIds: {
361 | newPidsForIds: { [key in any]: string | number },
362 | newStpidsForIds: { [key in any]: string | number }
363 | }
364 | }) => void): OrgChart;
365 |
366 | /**
367 | * Occurs when a node has been added by addNode method.
368 | * ```typescript
369 | * var chart = new OrgChart('#tree', {});
370 | * chart.onAddNode((args) => {
371 | * //return false; to cancel the operation
372 | * });
373 | * ```
374 | * @category Event Listeners
375 | * @param listener
376 | */
377 | onAddNode(listener: (args: {
378 | /**
379 | * new added data node
380 | */
381 | data: nodeData
382 | }) => void): OrgChart;
383 | /**
384 | * The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
385 | * ```typescript
386 | * var chart = new OrgChart('#tree', {});
387 | * chart.onDrag(() => {
388 | * //return false; to cancel the operation
389 | * });
390 | * ```
391 | * @category Event Listeners
392 | * @param listener
393 | */
394 | onDrag(listener: (args: {
395 | /**
396 | * dragged node id
397 | */
398 | dragId: string | number,
399 | event: MouseEvent,
400 | /**
401 | * array of node ids
402 | *
403 | * this property is initialized only if movable option is set
404 | */
405 | nodeIds: Array
406 | }) => void): OrgChart;
407 | /**
408 | * The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
409 | * ```typescript
410 | * var chart = new OrgChart('#tree', {});
411 | * chart.onDrop(() => {
412 | * //return false; to cancel the operation
413 | * });
414 | * ```
415 | * @category Event Listeners
416 | * @param listener
417 | */
418 | onDrop(listener: (args: {
419 | /**
420 | * dragged node id
421 | */
422 | dragId: string | number,
423 | /**
424 | * dropped node id
425 | */
426 | dropId: string | number,
427 | /**
428 | * draging element
429 | */
430 | dragNodeElement: HTMLElement,
431 | /**
432 | * Mouse event
433 | */
434 | event: MouseEvent
435 | }) => void): OrgChart;
436 |
437 | /**
438 | * All chart nodes
439 | * ```typescript
440 | * let chart = new OrgChart('#tree', {});
441 | * chart.onInit(() => {
442 | * let nodes = chart.nodes;
443 | * });
444 | * chart.load(nodes)
445 | * ```
446 | */
447 | nodes: { [key in any]: OrgChart.node };
448 |
449 | /**
450 | * Returns true if chart is visible
451 | * ```typescript
452 | * let chart = new OrgChart('#tree', {});
453 | * chart.onInit(() => {
454 | * console.log(chart.isVisible);
455 | * });
456 | * chart.load(nodes)
457 | * ```
458 | */
459 | isVisible: boolean;
460 |
461 | /**
462 | * Returns the visible nodes ids
463 | * ```typescript
464 | * let chart = new OrgChart('#tree', {});
465 | * chart.onInit(() => {
466 | * console.log(chart.visibleNodeIds);
467 | * });
468 | * chart.load(nodes)
469 | * ```
470 | */
471 | visibleNodeIds: Array;
472 |
473 | /**
474 | * Updates the node data
475 | * ```typescript
476 | * let chart = new OrgChart('#tree', {});
477 | * ...
478 | * chart.update({ id: 1, name: "Updated Name", title: "Updated Title" });
479 | * chart.draw();
480 | * ```
481 | * @param newData node data
482 | */
483 | update(newData: object): OrgChart;
484 |
485 | /**
486 | * Removes specified node from nodes collection
487 | * ```typescript
488 | * let chart = new OrgChart('#tree', {});
489 | * ...
490 | * chart.remove(2);
491 | * chart.draw();
492 | * ```
493 |
494 | * @param id identification number of the node
495 | */
496 | remove(id: string | number): OrgChart;
497 | /**
498 | * Adds new node to the nodes collection
499 | * ```typescript
500 | * let chart = new OrgChart('#tree', {});
501 | * ...
502 | * chart.add({ id: 2, pid: 1, name: "Ashley Barnett", title: "Sales Manager" })
503 | * chart.draw();
504 | * ```
505 |
506 | * @param data node data
507 | */
508 | add(data: object): OrgChart;
509 |
510 | /**
511 | * Adds new node to the nodes collection, redraws the chart and fires remove event
512 | * ```typescript
513 | * let chart = new OrgChart('#tree', {});
514 | * ...
515 | * chart.addNode({ id: 1, name: "Denny Curtis", title: "CEO" });
516 | * ```
517 | * @param data node data
518 | * @param callback called at the end of animation
519 | * @param fireEvent indicates if the add event will be called or not
520 | */
521 | addNode(data: nodeData, callback?: () => void, fireEvent?: boolean): void;
522 |
523 | /**
524 | * Removes specified node from nodes collection, redraws the chart and fires remove event.
525 | * ```typescript
526 | * var chart = new OrgChart('#tree', {});
527 | * chart.removeNode(2);
528 | * ```
529 | * @param id identification number of the node
530 | * @param callback called at the end of animation
531 | * @param fireEvent indicates if the remove event will be called or not
532 | */
533 | removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
534 |
535 |
536 | /**
537 | * Gets node data.
538 | * ```typescript
539 | * let chart = new OrgChart('#tree', {});
540 | * ...
541 | * let node = chart.get(2);
542 | * ```
543 | * @param id identification number of the node
544 | */
545 | get(id: string | number): nodeData;
546 | /**
547 | * If specified node has assistant/s or partner/s as children will return false.
548 | * ```typescript
549 | * let chart = new OrgChart('#tree', {});
550 | * ...
551 | * let canRemove = chart.canRemove(2);
552 | * ```
553 | * @param id identification number of the node
554 | */
555 | canRemove(id: string | number): boolean;
556 | /**
557 | * Expands specified nodes.
558 | * ```typescript
559 | * let chart = new OrgChart('#tree', {});
560 | * ...
561 | * chart.expand(1, [2]);
562 | * ```
563 | * @param id the id of the node that will not move during the animation
564 | * @param ids node ids that will be expanded
565 | * @param callback called after the animation completes
566 | */
567 | expand(id: string | number, ids: Array | "all", callback?: () => void): void;
568 | /**
569 | * Collapses specified nodes.
570 | * ```typescript
571 | * let chart = new OrgChart('#tree', {});
572 | * ...
573 | * chart.collapse(1, [2]);
574 | * ```
575 | * @param id the id of the node that will not move
576 | * @param ids node ids that will be collapsed
577 | * @param callback called after the animation completes
578 | */
579 | collapse(id: string | number, ids: Array, callback?: () => void): void;
580 | /**
581 | * Expand/Collapse lists of nodes.
582 | * ```typescript
583 | * let chart = new OrgChart('#tree', {});
584 | * ...
585 | * chart.expandCollapse(1, [2], [3]);
586 | * ```
587 | * @param id the id of the node that will not move
588 | * @param expandIds expand all nodes with ids
589 | * @param collapseIds collpase all nodes with ids
590 | * @param callback called after the animation completes
591 | */
592 | expandCollapse(id: string | number, expandIds: Array, collapseIds: Array, callback?: () => void): void;
593 | /**
594 | * Changes roots order.
595 | * ```typescript
596 | * let chart = new OrgChart('#tree', {});
597 | * ...
598 | * chart.changeRoots(1, [2]);
599 | * ```
600 | * @param id id of a node that will not change is position, can be null
601 | * @param roots roots id array in the required order
602 | * @param callback called after the roots are changed and animation completes
603 | */
604 | changeRoots(id: string | number, roots: Array, callback?: () => void): void;
605 | /**
606 | * Maximize the node. Without parameters maximize all nodes.
607 | * ```typescript
608 | * let chart = new OrgChart('#tree', {});
609 | * ...
610 | * chart.maximize();
611 | * ```
612 | * @param id the id of the node, if id is null, undefined ot empty string will maximize all nodes
613 | * @param horizontalCenter center horizontally
614 | * @param verticalCenter center vertically
615 | * @param callback called when the animation completes
616 | */
617 | maximize(id?: string | number, horizontalCenter?: boolean, verticalCenter?: boolean, callback?: () => void): void;
618 | /**
619 | * ```typescript
620 | * let chart = new OrgChart('#tree', {});
621 | * ...
622 | * chart.minimize();
623 | * ```
624 | * Minimize the node. Without parameters minimize all nodes.
625 | * @param id the id of the node, if id is null, undefined ot empty string will minimize all nodes
626 | * @param callback called when the animation completes
627 | */
628 | minimize(id?: string | number, callback?: () => void): void;
629 | /**
630 | * Load nodes data.
631 | * ```typescript
632 | * let chart = new OrgChart('#tree', {});
633 | * ...
634 | * chart.load([
635 | * { id: 1, name: "Denny Curtis" },
636 | * { id: 2, pid: 1, name: "Ashley Barnett" },
637 | * { id: 3, pid: 1, name: "Caden Ellison" }
638 | * ]);
639 | * ```
640 | * @param data nodes data array
641 | * @param callback function called after the load
642 | */
643 | load(data: Array, callback?: () => void): OrgChart;
644 |
645 |
646 |
647 | /**
648 | * Updates the node data, redraws the chart and fires update event.
649 | * ```typescript
650 | * let chart = new OrgChart('#tree', {});
651 | * ...
652 | * chart.updateNode({ id: 4, pid: 2, name: "Updated Name", title: "Updated Title" });
653 | * ```
654 | * @param data node data
655 | * @param callback function called when the animation completes
656 | * @param fireEvent if it set to true the update event is called
657 | */
658 | updateNode(data: nodeData, callback?: () => void, fireEvent?: boolean): void;
659 |
660 | /**
661 | * Loads nodes from xml.
662 | * ```typescript
663 | * let chart = new OrgChart('#tree', {});
664 | * let xml = '';
665 | * chart.loadXML(xml);
666 | * ```
667 | * @param xml Xml with node structure
668 | * @param callback function called after the load
669 | */
670 | loadXML(xml: string, callback?: () => void): OrgChart;
671 | /**
672 | * Gets nodes as xml.
673 | * ```typescript
674 | * let chart = new OrgChart('#tree', {});
675 | * let xml = chart.getXML();
676 | * ```
677 | */
678 | getXML(): string;
679 | /**
680 | * Draws the chart.
681 | * ```typescript
682 | * let chart = new OrgChart('#tree', {});
683 | * ...
684 | * chart.update({ id: 1, name: "Updated Name", title: "Updated Title" });
685 | * chart.draw();
686 | * ```
687 | * @param action Action for example OrgChart.action.centerNode, default is OrgChart.action.update
688 | * @param actionParams parameters for the action
689 | * @param callback called when the animation completes
690 | */
691 | draw(action?: OrgChart.action, actionParams?: any, callback?: () => void): void;
692 | /**
693 | * Gets the width of the container.
694 | * ```typescript
695 | * let chart = new OrgChart('#tree', {});
696 | * ...
697 | * let width = chart.width();
698 | * ```
699 | */
700 | width(): number;
701 | /**
702 | * ```typescript
703 | * let chart = new OrgChart('#tree', {});
704 | * ...
705 | * let height = chart.height();
706 | * ```
707 | * Gets the height of the container.
708 | */
709 | height(): number;
710 | /**
711 | * Gets the view box attribute of the svg html element.
712 | * ```typescript
713 | * let chart = new OrgChart('#tree', {});
714 | * ...
715 | * let viewBox = chart.getViewBox();
716 | * ```
717 | */
718 | getViewBox(): Array;
719 | /**
720 | * Sets the view box attribute of the svg html element.
721 | * ```typescript
722 | * let chart = new OrgChart('#tree', {});
723 | * ...
724 | * chart.setViewBox();
725 | * ```
726 | * @param viewBox
727 | */
728 | setViewBox(viewBox: Array): void;
729 | /**
730 | * Gets the current scale of the chart.
731 | * ```typescript
732 | * let chart = new OrgChart('#tree', {});
733 | * ...
734 | * let scale = chart.getScale();
735 | * ```
736 | * @param viewBox
737 | */
738 | getScale(viewBox?: Array): number;
739 |
740 | /**
741 | * Sets the current scale of the chart.
742 | * Returns the actual scale limited by scaleMax and scaleMin
743 | * ```typescript
744 | * let chart = new OrgChart('#tree', {});
745 | * ...
746 | * chart.setScale(1.2);
747 | * ```
748 | * @param newScale new scale value
749 | */
750 | setScale(newScale: number): number;
751 | /**
752 | * Animates specified node with ripple animation - highlight the node.
753 | * ```typescript
754 | * let chart = new OrgChart('#tree', {});
755 | * ...
756 | * chart.ripple(2);
757 | * ```
758 | * @param id the id of the node
759 | * @param clientX x value of the ripple center in the node
760 | * @param clientY y value of the ripple center in the node
761 | */
762 | ripple(id: string | number, clientX?: number, clientY?: number): void;
763 | /**
764 | * Centers specified node on the screen.
765 | * ```typescript
766 | * let chart = new OrgChart('#tree', {});
767 | * ...
768 | * chart.center(2);
769 | * ```
770 | * @param nodeId the id of the node
771 | * @param options parentState: OrgChart.COLLAPSE_PARENT_NEIGHBORS, childrenState: OrgChart.COLLAPSE_SUB_CHILDRENS, rippleId: rippleId, vertical: false, horizontal: false
772 | * @param callback called when the animation completes
773 | */
774 | center(nodeId: string | number, options?: {
775 | parentState: any,
776 | childrenState: any,
777 | rippleId: string | number,
778 | vertical: boolean,
779 | horizontal: boolean
780 | } | null, callback?: () => void): void;
781 |
782 |
783 |
784 | /**
785 | * Fits the content to the visible area.
786 | * ```typescript
787 | * let chart = new OrgChart('#tree', {});
788 | * ...
789 | * chart.fit();
790 | * ```
791 | * @param callback called when the animation completes
792 | */
793 | fit(callback?: () => void): void;
794 |
795 | /**
796 | * Fits the content to the visible area if it is ouside of the visible area.
797 | * ```typescript
798 | * let chart = new OrgChart('#tree', {});
799 | * ...
800 | * chart.fitOfOutside();
801 | * ```
802 | * @param callback called when the animation completes
803 | */
804 | fitIfOutside(callback?: () => void): void;
805 |
806 | /**
807 | * Toggles full screen mode.
808 | * ```typescript
809 | * let chart = new OrgChart('#tree', {});
810 | * ...
811 | * chart.toggleFullScreen();
812 | * ```
813 | */
814 | toggleFullScreen(): void;
815 | /**
816 | * Gets the node as {@link OrgChart.node} object.
817 | * ```typescript
818 | * let chart = new OrgChart('#tree', {});
819 | * ...
820 | * let node = chart.getNode(2);
821 | * ```
822 | * @param nodeId
823 | */
824 | getNode(nodeId: string | number): OrgChart.node;
825 |
826 |
827 | /**
828 | * Sets layout.
829 | * ```typescript
830 | * let chart = new OrgChart('#tree', {});
831 | * ...
832 | * chart.setLayout(OrgChart.tree);
833 | * ```
834 | * @param layout layout type
835 | * @param lcn lyout config name for the specified sub tree
836 | */
837 |
838 | setLayout(layout: OrgChart.layout | number, lcn?: string): void;
839 | /**
840 | * Sets orientation.
841 | * ```typescript
842 | * let chart = new OrgChart('#tree', {});
843 | * ...
844 | * chart.setOrientation(2);
845 | * ```
846 | * @param orientation orientation type
847 | * @param lcn lyout config name for the specified sub tree
848 | * @param callback called at the end of animation
849 | */
850 | setOrientation(orientation: OrgChart.orientation, lcn?: string, callback?: () => void): void;
851 |
852 | /**
853 | * ```typescript
854 | * let chart = new OrgChart('#tree', {});
855 | * ...
856 | * chart.moveNodesToVisibleArea([2, 3]);
857 | * ```
858 | * Moves specified nodes to the visible area.
859 | * @param ids Array of node ids
860 | * @param callback called at the end of animation
861 | */
862 | moveNodesToVisibleArea(ids: Array, callback?: () => void): void;
863 |
864 | /**
865 | * Search in the chart.
866 | * ```typescript
867 | * let chart = new OrgChart('#tree', {});
868 | * ...
869 | * chart.search("Ava");
870 | * ```
871 | * @param value search for value
872 | * @param searchInFields search in field names
873 | * @param retrieveFields retrive data for fields
874 | * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
875 | */
876 | search(value: string, searchInFields?: Array, retrieveFields?: Array): Array<{
877 | id: number | string,
878 | name: string,
879 | __score: number,
880 | __searchField: string,
881 | __searchMarks: string
882 | }>;
883 | /**
884 | * Gets collpased node ids of the specifeid node
885 | * ```typescript
886 | * let chart = new OrgChart('#tree', {});
887 | * ...
888 | * let ids = chart.getCollapsedIds(2);
889 | * ```
890 | * @param node
891 | */
892 | getCollapsedIds(node: OrgChart.node): Array;
893 | /**
894 | * State to url.
895 | * ```typescript
896 | * let chart = new OrgChart('#tree', {});
897 | * ...
898 | * let url = chart.stateToUrl();
899 | * ```
900 | * {@link https://balkan.app/OrgChartJS/Docs/State | See doc...}
901 | */
902 | stateToUrl(): string;
903 | /**
904 | * Genereates unique identification number that can be used for new nodes
905 | * ```typescript
906 | * let chart = new OrgChart('#tree', {});
907 | * ...
908 | * let id = chart.generateId();
909 | * ```
910 | */
911 | generateId(): string;
912 | /**
913 | * Destroys the object.
914 | * ```typescript
915 | * let chart = new OrgChart('#tree', {});
916 | * ...
917 | * chart.destroy();
918 | * ```
919 | */
920 | destroy(): void;
921 | /**
922 | * Replaces the id, pid, stpid, ppid and the ids in clinks, slinks, dottedLines, groupDottedLines.
923 | * After the replacment updates the UI
924 | * ```typescript
925 | * let chart = new OrgChart('#tree', {});
926 | * ...
927 | * chart.replaceIds[{2:21, 3:31});
928 | * ```
929 | * @param old_new_ids dictionary containing old and new ids
930 | * @param callback called when the replacment completes
931 | */
932 | replaceIds(old_new_ids: {
933 | [key: string]: string | number
934 | }, callback?: () => void): void;
935 | /**
936 | * Adds curved link.
937 | * ```typescript
938 | * let chart = new OrgChart('#tree', {});
939 | * ...
940 | * chart.addClink(4, 0, 'text')
941 | * chart.draw();
942 | * ```
943 | * @param from from node with id
944 | * @param to to node with id
945 | * @param label link label
946 | * @param template link template, for example 'orange'
947 | */
948 | addClink(from: string | number, to: string | number, label?: string, template?: string): OrgChart;
949 | /**
950 | * Removes curved link.
951 | * ```typescript
952 | * let chart = new OrgChart('#tree', {});
953 | * ...
954 | * chart.removeClink(4, 0)
955 | * chart.draw();
956 | * ```
957 | * @param from from node with id
958 | * @param to to node with id
959 | */
960 | removeClink(from: string | number, to: string | number): OrgChart;
961 | /**
962 | * Adds second link.
963 | * ```typescript
964 | * let chart = new OrgChart('#tree', {});
965 | * ...
966 | * chart.addSlink(4, 0, 'text')
967 | * chart.draw();
968 | * ```
969 | * @param from from node with id
970 | * @param to to node with id
971 | * @param label link label
972 | * @param template link template, for example 'orange'
973 | */
974 | addSlink(from: string | number, to: string | number, label?: string, template?: string): OrgChart;
975 | /**
976 | * Removes second link.
977 | * ```typescript
978 | * let chart = new OrgChart('#tree', {});
979 | * ...
980 | * chart.removeSlink(4, 0)
981 | * chart.draw();
982 | * ```
983 | * @param from from node with id
984 | * @param to to node with id
985 | */
986 | removeSlink(from: string | number, to: string | number): OrgChart;
987 | /**
988 | * Gets svg html element
989 | * ```typescript
990 | * let chart = new OrgChart('#tree', {});
991 | * ...
992 | * let svg = chart.getSvg();
993 | * ```
994 | */
995 | getSvg(): SVGAElement;
996 | /**
997 | * Gets node html element
998 | * ```typescript
999 | * let chart = new OrgChart('#tree', {});
1000 | * ...
1001 | * let nodeElement = chart.getNodeElement(2);
1002 | * ```
1003 | * @param id node id
1004 | */
1005 | getNodeElement(id: string | number): HTMLElement;
1006 | /**
1007 | * Gets menu button html element
1008 | * ```typescript
1009 | * let chart = new OrgChart('#tree', {});
1010 | * ...
1011 | * let menuButton = chart.getMenuButton(2);
1012 | * ```
1013 | */
1014 | getMenuButton(): HTMLElement;
1015 |
1016 |
1017 | /**
1018 | * Exports to CSV
1019 | * ```typescript
1020 | * let chart = new OrgChart('#tree', {});
1021 | * ...
1022 | * chart.exportToCSV();
1023 | * ```
1024 | * @param filename The name of the exported file
1025 | * {@link https://balkan.app/OrgChartJS/Docs/ExportingOther#options | See doc...}
1026 | */
1027 | exportToCSV(filename?: string | OrgChart.exportCSVXMLJSONOptions): void;
1028 | /**
1029 | * Exports to XML
1030 | * ```typescript
1031 | * let chart = new OrgChart('#tree', {});
1032 | * ...
1033 | * chart.exportToXML();
1034 | * ```
1035 | * @param filename The name of the exported file
1036 | * {@link https://balkan.app/OrgChartJS/Docs/ExportingOther#options | See doc...}
1037 | */
1038 | exportToXML(filename: string | OrgChart.exportCSVXMLJSONOptions): void;
1039 | /**
1040 | * Exports to JSON
1041 | * ```typescript
1042 | * let chart = new OrgChart('#tree', {});
1043 | * ...
1044 | * chart.exportToJSON();
1045 | * ```
1046 | * @param filename The name of the exported file
1047 | * {@link https://balkan.app/OrgChartJS/Docs/ExportingOther#options | See doc...}
1048 | */
1049 | exportToJSON(filename?: string | OrgChart.exportCSVXMLJSONOptions ): void;
1050 |
1051 | /**
1052 | * ```typescript
1053 | * let chart = new OrgChart('#tree', {});
1054 | * ...
1055 | * chart.shareProfile(2);
1056 | * ```
1057 | * Shares node data, uses build-in device sharing functionallity.
1058 | * @param id node id
1059 | */
1060 | shareProfile(id: string | number): void;
1061 |
1062 | /**
1063 | * Exports to Visio document
1064 | * ```typescript
1065 | * let chart = new OrgChart('#tree', {});
1066 | * ...
1067 | * chart.exportToVisio();
1068 | * ```
1069 | * @param options export options
1070 | * @param callback called when the export completes
1071 | * {@link https://balkan.app/OrgChartJS/Docs/ExportingOther | See doc...}
1072 | */
1073 | exportToVisio(options?: OrgChart.exportVisioOptions, callback?: () => void): void;
1074 | exportToPowerPoint(options?: OrgChart.exportPowerPontOptions, callback?: () => void): void;
1075 | exportToPDF(options?: OrgChart.exportPDFOptions, callback?: () => void): void;
1076 | exportToPNG(options?: OrgChart.exportPNGOptions, callback?: () => void): void;
1077 | exportToSVG(options?: OrgChart.exportSVGOptions, callback?: () => void): void;
1078 | exportToPDFProfile(nodeId: number | string, callback?: () => void): void;
1079 |
1080 |
1081 |
1082 |
1083 | /**
1084 | * Imports CSV file.
1085 | * ```typescript
1086 | * let chart = new OrgChart('#tree', {});
1087 | * ...
1088 | * chart.importCSV();
1089 | * ```
1090 | * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
1091 | */
1092 | importCSV(): void;
1093 | /**
1094 | * Imports XML file.
1095 | * ```typescript
1096 | * let chart = new OrgChart('#tree', {});
1097 | * ...
1098 | * chart.importXML();
1099 | * ```
1100 | * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
1101 | */
1102 | importXML(): void;
1103 |
1104 | /**
1105 | * Imports JSON file.
1106 | * ```typescript
1107 | * let chart = new OrgChart('#tree', {});
1108 | * ...
1109 | * chart.importJSON();
1110 | * ```
1111 | * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
1112 | */
1113 | importJSON(): void;
1114 |
1115 | /**
1116 | * Zoom out or zoom in the chart.
1117 | * ```typescript
1118 | * let chart = new OrgChart('#tree', {});
1119 | * ...
1120 | * chart.zoom(true);
1121 | * ```
1122 | * @param delta true for zoom in, false for zoom out or scale number, if scale is > 1 it will zoom in and scale < 1 zoom out.
1123 | * @param center array [x, y], where x is x percantege from the width and y is y percentage from the height.
1124 | * @param shouldAnimate should animate
1125 | * @param callback called when the animation completes
1126 | */
1127 | zoom(delta: boolean | number, center?: Array, shouldAnimate?: boolean, callback?: () => void): void;
1128 |
1129 | /**
1130 | * Magnify(Zoom in) specific node in the chart.
1131 | * ```typescript
1132 | * let chart = new OrgChart('#tree', {});
1133 | * ...
1134 | * chart.magnify(2, 1.25);
1135 | * ```
1136 | * @param id id of the node
1137 | * @param scale scale to magnify
1138 | * @param front show on front or back
1139 | * @param anim animation type
1140 | */
1141 | magnify(id: string | number, scale: number, front?: boolean, anim?: OrgChart.anim | null, callback?: () => void): void;
1142 |
1143 | /**
1144 | * Starts the move
1145 | * ```typescript
1146 | * let chart = new OrgChart('#tree', {});
1147 | * ...
1148 | * chart.moveStart({right: true});
1149 | * ```
1150 | * @param movePosition move position
1151 | * @param tick callback function in each step
1152 | * @param func the name of the animation function, for example OrgChart.anim.inSin
1153 | * @param duration duration before going to 100 percent speed
1154 | */
1155 | moveStart(movePosition: OrgChart.move, tick?: () => void, func?: OrgChart.anim, duration?: number): void;
1156 |
1157 | /**
1158 | * Ends the move
1159 | * ```typescript
1160 | * let chart = new OrgChart('#tree', {});
1161 | * ...
1162 | * chart.moveEnd();
1163 | */
1164 | moveEnd(): void;
1165 |
1166 | /**
1167 | * Undo data operations like adding/removing nodes. Set undoRedoStorageName option before calling this method.
1168 | * ```typescript
1169 | * let chart = new OrgChart('#tree', {});
1170 | * ...
1171 | * chart.undo();
1172 | * ```
1173 | * @param callback called when the animation completes
1174 | */
1175 | undo(callback?: () => void): void;
1176 | /**
1177 | * Redo data operations like adding/removing nodes. Set undoRedoStorageName option before calling this method.
1178 | * ```typescript
1179 | * let chart = new OrgChart('#tree', {});
1180 | * ...
1181 | * chart.redo();
1182 | * ```
1183 | * @param callback called when the animation completes
1184 | */
1185 | redo(callback?: () => void): void;
1186 |
1187 | /**
1188 | * Clears all Redo stack steps.
1189 | * ```typescript
1190 | * let chart = new OrgChart('#tree', {});
1191 | * ...
1192 | * chart.clearRedo();
1193 | * ```
1194 | */
1195 | clearRedo(): void;
1196 |
1197 | /**
1198 | * Clears all Undo stack steps.
1199 | * ```typescript
1200 | * let chart = new OrgChart('#tree', {});
1201 | * ...
1202 | * chart.clearUndo();
1203 | * ```
1204 | */
1205 | clearUndo(): void;
1206 | /**
1207 | * Returns the number of Undo stack steps
1208 | * ```typescript
1209 | * let chart = new OrgChart('#tree', {});
1210 | * ...
1211 | * let undoSteps = chart.undoStepsCount();
1212 | * ```
1213 | */
1214 | undoStepsCount(): number;
1215 | /**
1216 | * Returns the number of Redo stack steps
1217 | * ```typescript
1218 | * let chart = new OrgChart('#tree', {});
1219 | * ...
1220 | * let redoSteps = chart.redoStepsCount();
1221 | * ```
1222 | */
1223 | redoStepsCount(): number;
1224 |
1225 |
1226 | /**
1227 | * The onField() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target.
1228 | * ```typescript
1229 | * let chart = new OrgChart('#tree', {});
1230 | * chart.onField((args) => {
1231 | * //return false; to cancel
1232 | * });
1233 | * chart.load(nodes);
1234 | * ```
1235 | * @category Event Listeners
1236 | * @param listener
1237 | */
1238 | onField(listener: (this: OrgChart, args: {
1239 | /**
1240 | * the node
1241 | */
1242 | node: OrgChart.node,
1243 | /**
1244 | * node data json object
1245 | */
1246 | data: object,
1247 | /**
1248 | * value of the filed, can be changed in the event
1249 | */
1250 | value: any,
1251 | /**
1252 | * svg or html element of the filed, can be changed in the event
1253 | */
1254 | element: string,
1255 | /**
1256 | * name of the field
1257 | */
1258 | name: string
1259 | /**
1260 | * field template name
1261 | */
1262 | field: string
1263 | }) => void | boolean): OrgChart;
1264 |
1265 | /**
1266 | * Occurs when the nodes in OrgChart has been created and loaded to the DOM.
1267 | * ```typescript
1268 | * let chart = new OrgChart('#tree', {});
1269 | * chart.onInit(() => {
1270 | * });
1271 | * chart.load(nodes);
1272 | * ```
1273 | * @category Event Listeners
1274 | * @param listener
1275 | */
1276 | onInit(listener: (this: OrgChart) => void): OrgChart;
1277 |
1278 | /**
1279 | * The onRedraw event occurs when the chart is redrawed.
1280 | * ```typescript
1281 | * let chart = new OrgChart('#tree', {});
1282 | * chart.onRedraw(() => {
1283 | * });
1284 | * chart.load(nodes);
1285 | * ```
1286 | * @category Event Listeners
1287 | * @param listener
1288 | */
1289 | onRedraw(listener: (this: OrgChart) => void): OrgChart;
1290 |
1291 | /**
1292 | * The onExpandCollapseButtonClick event occurs when the chart is redrawed.
1293 | * ```typescript
1294 | * let chart = new OrgChart('#tree', {});
1295 | * chart.onExpandCollapseButtonClick(() => {
1296 | * //return false; to cancel the operation
1297 | * });
1298 | * chart.load(nodes);
1299 | * ```
1300 | * @category Event Listeners
1301 | * @param listener
1302 | */
1303 | onExpandCollapseButtonClick(listener: (this: OrgChart, args: {
1304 | /**
1305 | * Indicates id the operation is collaps or expand
1306 | */
1307 | collapsing: boolean,
1308 | /**
1309 | * the id of the clicked node
1310 | */
1311 | id: number | string,
1312 | /**
1313 | * node ids that will be expanded or collapsed
1314 | */
1315 | ids: Array
1316 | }) => void): OrgChart;
1317 |
1318 | /**
1319 | * Occurs in the beginning of the export. Extra css styles can be added to the exported document using this event listener or show loading image.
1320 | * ```typescript
1321 | * let chart = new OrgChart('#tree', {});
1322 | * chart.onExportStart(() => {
1323 | * args.styles += '';
1324 | * //return false; to cancel the operation
1325 | * });
1326 | * chart.load(nodes);
1327 | * ```
1328 | * @category Event Listeners
1329 | * @param listener
1330 | */
1331 | onExportStart(listener: (this: OrgChart, args: {
1332 | options: {
1333 | childLevels?: number,
1334 | expandChildren?: boolean,
1335 | fileName?: string,
1336 | footer?: string,
1337 | header?: string,
1338 | height?: number,
1339 | width?: number,
1340 | landscape?: boolean,
1341 | margin?: Array,
1342 | min?: boolean,
1343 | openInNewTab?: boolean,
1344 | padding?: number,
1345 | parentLevels?: number,
1346 | type?: string,
1347 | pages?: Array<{
1348 | chartInstance?: OrgChart,
1349 | childLevels?: number,
1350 | expandChildren?: boolean,
1351 | footer?: string,
1352 | header?: string,
1353 | margin?: Array,
1354 | min?: boolean,
1355 | padding?: number,
1356 | parentLevels?: number,
1357 | isProfile?: boolean,
1358 | nodeId?: number | string,
1359 | content?: string,
1360 | height?: number,
1361 | width?: number,
1362 | }>
1363 | },
1364 | pages?: Array,
1365 | styles?: string
1366 | }) => void): OrgChart;
1367 |
1368 | /**
1369 | * Occurs in the beginning of the export. Use this event listener to hide loading image or upload exported document to your server using ArrayBuffer argument.
1370 | * ```typescript
1371 | * let chart = new OrgChart('#tree', {});
1372 | * chart.onExportEnd(() => {
1373 | * //return false; to cancel the operation for example id you prefer the exported document to not download
1374 | * });
1375 | * chart.load(nodes);
1376 | * ```
1377 | * @category Event Listeners
1378 | * @param listener
1379 | */
1380 | onExportEnd(listener: (this: OrgChart, args:
1381 | /**
1382 | * for PDF/PNG
1383 | */
1384 | {
1385 | /**
1386 | * the array buffer is the exported document, you can save it on a server or send it via email
1387 | *
1388 | * this property is initialized only for PDF/PNG exports
1389 | */
1390 | ArrayBuffer: ArrayBuffer
1391 | /**
1392 | * extension
1393 | *
1394 | * this property is initialized only for CSV/XML exports
1395 | */
1396 | ext: string,
1397 | /**
1398 | * filename, you can change the filename here
1399 | *
1400 | * this property is initialized only for CSV/XML exports
1401 | */
1402 | filename: string,
1403 | /**
1404 | * an array of node objects
1405 | *
1406 | * this property is initialized only for CSV/XML exports
1407 | */
1408 | nodes: Array