@balkangraph/orgchart.js 8.1.6 → 8.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/orgchart.d.ts +1933 -1819
  2. package/orgchart.js +1 -1
  3. package/package.json +1 -1
package/orgchart.d.ts CHANGED
@@ -1,1980 +1,2094 @@
1
- declare namespace OrgChart {
2
-
3
- function isTrial(): boolean;
4
-
5
- function t(templateName: string, minimized?: boolean, scale?: number ) : any;
6
-
7
- enum orientation {
8
- top,
9
- left,
10
- right,
11
- bottom,
12
- top_left,
13
- bottom_left,
14
- right_top,
15
- left_top
16
- }
17
- enum action {
18
- /**
19
- * mouseScrool value
20
- */
21
- zoom,
22
- /**
23
- * mouseScrool value
24
- */
25
- scroll,
26
- /**
27
- * mouseScrool value
28
- */
29
- xScroll,
30
- /**
31
- * mouseScrool value
32
- */
33
- yScroll,
34
- /**
35
- * Zoom on Ctrl + mouseScrool
36
- */
37
- ctrlZoom,
38
- /**
39
- * nodeMouseClick value
40
- */
41
- edit,
42
- /**
43
- * nodeMouseClick and nodeMouseDbClick value
44
- */
45
- details,
46
- /**
47
- * nodeMouseClick and nodeMouseDbClick value
48
- */
49
- expandCollapse,
50
- /**
51
- * nodeMouseClick, nodeMouseDbClick and mouseScrool value
52
- */
53
- none,
54
- update,
55
- centerNode,
56
- pan
57
- }
58
- enum scroll {
59
- visible,
60
- }
61
-
62
- enum match {
63
- height,
64
- width,
65
- boundary
66
- }
67
-
68
- enum anim {
69
- inPow,
70
- outPow,
71
- inOutPow,
72
- inSin,
73
- outSin,
74
- inOutSin,
75
- inExp,
76
- outExp,
77
- inOutExp,
78
- inCirc,
79
- outCirc,
80
- inOutCirc,
81
- rebound,
82
- inBack,
83
- outBack,
84
- inOutBack
85
- }
86
-
87
- interface Loc {
88
- ppdfCmdTitle: string;
89
- ppdfSave: string;
90
- ppdfCancel: string;
91
- ppdfFormat: string;
92
- ppdfFitToDrwaing: string;
93
- ppdfA4: string;
94
- ppdfA3: string;
95
- ppdfA2: string;
96
- ppdfA1: string;
97
- ppdfLetter: string;
98
- ppdfLegal: string;
99
- ppdfLayout: string;
100
- ppdfPortrait: string;
101
- ppdfLandscape: string;
102
- ppdfFittopagewidth: string;
103
- ppdfMargin: string;
104
- ppdfHeader: string;
105
- ppdfFooter: string;
106
- ppdfScale: string;
107
- }
108
-
109
- const templates: any;
110
-
111
- const icon: any;
112
-
113
- const none: any;
114
-
115
- const CENTER: any;
116
- const ORIENTATION: any;
117
-
118
- const COLLAPSE: any;
119
- const EXPAND: any;
120
-
121
- const COLLAPSE_PARENT_NEIGHBORS: any;
122
- const COLLAPSE_SUB_CHILDRENS: any;
123
-
124
- const normal: any;
125
- const mixed: any;
126
- const tree: any;
127
- const treeLeftOffset: any;
128
- const treeRightOffset: any;
129
-
130
- const slinkTemplates: any;
131
-
132
- const menuUI: any;
133
-
134
- const _guid: Function;
135
- const randomId: Function;
136
-
137
- var MINIMIZE: string;
138
- var MAXIMIZE: string;
139
-
140
- const state: State;
141
-
142
- const events: any;
143
-
144
- const wrapText: Function;
145
-
146
- const nodeMenu: any;
147
- const toolbarUI: any;
148
- const nodeMenuUi: any;
149
- const pdfPrevUI: any;
150
- const menuUi: any;
151
- const editUi: any;
152
-
153
- var SEARCH_PLACEHOLDER: string;
154
-
155
- const RES: any;
156
-
157
- const loc: Loc;
158
-
159
- const grCloseTag: any;
160
- }
161
-
162
- interface State {
163
- clear: Function;
164
- }
165
-
166
- interface Node {
167
- id: string | number,
168
- pid: string | number,
169
- spid: string | number,
170
- tags: Array <String>,
171
- [name: string]: any
172
- }
173
-
174
-
175
-
176
- interface NodeModel {
177
- id: string | number,
178
- pid: string | number,
179
- ppid: string | number,
180
- parent: NodeModel,
181
- stpid: string | number,
182
- stParent: NodeModel,
183
- isPartner: boolean,
184
- partnerSeparation: number,
185
- childrenIds: Array<string | number>,
186
- children: Array<NodeModel>,
187
- stChildrenIds: Array<string | number>,
188
- stChildren: Array<NodeModel>,
189
- tags: Array<string>,
190
- templateName: string,
191
- leftNeighbor: NodeModel,
192
- rightNeighbor: NodeModel,
193
- x: number,
194
- y: number,
195
- w: number,
196
- h: number,
197
- isAssistant: boolean,
198
- stContainerNodes: Array<NodeModel>,
199
- order: number,
200
- collapsed: boolean,
201
- level: number,
202
- min: boolean,
203
- subLevels: number,
204
- padding: number,
205
- lcn: string,
206
- isSplit: boolean
207
- }
208
-
209
- interface Menu {
210
- add?: any,
211
- edit?: any,
212
- details?: any,
213
- remove?: any,
214
- svg?: any,
215
- pdf?: any,
216
- png?: any,
217
- csv?: any,
218
- addInGroup?: any,
219
- addAsChild?: any,
220
- [name: string]: any,
221
- }
222
-
223
-
224
- interface Tags {
225
- [name: string]: Object,
226
- }
1
+ declare class OrgChart {
2
+ nodes: { [key: string | number]: OrgChart.node };
3
+ isVisible: boolean;
227
4
 
228
- interface OrgChartOptions {
229
5
  /**
230
- * OrgChart JS can be displayed in "dark" or "light" modes by settong the mode option:
231
- * Default value: light;
232
-
233
- Code example:
234
- ```
235
- var chart = new OrgChart(document.getElementById("tree"), {
236
- mode: 'dark',
237
- });
238
- ```
6
+ * @param element HTML element or string selector for example '#tree'
7
+ * @param options configuration options
239
8
  */
240
- mode?: string,
9
+ constructor(element: HTMLElement | string, options?: OrgChart.options);
241
10
 
242
11
  /**
243
- * Lazy loading is technique that defers loading of non-critical nodes at page load time. Instead, these non-critical nodes are loaded at the moment of need.
244
- * Default value: true
245
-
246
- Code example:
247
- ```
248
- var chart = new OrgChart(document.getElementById("tree"), {
249
- lazyLoading: true;
250
- });
251
- ```
12
+ * Updates the node data, redraws the chart and fires update event.
13
+ * @param data node data
14
+ * @param callback function called when the animation completes
15
+ * @param fireEvent if it set to true the update event is called
252
16
  */
253
- lazyLoading?: boolean,
17
+ updateNode(data: object, callback?: () => void, fireEvent?: boolean): void;
254
18
  /**
255
- * Enables advanced search.
256
-
257
- Default value: true
258
-
259
- Code example:
260
- ```
261
- var chart = new OrgChart(document.getElementById("tree"), {
262
- enableSearch: true,
263
- });
264
- ```
265
- */
266
- enableSearch?: boolean,
19
+ * Updates the node data
20
+ * @param newData node data
21
+ */
22
+ update(newData: object): OrgChart;
267
23
  /**
268
- * Specifies the orientation of the OrgChart JS. could accept one of the following values:
269
-
270
- - OrgChart.orientation.top
271
- - OrgChart.orientation.bottom
272
- - OrgChart.orientation.right
273
- - OrgChart.orientation.left
274
- - OrgChart.orientation.top_left
275
- - OrgChart.orientation.bottom_left
276
- - OrgChart.orientation.right_top
277
- - OrgChart.orientation.left_top
278
- Default value: OrgChart.orientation.top
279
-
280
- Code example:
281
- ```
282
- var chart = new OrgChart(document.getElementById("tree"), {
283
- ...
284
- orientation: OrgChart.orientation.bottom
285
- });
286
- ```
24
+ * Removes specified node from nodes collection, redraws the chart and fires remove event.
25
+ * @param id identification number of the node
26
+ * @param callback called at the end of animation
27
+ * @param fireEvent indicates if the remove event will be called or not
287
28
  */
288
- orientation?: OrgChart.orientation,
29
+ removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
289
30
  /**
290
- * mouseScrool can accept the following values:
291
-
292
- - OrgChart.action.zoom - will zoom in/out on mouse scroll
293
-
294
- - OrgChart.action.xScroll - left/right move of the chart on mouse scroll
295
-
296
- - OrgChart.action.yScroll - up/down move of the chart on mouse scroll
297
-
298
- - OrgChart.action.none - do nothing on mouse scroll
299
-
300
- Default value: OrgChart.action.zoom
301
-
302
-
303
- Code example:
304
- ```
305
- var chart = new OrgChart(document.getElementById("tree"), {
306
- mouseScrool: OrgChart.action.zoom
307
- });
308
- ```
309
- */
310
- mouseScrool?: OrgChart.action,
31
+ * Removes specified node from nodes collection
32
+ * @param id identification number of the node
33
+ */
34
+ remove(id: string | number): OrgChart;
311
35
  /**
312
- * Node binding in OrgChart JS maps node data to node template parameters.
313
-
314
- Code example:
315
- ```
316
- var chart = new OrgChart(document.getElementById("orgchart"), {
317
- nodeBinding: {
318
- field_0: "name"
319
- },
320
- nodes: [
321
- { id: 1, name: "Amber McKenzie" },
322
- { id: 2, pid: 1, name: "Ava Field" },
323
- { id: 3, pid: 1, name: "Peter Stevens" }
324
- ]
325
- });
326
- ```
327
- In the example above the field name will be bount to field_0 from the template.
328
-
329
- Also you can define your own field in the templae, for more information go to Fields page on our website.
36
+ * Adds new node to the nodes collection, redraws the chart and fires remove event
37
+ * @param data node data
38
+ * @param callback called at the end of animation
39
+ * @param fireEvent indicates if the add event will be called or not
330
40
  */
331
- nodeBinding?: Object,
41
+ addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
332
42
  /**
333
- * With the drag and drop features of OrgChart, you can move nodes easily.
334
- * Default value: true
335
-
336
- Code example:
337
- ```
338
- var chart = new OrgChart(document.getElementById("tree"), {
339
- enableDragDrop: true,
340
- });
341
- ```
342
- */
343
- enableDragDrop?: boolean,
344
- enableTouch?: boolean,
43
+ * Adds new node to the nodes collection
44
+ * @param data node data
45
+ */
46
+ add(data: object): OrgChart;
345
47
  /**
346
- * Enables edit, add, remove and other node operations. Also you can define your own node operation for more information see Node Menu Item
347
-
348
- Default value: null
349
-
350
- Code example:
351
- ```
352
- var chart = new OrgChart(document.getElementById("tree"), {
353
- nodeMenu:{
354
- details: {text:"Details"},
355
- edit: {text:"Edit"},
356
- add: {text:"Add"},
357
- remove: {text:"Remove"}
358
- },
359
- });
360
- ```
48
+ * Gets node data.
49
+ * @param id identification number of the node
361
50
  */
362
- nodeMenu?: Menu,
51
+ get(id: string | number): object;
363
52
  /**
364
- * Context menu. Also you can define your own node operation for more information see Menu
365
-
366
- Default value: null
367
-
368
- Code example:
369
- ```
370
- var chart = new OrgChart(document.getElementById("tree"), {
371
- nodeContextMenu:{
372
- details: {text:"Details"},
373
- edit: {text:"Edit"},
374
- add: {text:"Add"},
375
- remove: {text:"Remove"}
376
- },
377
- ...
378
- });
379
- ```
380
- */
381
- nodeContextMenu?: Menu,
53
+ * If specified node has assistant/s or partner/s as children will return false.
54
+ * @param id identification number of the node
55
+ */
56
+ canRemove(id: string | number): boolean;
382
57
  /**
383
- * Use dragDropMenu with drag & drop and grouping feature.
384
-
385
- Default value: null
386
-
387
- Code example:
388
- ```
389
- var chart = new OrgChart(document.getElementById("tree"), {
390
- dragDropMenu: {
391
- addInGroup: { text: "Add in group" },
392
- addAsChild: { text: "Add as child" }
393
- },
394
- });
395
- ```
396
- */
397
- dragDropMenu?: Menu,
58
+ * Expands specified nodes.
59
+ * @param id the id of the node that will not move during the animation
60
+ * @param ids node ids that will be expanded
61
+ * @param callback called after the animation completes
62
+ */
63
+ expand(id: string | number, ids: Array<string | number>, callback?: () => void): void;
398
64
  /**
399
- * Enables export to excel, export to svg and other OrgChart operations. Also you can define your own OrgChart operation for more information see OrgChart.ImportFormCSV
400
-
401
- Default value: null
402
-
403
- Code example:
404
- ```
405
- var chart = new OrgChart(document.getElementById("tree"), {
406
- menu: {
407
- svg: { text: "Export SVG" },
408
- csv: { text: "Export CSV" }
409
- },
410
- });
411
- ```
412
- */
413
- menu?: Menu,
65
+ * Collapses specified nodes.
66
+ * @param id the id of the node that will not move
67
+ * @param ids node ids that will be collapsed
68
+ * @param callback called after the animation completes
69
+ */
70
+ collapse(id: string | number, ids: Array<string | number>, callback?: () => void): void;
414
71
  /**
415
- * A toolbar is a set of icons or buttons.
416
-
417
- Default value: null
418
-
419
- Code example:
420
- ```
421
- var chart = new OrgChart(document.getElementById("tree"), {
422
- toolbar: {
423
- layout: true,
424
- zoom: true,
425
- fit: true,
426
- expandAll: false
427
- },
428
- ...
429
- });
430
- ```
72
+ * Expand/Collapse lists of nodes.
73
+ * @param id the id of the node that will not move
74
+ * @param expandIds expand all nodes with ids
75
+ * @param collapseIds collpase all nodes with ids
76
+ * @param callback called after the animation completes
431
77
  */
432
- toolbar?: Object,
78
+ expandCollapse(id: string | number, expandIds: Array<string | number>, collapseIds: Array<string | number>, callback?: () => void): void;
433
79
  /**
434
- * Stop the org chart locking to the top of the screen once you move it.
435
-
436
- Default value: true
437
-
438
- Code example:
439
- ```
440
- var chart = new OrgChart(document.getElementById("tree"), {
441
- sticky: false
442
- ...
443
- });
444
- ```
80
+ * Changes roots order.
81
+ * @param id id of a node that will not change is position, can be null
82
+ * @param roots roots id array in the required order
83
+ * @param callback called after the roots are changed and animation completes
445
84
  */
446
- sticky?: boolean,
85
+ changeRoots(id: string | number, roots: Array<string | number>, callback?: () => void): void;
447
86
  /**
448
- * nodeMouseClick can accept the following values:
449
-
450
- - OrgChart.action.edit - will open the edit view for the clicked node on the right hand side
451
-
452
- - OrgChart.action.details - will open the details view for the clicked node on the right hand side, the details view is very similar to the edit view the only difference is that is read only.
453
-
454
- - OrgChart.action.expandCollapse - will expand or collapse the children nodes
455
-
456
- - OrgChart.action.none - do nothing on node click event
457
-
458
- Default value: OrgChart.action.details
459
-
460
- Code example:
461
- ```
462
- var chart = new OrgChart(document.getElementById("tree"), {
463
- nodeMouseClick: OrgChart.action.edit
464
- });
465
- ```
87
+ * Maximize the node. Without parameters maximize all nodes.
88
+ * @param id the id of the node, if id is null, undefined ot empty string will maximize all nodes
89
+ * @param horizontalCenter center horizontally
90
+ * @param verticalCenter center vertically
91
+ * @param callback called when the animation completes
466
92
  */
467
- nodeMouseClick?: OrgChart.action,
468
-
469
-
470
-
93
+ maximize(id?: string | number, horizontalCenter?: boolean, verticalCenter?: boolean, callback?: () => void): void;
471
94
  /**
472
- * nodeMouseDbClick can accept the following values:
473
-
474
- - OrgChart.action.edit - will open the edit view for the clicked node on the right hand side
475
- - OrgChart.action.details - will open the details view for the clicked node on the right hand side, the details view is very similar to the edit view the only difference is that is read only.
476
- - OrgChart.action.expandCollapse - will expand or collapse the children nodes
477
- - OrgChart.action.none - do nothing on node double click event
478
-
479
- Default value: OrgChart.none
480
-
481
- Code example:
482
- ```
483
- var chart = new OrgChart(document.getElementById("tree"), {
484
- nodeMouseDbClick: OrgChart.action.edit
485
- ...
486
- });
487
- ```
95
+ * Minimize the node. Without parameters minimize all nodes.
96
+ * @param id the id of the node, if id is null, undefined ot empty string will minimize all nodes
97
+ * @param callback called when the animation completes
488
98
  */
489
- nodeMouseDbClick?: OrgChart.action,
99
+ minimize(id?: string | number, callback?: () => void): void;
490
100
  /**
491
- * showXScroll can accept the following values:
492
-
493
- - OrgChart.none
494
-
495
- - OrgChart.scroll.visible - Will display horisontal scroll bar
496
-
497
- Default value: OrgChart.none
498
-
499
- Code example:
500
- ```
501
- var chart = new OrgChart(document.getElementById("tree"), {
502
- showXScroll: OrgChart.scroll.visible
503
- });
504
- ```
505
- */
506
- showXScroll?: OrgChart.scroll,
101
+ * Load nodes data.
102
+ * @param data node data array
103
+ */
104
+ load(data: Array<object>): OrgChart;
507
105
  /**
508
- *
509
- * showYScroll can accept the following values:
510
-
511
- - OrgChart.none
512
-
513
- - OrgChart.scroll.visible - Will display vertical scroll bar
514
-
515
- Default value: OrgChart.none
516
-
517
- Code example:
518
- ```
519
- var chart = new OrgChart(document.getElementById("tree"), {
520
- showYScroll: OrgChart.scroll.visible
521
- });
522
- ```
523
- */
524
- showYScroll?: OrgChart.scroll,
106
+ * Loads nodes from xml.
107
+ * @param xml Xml with node structure
108
+ */
109
+ loadXML(xml: string): OrgChart;
525
110
  /**
526
- Set template if you want to change the appearance of the chart. OrgChart JS comes with number of build-in templates:
527
-
528
- - ana
529
- - ula
530
- - olivia
531
- - belinda
532
- - rony
533
- - mery
534
- - polina
535
- - mila
536
- - diva
537
- - luba
538
- - base
539
- - deborah
540
-
541
- Also you can define your own template. For more information see Creating Custom Template
542
-
543
- Default value: ana
544
-
545
- Code example:
546
- ```
547
- var chart = new OrgChart(document.getElementById("tree"), {
548
- template: "ana"
549
- });
550
- ```
551
- */
552
- template?: string,
111
+ * Gets nodes as xml.
112
+ */
113
+ getXML(): string;
553
114
  /**
554
- * With tags option you can:
555
-
556
- - Set specific template for tagged nodes
557
-
558
- - Set the default state (expand/collapse) for tagged nodes
559
-
560
- - Define a group for tagged nodes
561
-
562
- - Set node as assistant for tagged nodes
563
-
564
- - Set node menu items for tagged nodes
565
-
566
-
567
- Set specific template for tagged nodes. See Multiple Templates in one chart for more details.
568
-
569
- Code example:
570
- ```
571
- var chart = new OrgChart(document.getElementById("tree"), {
572
- tags: {
573
- Management: {
574
- template: "rony"
575
- }
576
- },
577
- nodes: [
578
- { id: 1, tags: ["Management"] },
579
- ]
580
- });
581
- ```
582
- Set the default state (expand/collapse) for tagged nodes. See Expand/Collapse for more details.
583
-
584
- Code example:
585
- ```
586
- var chart = new OrgChart(document.getElementById("tree"), {
587
- tags: {
588
- hide: {
589
- state: OrgChart.COLLAPSE
590
- }
591
- },
592
- nodes: [
593
- { id: "1" },
594
- { id: "2", tags: ["hide"] },
595
- { id: "3" }
596
- ]
597
- });
598
- ```
599
-
600
- Define a group for tagged nodes. See Grouping for more details.
601
-
602
- Code example:
603
- ```
604
- var chart = new OrgChart(document.getElementById("tree"), {
605
- tags: {
606
- HRs: {
607
- group: true,
608
- groupName: "HR Team",
609
- groupState: OrgChart.EXPAND,
610
- template: "group_grey"
611
- }
612
- },
613
- nodes: [
614
- { id: 1, tags: ["HRs"] }
615
- ]
616
- });
617
- ```
618
- Set node as assistant for tagged nodes. See Assistant for more details.
619
-
620
- Code example:
621
- ```
622
- var chart = new OrgChart(document.getElementById("tree"), {
623
- tags: {
624
- assistant: {
625
- template: "mery"
626
- }
627
- },
628
- nodes: [
629
- { id: 1, tags: ["assistant"] }
630
- ]
631
- });
632
- ```
633
-
634
- Set node menu items for tagged nodes. See Node Menu Item for more details.
635
-
636
- Code example:
637
- ```
638
- var chart = new OrgChart(document.getElementById("tree"), {
639
- tags:
640
- customMenuItems: {
641
- nodeMenu: {
642
- add: { text: "Add New" }
643
- }
644
- }
645
- },
646
- });
647
- ```
115
+ * Draws the chart.
116
+ * @param action Action for example OrgChart.action.centerNode, default is OrgChart.action.update
117
+ * @param actionParams parameters for the action
118
+ * @param callback called when the animation completes
648
119
  */
649
- tags?: Tags,
120
+ draw(action?: OrgChart.action, actionParams?: any, callback?: () => void): void;
650
121
  /**
651
- * Link binding in OrgChart JS maps node data to link template parameters.
652
-
653
- Code example:
654
- ```
655
- var chart = new OrgChart(document.getElementById("tree"), {
656
- linkBinding: {
657
- link_field_0: "createdAt"
658
- },
659
- nodes: [
660
- { id: "1", name: "Amber McKenzie" },
661
- { id: "2", pid: "1", createdAt: "Since 08/08/2018" },
662
- { id: "3", pid: "1", createdAt: "Since 05/04/2018" }
663
- ]
664
- });
665
- ```
666
- */
667
- linkBinding?: Object,
122
+ * Gets the width of the container.
123
+ */
124
+ width(): number;
668
125
  /**
669
- * Search by the fields defined in searchFields.
670
-
671
- Default value: Empty array
672
-
673
- Code example:
674
- ```
675
- var chart = new OrgChart(document.getElementById("tree"), {
676
- searchFields: ["name", "title", etc...],
677
- ...
678
- });
679
- ```
680
- */
681
- searchFields?: Array<string>,
126
+ * Gets the height of the container.
127
+ */
128
+ height(): number;
682
129
  /**
683
- * Array of node data JSON objects. nodes option is the data source of the chart.
684
-
685
- Code example:
686
- ```
687
- var chart = new OrgChart(document.getElementById("tree"), {
688
- ...
689
- nodes: [
690
- { id: "1" },
691
- { id: "2", pid: "1" },
692
- { id: "3", pid: "1", tags: ["Sales"] }
693
- ]
694
- });
695
- ```
696
- Node JSON objects could have unlimited number of properties, id, pid and tags are reserved node properties.
697
-
698
- - id - unique identifier, it clould be integer or string
699
- - pid - is the parent id
700
- - tags - array of strings
701
-
130
+ * Gets the view box attribute of the svg html element.
702
131
  */
703
- nodes?: Array<Object>,
132
+ getViewBox(): Array<number>;
704
133
  /**
705
- * Add C link.
706
-
707
- Default value: null
708
-
709
- Code example:
710
- ```
711
- var chart = new OrgChart(document.getElementById('tree'), {
712
- clinks: [
713
- {from: 4, to: 0, label: 'text'},
714
- {from: 4, to: 5, template: 'blue', label: '4 reports to 5' },
715
- {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' },
716
- ]
717
- ...
718
- });
719
- ```
134
+ * Sets the view box attribute of the svg html element.
135
+ * @param viewBox
720
136
  */
721
- clinks?: Array<Object>,
137
+ setViewBox(viewBox: Array<number>): void;
722
138
  /**
723
- * Add S link.
724
-
725
- Default value: null
726
-
727
- Code example:
728
- ```
729
- var chart = new OrgChart(document.getElementById('tree'), {
730
- slinks: [
731
- {from: 4, to: 0, label: 'text'},
732
- {from: 4, to: 5, template: 'blue', label: 'reports to' },
733
- {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' },
734
- ]
735
- ...
736
- });
737
- ```
139
+ * Gets the current scale of the chart.
140
+ * @param viewBox
738
141
  */
739
- slinks?: Array<Object>,
142
+ getScale(viewBox?: Array<number>): void;
740
143
  /**
741
- * The gap between each level.
742
-
743
- Default value: 60
744
-
745
- Code example:
746
- ```
747
- var chart = new OrgChart(document.getElementById("tree"), {
748
- ...
749
- levelSeparation: 50
750
- });
751
- ```
752
- */
753
- levelSeparation?: number,
144
+ * Animates specified node with ripple animation - highlight the node.
145
+ * @param id the id of the node
146
+ * @param clientX x value of the ripple center in the node
147
+ * @param clientY y value of the ripple center in the node
148
+ */
149
+ ripple(id: string | number, clientX?: number, clientY?: number): void;
754
150
  /**
755
- * The gap between nodes in a subtree.
756
-
757
- Default value: 20
758
-
759
- Code example:
760
- ```
761
- var chart = new OrgChart(document.getElementById("tree"), {
762
- ...
763
- siblingSeparation: 50
764
- });
765
- ```
151
+ * Centers specified node on the screen.
152
+ * @param nodeId the id of the node
153
+ * @param options { parentState: OrgChart.COLLAPSE_PARENT_NEIGHBORS, childrenState: OrgChart.COLLAPSE_SUB_CHILDRENS, rippleId: rippleId, vertical: false, horizontal: false });
154
+ * @param callback called when the animation completes
766
155
  */
767
- siblingSeparation?: number,
156
+ center(nodeId: string | number, options?: {
157
+ parentState: unknown,
158
+ childrenState: unknown,
159
+ rippleId: string | number,
160
+ vertical: boolean,
161
+ horizontal: boolean
162
+ }, callback?: () => void): void;
768
163
  /**
769
- * The gap between subtrees.
770
-
771
- Default value: 40
772
-
773
- Code example:
774
- ```
775
- var chart = new OrgChart(document.getElementById("tree"), {
776
- ...
777
- subtreeSeparation: 50
778
- });
779
- ```
780
- */
781
- subtreeSeparation?: number,
164
+ * Fits the content to the visible area.
165
+ * @param callback called when the animation completes
166
+ */
167
+ fit(callback?: () => void): void;
782
168
  /**
783
- * The gap between nodes in vertical layout.
784
-
785
- Default value: 20
786
-
787
- Code example:
788
- ```
789
- var chart = new OrgChart(document.getElementById("tree"), {
790
- ...
791
- mixedHierarchyNodesSeparation: 5
792
- });
793
- ```
794
- */
795
- mixedHierarchyNodesSeparation?: number,
169
+ * Toggles full screen mode.
170
+ */
171
+ toggleFullScreen(): void;
796
172
  /**
797
- * The padding option sets the padding area on all four sides of the OrgChart.
798
-
799
- Default value: 30
800
-
801
- Code example:
802
- ```
803
- var chart = new OrgChart(document.getElementById("tree"), {
804
- ...
805
- padding: 20
806
- });
807
- ```
173
+ * Gets the node as {@link OrgChart.node} object.
174
+ * @param nodeId
808
175
  */
809
- padding?: number,
176
+ getNode(nodeId: string | number): OrgChart.node;
810
177
  /**
811
- * The layout of the OrgChart
812
-
813
- - OrgChart.normal
814
- - OrgChart.mixed
815
- - OrgChart.tree
816
- - OrgChart.treeLeftOffset
817
- - OrgChart.treeRightOffset
818
- Default value: OrgChart.normal
819
-
820
- Code example:
821
- ```
822
- var chart = new OrgChart(document.getElementById("tree"), {
823
- ...
824
- layout: OrgChart.mixed
825
- });
826
- ```
178
+ * Sets layout.
179
+ * @param layout layout type
180
+ * @param lcn lyout config name for the specified sub tree
827
181
  */
828
- layout?: OrgChart,
182
+ setLayout(layout: OrgChart.layout | number, lcn?: string): void;
829
183
  /**
830
- * The scale factor determines what fraction of the entire scale is visible at one time.
831
-
832
- - OrgChart.match.height
833
- - OrgChart.match.width
834
- - OrgChart.match.boundary
835
- - [float]
836
-
837
- Default value: 1
838
-
839
- Code example:
840
- ```
841
- var chart = new OrgChart(document.getElementById("tree"), {
842
- ...
843
- scaleInitial: 0.5
844
- });
845
- ```
846
- For more information go to Layout page on our website.
184
+ * Sets orientation.
185
+ * @param orientation orientation type
186
+ * @param lcn lyout config name for the specified sub tree
847
187
  */
848
- scaleInitial?: OrgChart.match | number,
188
+ setOrientation(orientation: OrgChart.orientation, lcn?: string): void;
849
189
  /**
850
- * Determines the minimum scale factor.
851
-
852
- Default value: 0.1
853
-
854
- Code example:
855
- ```
856
- var chart = new OrgChart(document.getElementById("tree"), {
857
- ...
858
- scaleMin: 0.2
859
- });
860
- ```
861
- */
862
- scaleMin?: number,
190
+ * Search in the chart.
191
+ * @param value search for value
192
+ * @param searchInFileds search in field names
193
+ * @param retrieveFields retrive data for fields
194
+ * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
195
+ */
196
+ search(value: string, searchInFileds?: Array<string>, retrieveFields?: Array<string>): void;
863
197
  /**
864
- * Determines the naximum scale factor.
865
-
866
- Default value: 5
867
-
868
- Code example:
869
- ```
870
- var chart = new OrgChart(document.getElementById("tree"), {
871
- ...
872
- scaleMax: 10
873
- });
874
- ```
875
- */
876
- scaleMax?: number,
198
+ * Gets collpased node ids of the specifeid node
199
+ * @param node
200
+ */
201
+ getCollapsedIds(node: OrgChart.node): Array<string | number>;
877
202
  /**
878
- * The orderBy option is used to sort the nodes in ascending order by specified field. The default order is by nodes order in the nodes array.
879
-
880
- Default value: null
881
-
882
- Code example:
883
- ```
884
- var chart = new OrgChart(document.getElementById("tree"), {
885
- ...
886
- orderBy: "orderId",
887
- nodes: [
888
- ...
889
- { id: 10, pid: 1, orderId: 2 },
890
- { id: 11, pid: 1, orderId: 1 }
891
- ...
892
- ]
893
- });
894
- ```
895
- In the example above node with id 11 will be before node with id 10. orderBy can be set to any property from the node JSON object, string or integer.
896
-
897
-
203
+ * State to url.
204
+ * {@link https://balkan.app/OrgChartJS/Docs/State | See doc...}
898
205
  */
899
- orderBy?: string,
900
- editUI?: Object,
901
- searchUI?: Object,
902
- xScrollUI?: Object,
903
- yScrollUI?: Object,
904
- nodeMenuUI?: Object,
905
- nodeContextMenuUI?: Object,
906
- toolbarUI?: Object,
907
- notifierUI?: Object,
908
- //dragDropMenuUI?: Object, // removed
909
- menuUI?: Object,
910
- /**
911
- * The URL to the export server.
912
-
913
- Default value: https://balkan.app/export
914
-
915
- Code example:
916
- ```
917
- var chart = new OrgChart(document.getElementById("tree"), {
918
- exportUrl: "https://balkan.app/export",
919
- ...
920
- });
921
- ```
922
- */
923
- exportUrl?: string,
206
+ stateToUrl(): string;
924
207
  /**
925
- * Collapse specified level of the chart and its children if allChildren is true.
926
-
927
- Code example:
928
- ```
929
- var chart = new OrgChart(document.getElementById("tree"), {
930
- collapse: {
931
- level: 2,
932
- allChildren: true
933
- },
934
- ...
935
- });
936
- ```
208
+ * Genereates unique identification number that can be used for new nodes
937
209
  */
938
- collapse?: Object,
210
+ generateId(): string;
939
211
  /**
940
- * Expand specified node ids and its children if allChildren is true.
941
-
942
- The expand option works only if collapse is set.
943
-
944
- In the example above the second level of the chart will be collapsed but node with id 155 and its children will be expanded.
945
-
946
- Code example:
947
- ```
948
- var chart = new OrgChart(document.getElementById("tree"), {
949
- collapse: {
950
- level: 2,
951
- allChildren: true
952
- },
953
- expand:{
954
- nodes: [155],
955
- allChildren: true
956
- }
957
- ...
958
- });
959
- ```
212
+ * Destroys the object.
960
213
  */
961
- expand?: Object,
214
+ destroy(): void;
962
215
  /**
963
- * The align option specifies the alignment of the nodes inside OrgChart JS.
964
-
965
- Default value: OrgChart.CENTER
966
-
967
- - OrgChart.CENTER - centered
968
- - OrgChart.ORIENTATION - according to the orientation option
969
-
970
- Code example:
971
- ```
972
- var chart = new OrgChart(document.getElementById("tree"), {
973
- align: OrgChart.ORIENTATION,
974
- ...
975
- });
976
- ```
216
+ * Adds curved link.
217
+ * @param from from node with id
218
+ * @param to to node with id
219
+ * @param label link label
220
+ * @param template link template, for example 'orange'
977
221
  */
978
- align?: OrgChart,
979
- UI?: OrgChart,
980
- /**
981
- *Can be used to control the transition of the nodes on expand/collapse operation.
982
-
983
- Default value: func: OrgChart.anim.outPow, duration: 200
984
-
985
- duration: defines how long time an animation should take to complete
986
-
987
- func: Easing functions specify the speed at which an animation progresses at different points within the animation. Can accept one of the following values:
988
-
989
- - OrgChart.anim.inPow
990
- - OrgChart.anim.outPow
991
- - OrgChart.anim.inOutPow
992
- - OrgChart.anim.inSin
993
- - OrgChart.anim.outSin
994
- - OrgChart.anim.inOutSin
995
- - OrgChart.anim.inExp
996
- - OrgChart.anim.outExp
997
- - OrgChart.anim.inOutExp
998
- - OrgChart.anim.inCirc
999
- - OrgChart.anim.outCirc
1000
- - OrgChart.anim.inOutCirc
1001
- - OrgChart.anim.rebound
1002
- - OrgChart.anim.inBack
1003
- - OrgChart.anim.outBack
1004
- - OrgChart.anim.inOutBack
1005
-
1006
- Code example:
1007
- ```
1008
- var chart = new OrgChart(document.getElementById("tree"), {
1009
- anim: {
1010
- func: OrgChart.anim.outBack,
1011
- duration: 500
1012
- },
1013
- ...
1014
- });
1015
- ```
1016
- */
1017
- anim?: Object,
222
+ addClink(from: string | number, to: string | number, label?: string, template?: string): OrgChart;
1018
223
  /**
1019
- * Can be used to control the zooming sensitivity.
1020
-
1021
- Default value: speed: 120, smooth: 12
1022
-
1023
- Code example:
1024
- ```
1025
- var chart = new OrgChart(document.getElementById("tree"), {
1026
- zoom: {
1027
- speed: 130,
1028
- smooth: 10
1029
- },
1030
- ...
1031
- });
1032
- ```
224
+ * Removes curved link.
225
+ * @param from from node with id
226
+ * @param to to node with id
1033
227
  */
1034
- zoom?: Object,
1035
- roots?: Array<number>,
1036
- onUpdate?: string,
1037
- onRemove?: string,
1038
- onAdd?: string,
1039
- onRedraw?: string,
1040
- onImageUploaded?: string,
1041
- onClick?: string,
1042
- onDbClick?: string,
1043
- onExpCollClick?: string | Function,
1044
- onExportStart?: string | Function,
1045
- onExportEnd?: string | Function,
1046
- onSearchClick?: string | Function,
1047
- onReady?: string | Function,
1048
- assistantSeparation?: number,
1049
- columns?: number,
1050
-
1051
- state?: Object,
1052
-
1053
- minPartnerSeparation?: number,
1054
- partnerChildrenSplitSeparation?: number,
1055
- partnerNodeSeparation?: number,
1056
- miniMap?: boolean,
1057
-
1058
- searchFieldsWeight?: Object,
1059
- searchDisplayField?: String,
1060
-
1061
- enableKeyNavigation?: boolean,
1062
- nodeCircleMenu?: Object,
1063
-
1064
- editForm?: Object
1065
-
1066
- }
1067
-
1068
-
1069
-
1070
- declare class OrgChart {
1071
- nodes: Array<Node>;
1072
- nodeCircleMenuUI: any;
1073
- editUI: any;
1074
- menuUI: any;
1075
- nodeMenu: any;
1076
- nodeMenuUI: any;
1077
- toolbarUI: any;
1078
- nodeContextMenuUI: any;
1079
- config: any;
1080
- // static searchUI: any;
1081
- searchUI: any;
1082
- _layoutConfigs: any;
1083
-
1084
- constructor(element: HTMLElement, options: OrgChartOptions);
1085
-
1086
-
1087
- /**
1088
- * Returns the node data for given node id
1089
- *
1090
- Signature:
1091
- ```
1092
- chart.get(nodeId);
1093
- ```
1094
- Code example:
1095
- ```
1096
- var node = chart.get(5);
1097
- ```
1098
- * @param nodeId
1099
-
1100
- * Returns JSON data */
1101
-
1102
- get(nodeId: string | number) : Node;
1103
-
228
+ removeClink(from: string | number, to: string | number): OrgChart;
229
+ /**
230
+ * Adds second link.
231
+ * @param from from node with id
232
+ * @param to to node with id
233
+ * @param label link label
234
+ * @param template link template, for example 'orange'
235
+ */
236
+ addSlink(from: string | number, to: string | number, label?: string, template?: string): OrgChart;
237
+ /**
238
+ * Removes second link.
239
+ * @param from from node with id
240
+ * @param to to node with id
241
+ */
242
+ removeSlink(from: string | number, to: string | number): OrgChart;
243
+ /**
244
+ * Gets svg html element
245
+ */
246
+ getSvg(): SVGAElement;
1104
247
  /**
1105
- * Updates the node JSON object.
1106
- *
1107
- * Signature:
1108
- ```
1109
- chart.updateNode(nodeJSONdata, callback, fireEvent);
1110
- ```
1111
- * Parameters:
1112
- * @param nodeJSONdata - node json data
1113
- * @param callback - (optional) callback function cakked when the animation colpletes
1114
- * @param fireEvent - (optional) if it set to true the update event is called
1115
- *
1116
- * Code example:
1117
- ```
1118
- chart.updateNode({ id: 4, pid: 2, name: "Updated Name", title: "Updated Title" });
1119
- ```
1120
- Will update the node with id 4 and will redraw the chart.
1121
- */
1122
-
1123
- updateNode(nodeJSONdata: Object, callback?: Function, fireEvent?: boolean) : void;
1124
-
1125
- /**
1126
- * Updates the node JSON object.
1127
- *
1128
- * Signature:
1129
- ```
1130
- chart.update(nodeJSONdata);
1131
- ```
1132
- *
1133
- Parameters:
1134
- * @param nodeJSONdata - node json data
1135
- *
1136
- Code example:
1137
- ```
1138
- chart.update({ id: 4, pid: 2, name: "Updated Name", title: "Updated Title" });
1139
- ```
1140
- Will find the node with id 4 but it will not redraw the chart, you can use this method when you need to update two or more nodes, then call the draw function. Returns the chart object.
1141
- */
1142
- update(nodeJSONdata: Object) : Object;
1143
-
1144
- /**
1145
- * Removes specified node from nodes collection.
1146
- *
1147
- * Signature:
1148
- ```
1149
- chart.removeNode(nodeId, callback, fireEvent);
1150
- ```
1151
- * Parameters:
1152
- * @param nodeId - id of the node
1153
- * @param callback - (optional) callback function will be called at the end of animation
1154
- * @param fireEvent - (optional) indicates if the remove event will be called or not
1155
- *
1156
- * Code example:
1157
- ```
1158
- chart.removeNode(5);
1159
- ```
1160
- Will remove node with id 5 and will redraw the chart.
1161
- */
1162
-
1163
- removeNode(nodeId: string | number, callback?: Function, fireEvent?: boolean): void;
1164
-
248
+ * Gets node html element
249
+ * @param id node id
250
+ */
251
+ getNodeElement(id: string | number): HTMLElement;
1165
252
  /**
1166
- *Removes specified node from nodes collection.
1167
-
1168
- Signature:
1169
- ```
1170
- chart.remove(nodeId);
1171
- ```
1172
- Parameters:
1173
-
1174
- * @param nodeId - id of the node
1175
- *
1176
- Code example:
1177
- ```
1178
- chart.remove(5);
1179
- ```
1180
- Will remove node with id 5 but it will not redraw the chart, you can use this method when you need to remove two ore more nodes, then call the draw function. Returns the chart object.
253
+ * Gets menu button html element
1181
254
  */
1182
- remove(nodeId: string | number): Object;
1183
-
255
+ getMenuButton(): HTMLElement;
1184
256
  /**
1185
- * * Adds new node to the nodes collection.
1186
- *
1187
- * Signature:
1188
- ```
1189
- chart.addNode(nodeJSONdata, callback, fireEvent);
1190
- ```
1191
- *
1192
- Parameters:
1193
- * @param nodeJSONdata - node JSON data
1194
- * @param callback - (optional) callback function will be called at the end of animation
1195
- * @param fireEvent - (optional) indicates if the add event will be called or not
1196
- *
1197
- * Code example:
1198
- ```
1199
- chart.addNode({ id: 4, pid: 2, name: "Name 1", title: "Title 1" });
1200
- ```
257
+ * Exports the details form to PDF.
258
+ * @param options export options
259
+ * @param callback called when the export completes
260
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
1201
261
  */
1202
-
1203
- addNode(nodeJSONdata: Object, callback?: Function, fireEvent?: boolean): void;
1204
-
262
+ exportPDFProfile(options: OrgChart.exportOptions, callback?: () => void): void;
1205
263
  /**
1206
- * Adds new node to the nodes collection.
1207
-
1208
- Signature:
1209
- ```
1210
- chart.add(nodeJSONdata);
1211
- ```
1212
- Parameters:
1213
-
1214
- * @param nodeJSONdata - node JSON data
1215
- *
1216
- Code example:
1217
- ```
1218
- chart.add({ id: 4, pid: 2, name: "Name 1", title: "Title 1" });
1219
- ```
1220
- Will add new node but it will not redraw the chart, you can use this method when you need add two or more nodes, then call the draw function. Returns the chart object.
264
+ * Exports the details form to PDF.
265
+ * @param options export options
266
+ * @param callback called when the export completes
267
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
1221
268
  */
1222
- add(nodeJSONdata: Object) : Object;
1223
-
269
+ exportPNGProfile(options: OrgChart.exportOptions, callback?: () => void): void;
1224
270
  /**
1225
- * Adds a link between two nodes.
1226
-
1227
- Signature:
1228
- ```
1229
- chart.link(fromNodeId, toNodeId);
1230
- ```
1231
-
1232
- Parameters:
1233
-
1234
- - fromNodeId - the id of the child node
1235
- - toNodeId - the id of the parent node
1236
-
1237
- Code example:
1238
- ```
1239
- chart.link(5, 6);
1240
- ```
1241
- It will create a link from node 5 to node 6.
1242
- * @param fromNodeId
1243
- * @param toNodeId
271
+ * Exports to CSV
272
+ * @param id if not defained exports all nodes if defined exports childrens
273
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
1244
274
  */
1245
- link(fromNodeId: string | number, toNodeId: string | number): void;
1246
-
275
+ exportCSV(id?: string | number): void;
1247
276
  /**
1248
- * Adds a link between two nodes.
1249
-
1250
- Signature:
1251
- ```
1252
- chart.linkNode(fromNodeId, toNodeId);
1253
- ```
1254
- Parameters:
1255
-
1256
- - fromNodeId - the id of the child node
1257
- - toNodeId - the id of the parent node
1258
-
1259
- Code example:
1260
- ```
1261
- chart.linkNode(5, 6);
1262
- ```
1263
- It will create a link from node 5 to node 6 and will redraw the chart.
1264
- * @param fromNodeId
1265
- * @param toNodeId
277
+ * Shares node data, uses build-in device sharing functionallity.
278
+ * @param id node id
279
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
1266
280
  */
1267
- linkNode(fromNodeId: string | number, toNodeId: string | number) : void;
1268
-
281
+ shareProfile(id: string | number): void;
1269
282
  /**
1270
- * Center specified node on the screen.
1271
-
1272
- Signature:
1273
- ```
1274
- chart.center(nodeId, options, callback);
1275
- ```
1276
- Parameters:
1277
-
1278
- - nodeId - the id of the node
1279
- - options - { parentState: OrgChart.COLLAPSE_PARENT_NEIGHBORS, childrenState: OrgChart.COLLAPSE_SUB_CHILDRENS, rippleId: rippleId, vertical: false, horizontal: false });
1280
- - callback - callback function (optional)
1281
-
1282
- Code example:
1283
- ```
1284
- chart.center(5, {
1285
- parentState: OrgChart.COLLAPSE_PARENT_NEIGHBORS,
1286
- childrenState: OrgChart.COLLAPSE_SUB_CHILDRENS,
1287
- rippleId: 1,
1288
- vertical: true,
1289
- horizontal: false
1290
- }););
1291
- ```
1292
- * @param nodeId
1293
- * @param options
1294
- * @param callback
283
+ * Exports to PDF document
284
+ * @param options export options
285
+ * @param callback called when the export completes
286
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
1295
287
  */
1296
- center(nodeId: string | number, options: Object, callback?: Function ) : void;
1297
-
288
+ exportPDF(options?: OrgChart.exportOptions, callback?: () => void): void;
1298
289
  /**
1299
- * Animate specified node with ripple animation - highlight the node.
1300
-
1301
- Signature:
1302
- ```
1303
- chart.ripple(nodeId);
1304
- ```
1305
- Parameters:
1306
-
1307
- - nodeId - the id of the node
1308
-
1309
- Code example:
1310
- ```
1311
- chart.ripple(5);
1312
- ```
1313
- * @param nodeId
290
+ * Exports to PNG document
291
+ * @param options export options
292
+ * @param callback called when the export completes
293
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
1314
294
  */
1315
- ripple(nodeId: string | number) : void;
1316
-
295
+ exportPNG(options?: OrgChart.exportOptions, callback?: () => void): void;
1317
296
  /**
1318
- * Gets the current scale of the chart.
1319
-
1320
- Signature:
1321
- ```
1322
- chart.getScale();
1323
- ```
1324
- Code example:
1325
- ```
1326
- var scale = chart.getScale();
1327
- ```
1328
- */
1329
- getScale() : number;
1330
-
297
+ * Exports to SVG document
298
+ * @param options export options
299
+ * @param callback called when the export completes
300
+ * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
301
+ */
302
+ exportSVG(options?: OrgChart.exportOptions, callback?: () => void): void;
1331
303
  /**
1332
- * Zoom out or zoom in the chart.
1333
-
1334
- Signature:
1335
- ```
1336
- chart.zoom(delta, center, anim, callback);
1337
- ```
1338
- Parameters:
1339
-
1340
- - 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.
1341
- - center - Array [x, y], where x is x percantege from the width and y is y percentage from the height. (optional)
1342
- - anim - true, false (optional)
1343
- - callback - callback frunction (optional)
1344
-
1345
- Code example:
1346
- ```
1347
- chart.zoom(2, [20,20]);
1348
- ```
1349
- * @param delta
1350
- * @param center
1351
- * @param [anim]
1352
- * @param callback
304
+ * Imports CSV file.
305
+ * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
1353
306
  */
1354
- zoom(delta: boolean | number, center: Array<number>, anim? : boolean, callback?: Function) : void;
1355
-
307
+ importCSV(): void;
1356
308
  /**
1357
- * Exports the chart to svg file.
1358
-
1359
- Signature:
1360
- ```
1361
- chart.exportSVG(options, callback);
1362
- ```
1363
-
1364
- Code example:
1365
- ```
1366
- chart.exportSVG({
1367
- filename: "MyOrgChart.svg",
1368
- nodeId: 5,
1369
- openInNewTab: false,
1370
- expandChildren: true,
1371
- padding: 10
1372
- });
1373
- ```
1374
- Parameters:
1375
- * @param options - export options
1376
- * @param callback - (optional) calls when the export completes
309
+ * Imports XML file.
310
+ * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
311
+ */
312
+ importXML(filename?: string): void;
313
+ /**
314
+ * Zoom out or zoom in the chart.
315
+ * @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.
316
+ * @param center array [x, y], where x is x percantege from the width and y is y percentage from the height.
317
+ * @param shouldAnimate should animate
318
+ * @param callback called when the animation completes
1377
319
  */
320
+ zoom(delta: boolean | number, center?: Array<number>, shouldAnimate?: boolean, callback?: () => void): void;
1378
321
 
1379
- exportSVG(options: Object, callback?: Function) : void;
1380
322
 
1381
323
  /**
1382
- * Exports the chart to png file.
1383
-
1384
- Signature:
1385
- ```
1386
- chart.exportPNG(options, callback);
1387
-
1388
- ```
1389
- Parameters:
1390
-
1391
- * @param options - export options
1392
- * @param callback - (optional) calls when the export completes
1393
-
1394
- Code example:
1395
- ```
1396
- chart.exportPNG({
1397
- filename: "MyOrgChart.png",
1398
- nodeId: 5,
1399
- openInNewTab: false,
1400
- expandChildren: true,
1401
- margin: [10,20,10,20],
1402
- padding: 10
1403
- });
1404
- ```
324
+ * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
325
+ * @category Event Listeners
326
+ * @param type A case-sensitive string representing the event type to listen for.
327
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
1405
328
  */
1406
- exportPNG(options: Object, callback?: Function) : void;
329
+ 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" | "import" | "adding" | "added" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "removed" | "ready" | "ripple", listener: (sender: OrgChart, args: unknown, args1: unknown, args2: unknown) => void | boolean): OrgChart;
1407
330
 
1408
331
  /**
1409
- * Exports the chart to pdf file.
1410
-
1411
- Signature:
1412
- ```
1413
- chart.exportPDF(options, callback);
1414
- ```
1415
- Parameters:
1416
-
1417
- * @param options - export options
1418
- * @param callback - (optional) calls when the export completes
1419
-
1420
- Code example:
1421
- ```
1422
- chart.exportPDF({
1423
- landscape: true, //false
1424
- format: "A4", //fit
1425
- filename: "MyOrgChart.pdf",
1426
- nodeId: 5,
1427
- openInNewTab: false,
1428
- expandChildren: true,
1429
- margin: [10,20,10,20],
1430
- padding: 10,
1431
- header: 'My header',
1432
- footer: 'Page {current-page} of {total-pages}',
1433
- scale: 'fit' //100
1434
- });
1435
- ```
1436
-
332
+ * The onField() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target.
333
+ * ```typescript
334
+ * var chart = new OrgChart('#tree', {});
335
+ * chart.onField((args) => {
336
+ * //return false; to cancel
337
+ * });
338
+ * ```
339
+ * @category Event Listeners
340
+ * @param listener
1437
341
  */
1438
- exportPDF(options: Object, callback?: Function) : void;
342
+ onField(listener: (args: {
343
+ /**
344
+ * the node
345
+ */
346
+ node: OrgChart.node,
347
+ /**
348
+ * node data json object
349
+ */
350
+ data: object,
351
+ /**
352
+ * value of the filed, can be changed in the event
353
+ */
354
+ value: unknown,
355
+ /**
356
+ * svg or html element of the filed, can be changed in the event
357
+ */
358
+ element: string,
359
+ /**
360
+ * name of the field
361
+ */
362
+ name: string
363
+ }) => void | boolean): OrgChart;
1439
364
 
1440
365
  /**
1441
- * Exports the chart to CSV file.
1442
-
1443
- Signature:
1444
- ```
1445
- chart.exportCSV(filename);
1446
- ```
1447
- Parameters:
1448
-
1449
- * @param filename - optional
1450
-
1451
-
1452
- Code example:
1453
- ```
1454
- chart.exportCSV("MyOrgChart.svg");
1455
- ```
1456
-
366
+ * Occurs when the nodes in OrgChart has been created and loaded to the DOM.
367
+ * ```typescript
368
+ * var chart = new OrgChart('#tree', {});
369
+ * chart.onInit(() => {
370
+ * });
371
+ * ```
372
+ * @category Event Listeners
373
+ * @param listener
1457
374
  */
1458
- exportCSV(filename?: String) : void;
1459
-
375
+ onInit(listener: () => void): OrgChart;
376
+
377
+ /**
378
+ * Occurs when the node data has been updated by updateNode method.
379
+ * ```typescript
380
+ * var chart = new OrgChart('#tree', {});
381
+ * chart.onUpdateNode((args) => {
382
+ * //return false; to cancel the operation
383
+ * });
384
+ * ```
385
+ * @category Event Listeners
386
+ * @param listener
387
+ */
388
+ onUpdateNode(listener: (args: {
389
+ /**
390
+ * old node data
391
+ */
392
+ oldData: object,
393
+ /**
394
+ * new node data
395
+ */
396
+ newData: object
397
+ }) => void): OrgChart;
398
+ /**
399
+ * Occurs when a node has been removed by removeNode method.
400
+ * ```typescript
401
+ * var chart = new OrgChart('#tree', {});
402
+ * chart.onRemoveNode((args) => {
403
+ * //return false; to cancel the operation
404
+ * });
405
+ * ```
406
+ * @category Event Listeners
407
+ * @param listener
408
+ */
409
+ onRemoveNode(listener: (args: {
410
+ /**
411
+ * node id
412
+ */
413
+ id: number | string,
414
+ /**
415
+ * 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.
416
+ */
417
+ newPidsAndStpidsForIds: {
418
+ newPidsForIds: {[key: string | number] : string | number},
419
+ newStpidsForIds: {[key: string | number] : string | number}
420
+ }}) => void): OrgChart;
421
+
422
+ /**
423
+ * Occurs when a node has been added by addNode method.
424
+ * ```typescript
425
+ * var chart = new OrgChart('#tree', {});
426
+ * chart.onAddNode((args) => {
427
+ * //return false; to cancel the operation
428
+ * });
429
+ * ```
430
+ * @category Event Listeners
431
+ * @param listener
432
+ */
433
+ onAddNode(listener: (args: {
434
+ /**
435
+ * new added data node
436
+ */
437
+ data: object
438
+ }) => void): OrgChart;
439
+ /**
440
+ * The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
441
+ * ```typescript
442
+ * var chart = new OrgChart('#tree', {});
443
+ * chart.onDrag(() => {
444
+ * //return false; to cancel the operation
445
+ * });
446
+ * ```
447
+ * @category Event Listeners
448
+ * @param listener
449
+ */
450
+ onDrag(listener: (args: {
451
+ /**
452
+ * dragged node id
453
+ */
454
+ dragId: string | number
455
+ }) => void): OrgChart;
456
+ /**
457
+ * The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
458
+ * ```typescript
459
+ * var chart = new OrgChart('#tree', {});
460
+ * chart.onDrop(() => {
461
+ * //return false; to cancel the operation
462
+ * });
463
+ * ```
464
+ * @category Event Listeners
465
+ * @param listener
466
+ */
467
+ onDrop(listener: (args: {
1460
468
  /**
1461
- * Exports the chart to XML file.
469
+ * dragged node id
470
+ */
471
+ dragId: string | number,
472
+ /**
473
+ * dropped node id
474
+ */
475
+ dropId: string | number
476
+ }) => void): OrgChart;
1462
477
 
1463
- Signature:
1464
- ```
1465
- chart.exportXML(filename);
1466
- ```
1467
- Parameters:
478
+ /**
479
+ * The onRedraw event occurs when the chart is redrawed.
480
+ * ```typescript
481
+ * var chart = new OrgChart('#tree', {});
482
+ * chart.onRedraw(() => {
483
+ * });
484
+ * ```
485
+ * @category Event Listeners
486
+ * @param listener
487
+ */
488
+ onRedraw(listener: () => void): OrgChart;
489
+
490
+ /**
491
+ * The onExpandCollpaseButtonClick event occurs when the chart is redrawed.
492
+ * ```typescript
493
+ * var chart = new OrgChart('#tree', {});
494
+ * chart.onExpandCollpaseButtonClick(() => {
495
+ * //return false; to cancel the operation
496
+ * });
497
+ * ```
498
+ * @category Event Listeners
499
+ * @param listener
500
+ */
501
+ onExpandCollpaseButtonClick(listener: (args: {
502
+ /**
503
+ * Indicates id the operation is collaps or expand
504
+ */
505
+ collapsing: boolean,
506
+ /**
507
+ * the id of the clicked node
508
+ */
509
+ id: number | string,
510
+ /**
511
+ * node ids that will be expanded or collapsed
512
+ */
513
+ ids: Array<number | string>
514
+ }) => void): OrgChart;
515
+ /**
516
+ * 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.
517
+ * ```typescript
518
+ * var chart = new OrgChart('#tree', {});
519
+ * chart.onExporStart(() => {
520
+ * args.styles += '<link href="https://fonts.googleapis.com/css?family=Gochi+Hand" rel="stylesheet">';
521
+ * //return false; to cancel the operation
522
+ * });
523
+ * ```
524
+ * @category Event Listeners
525
+ * @param listener
526
+ */
527
+ onExporStart(listener: (args:
528
+ {
529
+ /**
530
+ * the content to be exported
531
+ *
532
+ * this property is initialized only for PDF/PNG/SVG exports
533
+ */
534
+ content: string,
535
+ /**
536
+ * export options
537
+ *
538
+ * this property is initialized only for PDF/PNG/SVG exports
539
+ */
540
+ options: OrgChart.exportOptions,
541
+ /**
542
+ * add extra styles
543
+ *
544
+ * this property is initialized only for PDF/PNG/SVG exports
545
+ */
546
+ styles: string,
547
+ /**
548
+ * an object that discribes pages to be exported
549
+ *
550
+ * this property is initialized only for PDF/PNG exports
551
+ */
552
+ pages: any,
553
+ /**
554
+ * extension
555
+ *
556
+ * this property is initialized only for CSV/XML
557
+ */
558
+ ext: string,
559
+ /**
560
+ * filename, you can change the filename here
561
+ *
562
+ * this property is initialized only for CSV/XML exports
563
+ */
564
+ filename: string,
565
+ /**
566
+ * array of node objects
567
+ *
568
+ * this property is initialized only for CSV/XML exports
569
+ */
570
+ nodes: Array<object>
571
+ }) => void): OrgChart;
572
+ /**
573
+ * 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.
574
+ * ```typescript
575
+ * var chart = new OrgChart('#tree', {});
576
+ * chart.onExporEnd(() => {
577
+ * //return false; to cancel the operation for example id you prefer the exported document to not download
578
+ * });
579
+ * ```
580
+ * @category Event Listeners
581
+ * @param listener
582
+ */
583
+ onExporEnd(listener: (args:
584
+ /**
585
+ * for PDF/PNG
586
+ */
587
+ {
588
+ /**
589
+ * the array buffer is the exported document, you can save it on a server or send it via email
590
+ *
591
+ * this property is initialized only for PDF/PNG exports
592
+ */
593
+ ArrayBuffer: ArrayBuffer
594
+ /**
595
+ * extension
596
+ *
597
+ * this property is initialized only for CSV/XML exports
598
+ */
599
+ ext: string,
600
+ /**
601
+ * filename, you can change the filename here
602
+ *
603
+ * this property is initialized only for CSV/XML exports
604
+ */
605
+ filename: string,
606
+ /**
607
+ * an array of node objects
608
+ *
609
+ * this property is initialized only for CSV/XML exports
610
+ */
611
+ nodes: Array<object>,
612
+ /**
613
+ * csv ot xml string
614
+ *
615
+ * this property is initialized only for CSV/XML/SVG exports
616
+ */
617
+ content: string
618
+ /**
619
+ * export options
620
+ *
621
+ * this property is initialized only for SVG exports
622
+ */
623
+ options: OrgChart.exportOptions,
624
+ /**
625
+ * add extra styles
626
+ *
627
+ * this property is initialized only for SVG exports
628
+ */
629
+ styles: string,
630
+ }) => void): OrgChart;
631
+ /**
632
+ * On node click event listener.
633
+ * ```typescript
634
+ * var chart = new OrgChart('#tree', {});
635
+ * chart.onNodeClick(() => {
636
+ * //return false; to cancel the operation
637
+ * });
638
+ * ```
639
+ * @category Event Listeners
640
+ * @param listener
641
+ */
642
+ onNodeClick(listener: (args: {
643
+ /**
644
+ * node JSON object
645
+ */
646
+ node: OrgChart.node,
647
+ /**
648
+ * the browser event
649
+ */
650
+ event: any
651
+ }) => void): OrgChart;
652
+ /**
653
+ * On node double click event listener.
654
+ * ```typescript
655
+ * var chart = new OrgChart('#tree', {});
656
+ * chart.onNodeDoubleClick(() => {
657
+ * //return false; to cancel the operation
658
+ * });
659
+ * ```
660
+ * @category Event Listeners
661
+ * @param listener
662
+ */
663
+ onNodeDoubleClick(listener: (args: {
664
+ /**
665
+ * clicked node data
666
+ */
667
+ data: object
668
+ }) => void): OrgChart;
1468
669
 
1469
- - filename - the name of the file
670
+ editUI: OrgChart.editUI;
671
+ searchUI: OrgChart.searchUI;
672
+ nodeMenuUI: OrgChart.menuUI;
673
+ nodeCircleMenuUI: OrgChart.circleMenuUI;
674
+ nodeContextMenuUI: OrgChart.menuUI;
675
+ menuUI: OrgChart.menuUI;
676
+ toolbarUI: OrgChart.toolbarUI;
1470
677
 
1471
- Code example:
1472
- ```
1473
- chart.exportXML("MyOrgChart.svg");
1474
- ```
1475
- * @param filename
678
+ static fileUploadDialog(callback: () => void): void;
679
+ static isMobile(): boolean;
680
+ /**
681
+ * Checks if the used libraris is licnsed or not
1476
682
  */
1477
- exportXML(filename: string) : void;
1478
-
683
+ static isTrial(): boolean;
1479
684
  /**
1480
- * Import CSV file.
685
+ * Count all children nodes of the specified id.
686
+ * @param chart OrgChart instance
687
+ * @param node
688
+ * @param count
689
+ */
690
+ static childrenCount(chart: OrgChart, node: OrgChart.node, count?: number): number;
691
+ static collapsedChildrenCount(chart: OrgChart, node: OrgChart.node, count?: number): number;
692
+ static getRootOf(node: OrgChart.node): OrgChart.node;
693
+ static isNEU(val: unknown): boolean;
694
+ static gradientCircleForDefs(id: string | number, colors: Array<string> | string, r: number, strokeWidth: number): string;
1481
695
 
1482
- Signature:
1483
- ```
1484
- chart.importCSV();
1485
- ```
1486
- Code example:
1487
- ```
1488
- chart.importCSV();
1489
- ```
1490
- */
1491
- importCSV() : void;
1492
696
 
1493
697
  /**
1494
- * Import XML file.
698
+ * Shows/hides lloading image. Usefull when export large data to pdf. You can override and show your own loading image.
699
+ */
700
+ static loading: {
701
+ show: (chart: OrgChart) => void,
702
+ hide: (chart: OrgChart) => void
703
+ }
1495
704
 
1496
- Signature:
1497
- ```
1498
- chart.importXML();
1499
- ```
1500
- Code example:
1501
- ```
1502
- chart.importXML();
1503
- ```
1504
- */
1505
- importXML() : void;
705
+ static clinkTemplates: {
706
+ orange?: OrgChart.linkTemplate,
707
+ blue?: OrgChart.linkTemplate,
708
+ yellow?: OrgChart.linkTemplate,
709
+ [key: string]: OrgChart.linkTemplate
710
+ }
1506
711
 
1507
- /**
1508
- * Draws the chart.
712
+ static slinkTemplates: {
713
+ orange?: OrgChart.linkTemplate,
714
+ blue?: OrgChart.linkTemplate,
715
+ yellow?: OrgChart.linkTemplate,
716
+ [key: string]: OrgChart.linkTemplate
717
+ }
1509
718
 
1510
- Signature:
1511
- ```
1512
- chart.draw(action, actionParams, callback);
1513
- ```
1514
- Parameters:
1515
719
 
1516
- - * @param action - (optional) OrgChart.action.expandCollapse, OrgChart.action.update and OrgChart.action.centerNode
1517
- - * @param actionParams - (optional) parameters of the action
1518
- - * @param callback - (optional) called after the draw
720
+ static icon: {
721
+ png: (w: string, h: string, c: string) => string,
722
+ pdf: (w: string, h: string, c: string) => string,
723
+ svg: (w: string, h: string, c: string) => string,
724
+ csv: (w: string, h: string, c: string) => string,
725
+ excel: (w: string, h: string, c: string) => string,
726
+ edit: (w: string, h: string, c: string) => string,
727
+ details: (w: string, h: string, c: string) => string,
728
+ remove: (w: string, h: string, c: string) => string,
729
+ add: (w: string, h: string, c: string) => string,
730
+ xml: (w: string, h: string, c: string) => string,
731
+ link: (w: string, h: string, c: string) => string,
732
+ happy: (w: string, h: string, c: string) => string,
733
+ sad: (w: string, h: string, c: string) => string,
734
+ share: (w: string, h: string, c: string, x: string, y: string) => string,
735
+ user: (w: string, h: string, c: string, x: string, y: string) => string
736
+ }
1519
737
 
1520
- Code example:
1521
- ```
1522
- chart.draw();
1523
- ```
1524
-
1525
- */
1526
- draw(action? : OrgChart.action, actionParams?: Object, callback?: Function) : void;
1527
738
 
1528
- /**
1529
- * Expand specified nodes.
1530
739
 
1531
- Signature:
1532
- ```
1533
- chart.expand(id, ids, callback);
1534
- ```
1535
- Parameters:
1536
740
 
1537
- - id - the id of the node that will not move
1538
- - ids - node ids that will be expanded
1539
- - callback - (optional) called after the animation completes
1540
741
 
1541
- Code example:
1542
- ```
1543
- chart.expand(5, [155]);
1544
- ```
1545
- * @param id
1546
- * @param ids
1547
- * @param [callback]
1548
- */
1549
- expand(id: string | number, ids: Array<string | number>, callback?: Function) : void;
742
+ static templates :{ [key: string]: OrgChart.template} ;
1550
743
 
1551
- /**
1552
- * Collapse specified nodes.
1553
744
 
1554
- Signature:
1555
- ```
1556
- chart.collapse(id, ids, callback);
1557
- ```
1558
- Parameters:
1559
745
 
1560
- - id - the id of the node that will not move
1561
- - ids - node ids that will be collapsed
1562
- - callback - (optional) called after the animation completes
1563
746
 
1564
- Code example:
1565
- ```
1566
- chart.collapse(5, [155]);
1567
- ```
1568
- * @param id
1569
- * @param ids
1570
- * @param [callback]
1571
- */
1572
- collapse(id: string | number, ids: Array<string | number>, callback?: Function) : void;
747
+ static events: {
748
+ on(type: "node-created" | "layout", listener: (args: unknown, args1: unknown, args2: unknown) => void): void
749
+ };
750
+ static state: { clear(stateName: string): void };
1573
751
 
752
+ static VERSION: string;
1574
753
  /**
1575
- * Fits the content to the visible area.
754
+ * @ignore
755
+ */
756
+ static TEXT_THRESHOLD: number;
757
+ /**
758
+ * @ignore
759
+ */
760
+ static IMAGES_THRESHOLD: number;
761
+ /**
762
+ * @ignore
763
+ */
764
+ static LINKS_THRESHOLD: number;
765
+ /**
766
+ * @ignore
767
+ */
768
+ static BUTTONS_THRESHOLD: number;
769
+ /**
770
+ * @ignore
771
+ */
772
+ static ANIM_THRESHOLD: number;
1576
773
 
1577
- Signature:
1578
- ```
1579
- chart.fit();
1580
- ```
1581
- Code example:
1582
- ```
1583
- chart.fit();
1584
- ```
774
+ /**
775
+ * @ignore
776
+ */
777
+ static IT_IS_LONELY_HERE: string;
778
+ /**
779
+ * @ignore
780
+ */
781
+ static RES: {
782
+ /**
783
+ * @ignore
1585
784
  */
1586
- fit(): void;
1587
-
785
+ IT_IS_LONELY_HERE_LINK: string
786
+ };
787
+ /**
788
+ * @ignore
789
+ */
790
+ static FIRE_DRAG_NOT_CLICK_IF_MOVE: number;
791
+ /**
792
+ * @ignore
793
+ */
794
+ static STRING_TAGS: boolean;
795
+ /**
796
+ * @ignore
797
+ */
798
+ static SEARCH_PLACEHOLDER: string;
799
+ /**
800
+ * @ignore
801
+ */
802
+ static IMPORT_MESSAGE: string;
803
+ /**
804
+ * @ignore
805
+ */
806
+ static FIXED_POSITION_ON_CLICK: boolean;
807
+ /**
808
+ * @ignore
809
+ */
810
+ static RENDER_LINKS_BEFORE_NODES: boolean;
811
+ /**
812
+ * @ignore
813
+ */
814
+ static MIXED_LAYOUT_ALL_NODES: boolean;
815
+ /**
816
+ * @ignore
817
+ */
818
+ static MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN: boolean;
819
+ /**
820
+ * @ignore
821
+ */
822
+ static LINK_ROUNDED_CORNERS: number;
823
+ /**
824
+ * @ignore
825
+ */
826
+ static MOVE_STEP: number;
1588
827
  /**
1589
- * Load nodes.
828
+ * @ignore
829
+ */
830
+ static MOVE_INTERVAL: number;
831
+ /**
832
+ * @ignore
833
+ */
834
+ static CLINK_CURVE: number;
835
+ /**
836
+ * @ignore
837
+ */
838
+ static SEARCH_RESULT_LIMIT: number;
839
+ /**
840
+ * @ignore
841
+ */
842
+ static MAX_DEPTH: number;
843
+ /**
844
+ * @ignore
845
+ */
846
+ static SCALE_FACTOR: number;
847
+ /**
848
+ * @ignore
849
+ */
850
+ static LAZY_LOADING_FACTOR: number;
1590
851
 
1591
- Signature:
1592
- ```
1593
- chart.load(nodesJsonArray);
1594
- ```
1595
- Code example:
1596
- ```
1597
- chart.load([{id: 1}]);
1598
- ```
1599
- * @param jsonArray
1600
- */
1601
- load(jsonArray: Array<Object>) : void;
852
+ }
1602
853
 
854
+ declare namespace OrgChart {
1603
855
  /**
1604
- *Load nodes from xml.
1605
-
1606
- Signature:
1607
- ```
1608
- chart.loadXML(xmlAsText);
1609
- ```
1610
- Code example:
1611
- ```
1612
- chart.loadXML('<?xml version="1.0" encoding="utf-8" ?><nodes><node id="1" name="plamen"/><node id="2" pid="1" name="ivan"/></nodes>');
1613
- ```
1614
- * @param xmlAsText
856
+ * deprecated, use OrgChart.align.center isntead
857
+ * @ignore
1615
858
  */
1616
- loadXML(xmlAsText: string) : void;
1617
-
859
+ const CENTER: number;
1618
860
  /**
1619
- * Gets nodes as xml.
861
+ * deprecated, use OrgChart.align.orientation isntead
862
+ * @ignore
863
+ */
864
+ const ORIENTATION: number;
1620
865
 
1621
- Signature:
1622
- ```
1623
-
1624
- chart.getXML();
1625
866
 
1626
- Code example:
867
+ /**
868
+ * @ignore
869
+ */
870
+ const none: number;
1627
871
 
1628
-
1629
- var xml = chart.getXML();
872
+ /**
873
+ * @ignore
874
+ */
875
+ const COLLAPSE_PARENT_NEIGHBORS: number;
1630
876
 
1631
- * @returns xml
877
+ /**
878
+ * @ignore
1632
879
  */
1633
- getXML() : string;
880
+ const COLLAPSE_SUB_CHILDRENS: number;
1634
881
 
1635
882
  /**
1636
- * Adds clink.
1637
-
1638
- Signature:
1639
- ```
1640
- chart.addClink(fromId, toId, label, template);
1641
- ```
1642
- Code example:
1643
- ```
1644
- chart.addClink(5, 1, 'lorem ipsum', 'blue');
1645
- ```
1646
- Predefined templates:
1647
- - orange
1648
- - blue
1649
- - yellow
1650
- * @param fromId
1651
- * @param toId
1652
- * @param label
1653
- * @param template
883
+ * deprecated, use OrgChart.layout.normal isntead
884
+ * @ignore
1654
885
  */
1655
- addClink(fromId: string | number, toId: string | number, label?: string, template?: string) : void;
1656
-
886
+ const normal: number;
887
+
1657
888
  /**
1658
- * Removes clink.
1659
-
1660
- Signature:
1661
- ```
1662
- chart.removeClink(fromId, toId);
1663
- ```
1664
- Code example:
1665
- ```
1666
- chart.removeClink(5, 1);
1667
- ```
1668
- * @param fromId
1669
- * @param toId
889
+ * deprecated, use OrgChart.layout.mixed isntead
890
+ * @ignore
1670
891
  */
1671
- removeClink(fromId: string | number, toId: string | Number): void;
1672
-
892
+ const mixed: number;
893
+ /**
894
+ * deprecated, use OrgChart.layout.tree isntead
895
+ * @ignore
896
+ */
897
+ const tree: number;
1673
898
  /**
1674
- * Expand/Collapse to level.
899
+ * deprecated, use OrgChart.layout.treeLeftOffset isntead
900
+ * @ignore
901
+ */
902
+ const treeLeftOffset: any;
903
+ /**
904
+ * deprecated, use OrgChart.layout.treeRightOffset isntead
905
+ * @ignore
906
+ */
907
+ const treeRightOffset: any;
1675
908
 
1676
- Signature:
1677
- ```
1678
- chart.expandCollapseToLevel(id, collapse, expand, callback);
1679
- ```
1680
- Code example:
1681
- ```
1682
- chart.expandCollapseToLevel({
1683
- level: 2
1684
- }, {
1685
- nodes: [155]
1686
- }, function(){
1687
- console.log('callback')
1688
- });
1689
- ```
1690
- * @param id
1691
- * @param collapse
1692
- * @param expand
1693
- * @param callback
1694
- */
1695
- expandCollapseToLevel(id: string | number, collapse: Object, expand: Object, callback: Function) : void; // How works this one ?
1696
909
 
910
+ const scroll: {
911
+ visible?: boolean,
912
+ smooth?: number,
913
+ speed?: number,
914
+ safari?: { smooth?: number; speed?: number; },
915
+ edge?: { smooth?: number; speed?: number; },
916
+ chrome?: { smooth?: number; speed?: number; },
917
+ firefox?: { smooth?: number; speed?: number; },
918
+ opera?: { smooth?: number; speed?: number; }
919
+ };
920
+
921
+ interface template
922
+ {
923
+ defs?: string,
924
+ size?: Array<number>,
925
+ expandCollapseSize?: number,
926
+ linkAdjuster?: {
927
+ fromX?: number,
928
+ fromY?: number,
929
+ toX?: number,
930
+ toY?: number
931
+ },
932
+ ripple?: {
933
+ radius?: number,
934
+ color?: string,
935
+ rect?: Array<number>
936
+ },
937
+ assistanseLink?: string,
938
+ svg?: string,
939
+ link?: string,
940
+ pointer?: string,
941
+ node?: string,
942
+ plus?: string,
943
+ minus?: string,
944
+ nodeMenuButton?: string,
945
+ menuButton?: string,
946
+ img_0?: string,
947
+ link_field_0?: string,
948
+ editFormHeaderColor?: string,
949
+ nodeCircleMenuButton?: string,
950
+ min?: template
951
+ }
952
+
953
+ interface editUI {
954
+ /**
955
+ * Inits edit ui
956
+ * @param obj
957
+ */
958
+ init(obj: OrgChart): void;
959
+ /**
960
+ * The on() method of the editUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
961
+ * @category Event Listeners
962
+ * @param type A case-sensitive string representing the event type to listen for.
963
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
964
+ */
965
+ on(type: "show" | "element-btn-click" | "button-click" | "hide", listener: (sender: editUI, args: unknown, args1: unknown, args2: unknown) => void | boolean): editUI;
966
+ /**
967
+ * Shows the edit form for the specified node id
968
+ * @param id node id
969
+ * @param detailsMode If true the edit form is in read only mode
970
+ * @param dontAnim
971
+ */
972
+ show(id: string | number, detailsMode: boolean, dontAnim: boolean): void;
973
+ /**
974
+ * Hides the edit form
975
+ */
976
+ hide(): void;
977
+ content(id: string | number, detailsMode: boolean, dontAnim: boolean, width: string, dontRenderButtons: boolean): string;
978
+ }
1697
979
 
1698
- /**
1699
- * Destroys the object.
980
+ interface searchUI {
981
+ init(obj: OrgChart): void;
982
+ /**
983
+ * The on() method of the searchUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
984
+ * @category Event Listeners
985
+ * @param type A case-sensitive string representing the event type to listen for.
986
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
987
+ */
988
+ on(type: "searchclick", listener: (sender: OrgChart, args: unknown, args1: unknown, args2: unknown) => void | boolean): searchUI;
989
+ /**
990
+ * Hides the search grid
991
+ */
992
+ hide(): void;
993
+ /**
994
+ * Finds filed data by specified value
995
+ * @param value search for value
996
+ */
997
+ find(value: string): void;
998
+ createItem(img: string, id: string | number, first: string, second: string): string;
999
+ }
1700
1000
 
1701
- Signature:
1702
- ```
1703
- chart.destroy();
1704
- ```
1705
- */
1706
- destroy(): void;
1001
+ interface menuUI {
1002
+ init(obj: OrgChart, menu: { [key: string]: menu }): void;
1003
+ /**
1004
+ * The on() method of the menuUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
1005
+ * @category Event Listeners
1006
+ * @param type A case-sensitive string representing the event type to listen for.
1007
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
1008
+ */
1009
+ on(type: "show", listener: (sender: menuUI, args: unknown, args1: unknown, args2: unknown) => void | boolean): menuUI;
1010
+ /**
1011
+ * Shows menu next to html element
1012
+ * @param stickToElement
1013
+ * @param firstNodeId
1014
+ * @param secondNodeId
1015
+ * @param menu
1016
+ */
1017
+ showStickIn(stickToElement: HTMLElement, firstNodeId: string | number, secondNodeId: string | number, menu: { [key: string]: menu }): void;
1018
+ /**
1019
+ * Hieds the menu
1020
+ */
1021
+ hide(): void;
1022
+ /**
1023
+ * Shows menu by x,y position
1024
+ * @param x
1025
+ * @param y
1026
+ * @param firstNodeId
1027
+ * @param secondNodeId
1028
+ * @param menu
1029
+ */
1030
+ show(x: number, y: number, firstNodeId: string | number, secondNodeId: string | number, menu: { [key: string]: menu }): void;
1031
+ }
1707
1032
 
1708
- /**
1709
- * Adds slink.
1033
+ interface circleMenuUI {
1034
+ /**
1035
+ * Inits circle menu instance
1036
+ * @param obj
1037
+ * @param menu
1038
+ */
1039
+ init(obj: OrgChart, menu: { [key: string]: menu }): void;
1040
+ /**
1041
+ * Shows circle menu
1042
+ * @param nodeId
1043
+ * @param menu
1044
+ */
1045
+ show(nodeId: string | number, menu: { [key: string]: menu }): void;
1046
+ /**
1047
+ * Hides circle menu
1048
+ */
1049
+ hide(): void;
1050
+ /**
1051
+ * The on() method of the circleMenuUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
1052
+ * @category Event Listeners
1053
+ * @param type A case-sensitive string representing the event type to listen for.
1054
+ * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
1055
+ */
1056
+ on(type: "show" | "drag" | "drop" | "mouseenter" | "mouseout", listener: (sender: circleMenuUI, args: unknown, args1: unknown, args2: unknown) => void | boolean): circleMenuUI;
1057
+ }
1710
1058
 
1711
- Signature:
1712
- ```
1713
- chart.addSlink(fromId, toId, label, template);
1714
- ```
1715
- Code example:
1716
- ```
1717
- chart.addSlink(5, 1, 'lorem ipsum', 'blue');
1718
- ```
1719
- * @param fromId
1720
- * @param toId
1721
- * @param label
1722
- * @param template
1723
- */
1724
- addSlink(fromId: string | number, toId: string | number, label: string, template: string) : void;
1059
+ interface toolbarUI {
1060
+ init(obj: OrgChart, toolbar: toolbar): void;
1061
+ showLayout(): void;
1062
+ hideLayout(): void;
1725
1063
 
1726
1064
 
1727
- /**
1728
- * Removes slink.
1065
+ expandAllIcon?: string;
1066
+ fitIcon?: string;
1067
+ openFullScreenIcon?: string;
1068
+ closeFullScreenIcon?: string;
1069
+ zoomInIcon?: string;
1070
+ zoomOutIcon?: string;
1071
+ layoutIcon?: string;
1072
+ }
1729
1073
 
1730
- Signature:
1731
- ```
1732
- chart.removeSlink(fromId, toId);
1733
- ```
1734
- Code example:
1735
- ```
1736
- chart.removeSlink(5, 1);
1737
- ```
1738
- * @param fromId
1739
- * @param toId
1740
- */
1741
- removeSlink(fromId: string | number, toId: string | number) : void;
1742
1074
 
1743
- on(action: string, fun: Function): void;
1744
-
1745
- getNode(id: string | number): NodeModel;
1746
1075
 
1747
- /**
1748
- * Maximize the node. Without parameters maximize all nodes.
1749
- *
1750
- Signature:
1751
- * ```
1752
- * chart.maximize(id, horizontalCenter, verticalCenter, callback);
1753
- * ```
1754
- * @param id - (optional) the id of the node
1755
- * @param horizontalCenter - (optional) center horizontally (true,false)
1756
- * @param verticalCenter - (optional) center vertically (true,false)
1757
- * @param callback - (optional) callback function is called when the animation completes
1758
- *
1759
- Code example:
1760
- * ```
1761
- * chart.maximize(5);
1762
- * ```
1763
- */
1764
- maximize(id?: string | number, horizontalCenter?: boolean, verticalCenter?: boolean, callback?: Function) : void;
1765
-
1766
- /**
1767
- * Minimize the node. Without parameters minimize all nodes.
1768
- *
1769
- Signature:
1770
- * ```
1771
- * chart.minimize(id, callback);
1772
- * ```
1773
- * @param id - (optional) the id of the node
1774
- * @param callback - (optional) callback function is called when the animation completes
1775
- *
1776
- Code example:
1777
- * ```
1778
- * chart.minimize(5);
1779
- * ```
1780
- */
1781
- minimize(id?: string | number, callback?: Function) : void;
1076
+ type toolbar = {
1077
+ layout?: boolean,
1078
+ zoom?: boolean,
1079
+ fit?: boolean,
1080
+ expandAll?: boolean,
1081
+ fullScreen?: boolean
1082
+ }
1782
1083
 
1783
- /**
1784
- * Set orientation.
1785
- *
1786
- * Signature:
1787
- * ```
1788
- * chart.setOrientation(orientation, lyoutConfigName);
1789
- * ```
1790
- *
1791
- * Parameters:
1792
- * @param orientation - orientation type, OrgChart.orientation.top, OrgChart.orientation.bottom, OrgChart.orientation.right, OrgChart.orientation.left, OrgChart.orientation.top_left, OrgChart.orientation.bottom_left, OrgChart.orientation.right_top and OrgChart.orientation.left_top
1793
- * @param lyoutConfigName - (optional) lyout config name for the specified sub tree
1794
- *
1795
- Code example:
1796
- ```
1797
- chart.setOrientation(OrgChart.orientation.bottom);
1798
- ```
1799
- */
1800
- setOrientation(orientation: OrgChart.orientation, lyoutConfigName?: string) : void;
1801
1084
 
1802
- /**
1803
- * Set layout.
1804
- *
1805
- * Signature:
1806
- * ```
1807
- * chart.setLayout(layout, lyoutConfigName);
1808
- * ```
1809
- * Parameters:
1810
- * @param layout - layout type, OrgChart.normal, OrgChart.mixed, OrgChart.tree, OrgChart.treeLeftOffset and OrgChart.treeRightOffset
1811
- * @param lyoutConfigName - (optional) lyout config name for the specified sub tree
1812
- *
1813
- * Code example:
1814
- * ```
1815
- * chart.setLayout(OrgChart.tree);
1816
- * ```
1817
- */
1818
- setLayout(layout: OrgChart, lyoutConfigName?: string) : void;
1085
+ type exportOptions = {
1086
+ margin?: Array<number>,
1087
+ padding?: number,
1088
+ landscape?: boolean,
1089
+ filename?: string,
1090
+ scale?: "fit" | number,
1091
+ format?: "A1" | "A2" | "A3" | "A4" | "A5" | "A4" | "Letter" | "Legal",
1092
+ header?: string,
1093
+ footer?: string,
1094
+ openInNewTab?: boolean
1095
+ }
1819
1096
 
1820
- /**
1821
- * Magnify node.
1822
- *
1823
- * Signature:
1824
- * ```
1825
- * chart.magnify(id, scale, front, anim, callback);
1826
- * ```
1827
- * Parameters:
1828
- * @param id - the node id we want to highlight or magnify
1829
- * @param scale - scale of the magnified node
1830
- * @param front - (optional) true or false, display magnified node in front of other nodes if it is true
1831
- * @param anim - (optional) animation effect for the magnified node, if not set the default is chart.config.anim
1832
- * @param callback - (optional) callback function before the animation start
1833
- *
1834
- *
1835
- * Code example:
1836
- * ```
1837
- * chart.magnify(id, 1.04, false, null);
1838
- * ```
1839
- */
1097
+ type linkTemplate = {
1098
+ defs?: string,
1099
+ link?: string,
1100
+ label?: string,
1101
+ labelPosition?: string
1102
+ }
1103
+ type menu = {
1104
+ [key: string]: {
1105
+ text?: string,
1106
+ icon?: string,
1107
+ onClick?: Function,
1108
+ color?: string,
1109
+ draggable?: boolean
1110
+ }
1111
+ }
1112
+ type editFormElement = {
1113
+ type?: string,
1114
+ label?: string,
1115
+ binding?: string,
1116
+ options?: Array<unknown>,
1117
+ btn?: string,
1118
+ vlidators?: { required?: string, email?: string }
1119
+ }
1120
+ type link = {
1121
+ from?: string | number,
1122
+ to?: string | number,
1123
+ template?: string,
1124
+ label?: string
1125
+ }
1126
+ type orderBy = {
1127
+ field?: string,
1128
+ desc?: boolean
1129
+ }
1130
+ enum orientation {
1131
+ top,
1132
+ bottom,
1133
+ right,
1134
+ left,
1135
+ top_left,
1136
+ bottom_left,
1137
+ right_top,
1138
+ left_top
1139
+ }
1140
+ enum layout {
1141
+ normal,
1142
+ mixed,
1143
+ tree,
1144
+ treeLeftOffset,
1145
+ treeRightOffset
1146
+ }
1840
1147
 
1841
- magnify(id: string | number, scale: number, front?: boolean, anim?: Object, callback?: Function ) : void;
1148
+ enum align {
1149
+ center,
1150
+ orientation
1151
+ }
1152
+ enum anim {
1153
+ inPow,
1154
+ outPow,
1155
+ inOutPow,
1156
+ inSin,
1157
+ outSin,
1158
+ inOutSin,
1159
+ inExp,
1160
+ outExp,
1161
+ inOutExp,
1162
+ inCirc,
1163
+ outCirc,
1164
+ inOutCirc,
1165
+ rebound,
1166
+ inBack,
1167
+ outBack,
1168
+ inOutBack,
1169
+ impulse,
1170
+ expPulse
1171
+ }
1172
+ enum match {
1173
+ height,
1174
+ width,
1175
+ boundary
1176
+ }
1842
1177
 
1843
- /**
1844
- * Magnify back node.
1845
- *
1846
- * Signature:
1847
- * ```
1848
- * chart.chart.magnifyBack(id, anim, callback);
1849
- * ```
1850
- * Parameters:
1851
- * @param id - is the node id we want to highlight or magnify
1852
- * @param anim - (optional) animation effect for the magnified node, if not set the default is chart.config.anim
1853
- * @param callback - (optional) callback function after the animation ends
1854
- *
1855
- *
1856
- * Code example:
1857
- * ```
1858
- * chart.magnifyBack(id, { func: OrgChart.anim.inSin, duration: 200});
1859
- * ```
1860
- */
1861
-
1862
- magnifyBack(id: string | number, anim?: Object, callback?: Function) : void;
1863
1178
 
1864
- /**
1865
- * State to url.
1866
- *
1867
- * Signature:
1868
- * ```
1869
- * chart.stateToUrl();
1870
- * ```
1871
- * Code example:
1872
- * ```
1873
- * chart.stateToUrl();
1874
- * ```
1875
- */
1876
- stateToUrl() : String;
1179
+ enum action {
1180
+ update,
1181
+ expand,
1182
+ collapse,
1183
+ exporting,
1184
+ init,
1185
+ centerNode,
1186
+ insert,
1187
+ maximize,
1188
+ minimize,
1189
+ edit,
1190
+ details,
1191
+ expandCollapse,
1192
+ pan,
1193
+ zoom,
1194
+ ctrlZoom,
1195
+ xScroll,
1196
+ yScroll,
1197
+ scroll,
1198
+ none
1199
+ }
1877
1200
 
1201
+ type node = {
1878
1202
  /**
1879
- * Expand and collapse nodes.
1880
- *
1881
- * Signature:
1882
- * ```
1883
- * chart.expandCollapse(id, expandIds, collapseIds);
1884
- * ```
1885
- * Parameters:
1886
- * @param id - fixed node
1887
- * @param expandIds - array of expanding ids
1888
- * @param collapseIds - array of collapsing ids
1889
- *
1890
- *
1891
- * Code example:
1892
- * ```
1893
- * chart.expandCollapse(5, [6, 7], [8, 9]);
1894
- * ```
1895
- */
1896
-
1897
- expandCollapse(id: string | number, expandIds: Array<string | number>, collapseIds: Array<string | number>) : void;
1898
-
1899
- /**
1900
- * Search in the chart.
1901
- *
1902
- * Signature:
1903
- * ```
1904
- * chart.search(value, searchInFileds, retrieveFields);
1905
- * ```
1906
- * Parameters:
1907
- * @param value - value to search for
1908
- * @param searchInFileds - (optional) array of fields to search in
1909
- * @param retrieveFields - (optional) array of returned fields
1910
- *
1911
- *
1912
- * Code example:
1913
- * ```
1914
- * chart.search("c", ["Name", "Title"], ["Title"]);
1915
- * ```
1916
- */
1917
-
1918
- search(value: string | number, searchInFileds?: Array<string>, retrieveFields?: Array<string>) : any;
1919
-
1920
- /**
1921
- * Returns the node DOM element.
1922
- *
1923
- * Signature:
1924
- * ```
1925
- * chart.getNodeElement(id);
1926
- * ```
1927
- * Parameters:
1928
- * @param id - id of the node
1929
- *
1930
- *
1931
- * Code example:
1932
- * ```
1933
- * chart.getNodeElement(5);
1934
- * ```
1935
- */
1203
+ * the same id you provided in the source node
1204
+ */
1205
+ id?: string | number,
1206
+ /**
1207
+ * same pid you provided in the source node, the default value is null if not provided or if node with the same id does not exist
1208
+ */
1209
+ pid?: string | number,
1210
+ /**
1211
+ * partner parent id, it is the partner parent node id of the partner node, it is the same ppid you provided in the source node, the default value is undefined.
1212
+ */
1213
+ ppid?: string | number,
1214
+ /**
1215
+ * a reference to the parent node, default value is null, if the nodes is collapse this proprty is not initalized and can be null even if pid is not null
1216
+ */
1217
+ parent?: node,
1218
+ /**
1219
+ * ub tree parent id, it is the parent node id of the root node of the sub tree, it is the same stpid you provided in the source node, the default value is null if not provided or if node with the same id does not exist.
1220
+ */
1221
+ stpid?: string | number,
1222
+ /**
1223
+ * - a reference to the parent node of a sub tree, default value is null, if the parent node is minimized this proprty is not initalized and can be null even if we have stpid
1224
+ */
1225
+ stParent?: node,
1226
+ isPartner?: boolean,
1227
+ partnerSeparation?: number,
1228
+ /**
1229
+ * array of ids, always initialized
1230
+ */
1231
+ childrenIds?: Array<string | number>,
1232
+ /**
1233
+ * array of children nodes, initialized on demand if all children are collpased it will be empty array
1234
+ */
1235
+ children?: Array<node>,
1236
+ /**
1237
+ * array of sub tree children root node ids, always initialized
1238
+ */
1239
+ stChildrenIds?: Array<string | number>,
1240
+ /**
1241
+ * array of sub tree children root nodes, initialized on demand if the node is minimized it will be empty array
1242
+ */
1243
+ stChildren?: Array<node>,
1244
+ /**
1245
+ * array of string values, the same array you provided in the source node
1246
+ */
1247
+ tags?: Array<string>,
1248
+ /**
1249
+ * template name, you can specify multiple templates with tags in one chart
1250
+ */
1251
+ templateName?: string,
1252
+ /**
1253
+ * a reference to the left node neighbor, the default value is undefined
1254
+ */
1255
+ leftNeighbor?: node | undefined,
1256
+ /**
1257
+ * a reference to the right node neighbor, the default value is undefined
1258
+ */
1259
+ rightNeighbor?: node | undefined,
1260
+ /**
1261
+ * x position, default value undefined
1262
+ */
1263
+ x?: number | undefined,
1264
+ /**
1265
+ * y position, default value undefined
1266
+ */
1267
+ y?: number | undefined,
1268
+ /**
1269
+ * width of the node, default value undefined
1270
+ */
1271
+ w?: number | undefined,
1272
+ /**
1273
+ * height of the node, default value undefined
1274
+ */
1275
+ h?: number | undefined,
1276
+ /**
1277
+ * if the node is assistant is true if not false if the node is not initialized is undefined
1278
+ */
1279
+ isAssistant?: boolean | undefined,
1280
+ /**
1281
+ * sub tree container nodes array, property only for the root node, default value undefined
1282
+ */
1283
+ stContainerNodes?: Array<node> | undefined,
1284
+ /**
1285
+ * it is set only if you define order option, default value undefined
1286
+ */
1287
+ order?: number | undefined,
1288
+ /**
1289
+ * true if the node is collpased, false if it is not and undefined if not initalized
1290
+ */
1291
+ collapsed?: boolean | undefined,
1292
+ /**
1293
+ * a level of the node starting from zero
1294
+ */
1295
+ level?: number,
1296
+ /**
1297
+ * true if the node is minimized, default value undefined
1298
+ */
1299
+ min?: boolean | undefined,
1300
+ /**
1301
+ * sub levels, default value undefined
1302
+ */
1303
+ subLevels?: number | undefined,
1304
+ /**
1305
+ * set only if the node contains sub trees and padding is defined in the template, default value undefined
1306
+ */
1307
+ padding?: number | undefined,
1308
+ /**
1309
+ * layout configuration name, default value undefined
1310
+ */
1311
+ lcn?: string | undefined,
1312
+ /**
1313
+ * for assistant nodes and mixed layout we create dynamic nodes called splits, default value undefined
1314
+ */
1315
+ isSplit?: boolean | undefined
1316
+ }
1936
1317
 
1937
- getNodeElement(id: string | number) : void;
1318
+ interface options {
1319
+ /**
1320
+ * Enables or disables the browser events handlers like click, pan, zoom, pinch, etc. Default value - *true*.
1321
+ * ```typescript
1322
+ * var chart = new OrgChart('#tree', {
1323
+ * interactive: false
1324
+ * });
1325
+ * ```
1326
+ */
1327
+ interactive?: boolean,
1938
1328
 
1939
- generateId() : string | number;
1329
+ /**
1330
+ * Color mode. Default value - *light*.
1331
+ * ```typescript
1332
+ * var chart = new OrgChart('#tree', {
1333
+ * mode: "dark"
1334
+ * });
1335
+ * ```
1336
+ */
1337
+ mode?: "dark" | "light",
1338
+ /**
1339
+ * Lazy loading is technique that defers loading of non-critical nodes at page load time. Instead, these non-critical nodes are loaded at the moment of need. Default value - *true*.
1340
+ * ```typescript
1341
+ * var chart = new OrgChart('#tree', {
1342
+ * lazyLoading: false
1343
+ * });
1344
+ * ```
1345
+ */
1346
+ lazyLoading?: boolean,
1940
1347
 
1941
- changeRoots(id: null | string | number, roots: Array<string|number>, callback?: Function ) : void;
1942
- /**
1943
- * Exports the node details in PDF
1944
- *
1945
- * Signature:
1946
- * ```
1947
- * chart.exportPDFProfile(ioptions, callback);
1948
- * ```
1949
- * Parameters:
1950
- * @param options - options for export
1951
- * @param callback - callback function
1952
- *
1953
- *
1954
- * Code example:
1955
- * ```
1956
- * chart.exportPDFProfile({id: 5});
1957
- * ```
1958
- */
1959
- exportPDFProfile(options: Object, callback?: Function) : void;
1348
+ /**
1349
+ * With the drag and drop features enabled you can move nodes easily and change the tree structure. Default value - *false*.
1350
+ * ```typescript
1351
+ * var chart = new OrgChart('#tree', {
1352
+ * enableDragDrop: true
1353
+ * });
1354
+ * ```
1355
+ */
1356
+ enableDragDrop?: boolean,
1960
1357
 
1961
1358
  /**
1962
- * Exports the node details in PNG
1963
- *
1964
- * Signature:
1965
- * ```
1966
- * chart.exportPNGProfile(ioptions, callback);
1967
- * ```
1968
- * Parameters:
1969
- * @param options - options for export
1970
- * @param callback - callback function
1971
- *
1972
- *
1973
- * Code example:
1974
- * ```
1975
- * chart.exportPNGProfile({id: 5});
1976
- * ```
1977
- */
1978
- exportPNGProfile(options: Object, callback?: Function) : void;
1359
+ * Enables advanced search. Default value is true.
1360
+ * ```typescript
1361
+ * var chart = new OrgChart('#tree', {
1362
+ * enableSearch: false
1363
+ * });
1364
+ * ```
1365
+ */
1366
+ enableSearch?: boolean,
1979
1367
 
1368
+ /**
1369
+ * Enable touch instead of mouse for particular devices with touchscreen/touchpad/trackpad. Default value - *false*.
1370
+ * ```typescript
1371
+ * var chart = new OrgChart('#tree', {
1372
+ * enableTouch: true
1373
+ * });
1374
+ * ```
1375
+ */
1376
+ enableTouch?: boolean,
1377
+ /**
1378
+ * Enable keyboard navigation. Use "f" for find, arrows and space to navigate in the chart. Default value - *false*.
1379
+ * ```typescript
1380
+ * var chart = new OrgChart('#tree', {
1381
+ * enableKeyNavigation: true
1382
+ * });
1383
+ * ```
1384
+ * {@link https://balkan.app/OrgChartJS/Docs/KeyNavigation | See doc...}
1385
+ */
1386
+ enableKeyNavigation?: boolean,
1387
+ /**
1388
+ * Shows mini map over the expanded tree. Default value - *false*.
1389
+ * ```typescript
1390
+ * var chart = new OrgChart('#tree', {
1391
+ * miniMap: true
1392
+ * });
1393
+ * ```
1394
+ */
1395
+ miniMap?: boolean,
1396
+ /**
1397
+ * Enables edit, add, remove and other node operations. Also you can define your own node operation.
1398
+ * ```typescript
1399
+ * var chart = new OrgChart('#tree', {
1400
+ * nodeMenu:{
1401
+ * details: {text:"Details"},
1402
+ * edit: {text:"Edit"},
1403
+ * add: {text:"Add"},
1404
+ * remove: {text:"Remove"},
1405
+ * myMenuItem: {text:"My node menu Item", onClick: function {}}
1406
+ * }
1407
+ * });
1408
+ * ```
1409
+ * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...}
1410
+ */
1411
+ nodeMenu?: OrgChart.menu;
1412
+ /**
1413
+ * With node circle menu you can add, edit, remove node or create clink/slink with drga and drop. Before setting this option make sure that you defined nodeCircleMenuButton in the ysed template.
1414
+ * ```typescript
1415
+ * var chart = new OrgChart('#tree', {
1416
+ * nodeCircleMenu: {
1417
+ * editNode: {
1418
+ * icon: OrgChart.icon.edit(24, 24, '#aeaeae'),
1419
+ * text: "Edit node",
1420
+ * color: "white"
1421
+ * },
1422
+ * addClink: {
1423
+ * icon: OrgChart.icon.link(24, 24, '#aeaeae'),
1424
+ * text: "Add C link",
1425
+ * color: '#fff',
1426
+ * draggable: true
1427
+ * }
1428
+ * }
1429
+ * });
1430
+ * ```
1431
+ * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...}
1432
+ */
1433
+ nodeCircleMenu?: OrgChart.menu,
1434
+ /**
1435
+ * Customizable context menu. Also you can define your own node operation.
1436
+ * ```typescript
1437
+ * var chart = new OrgChart('#tree', {
1438
+ * nodeContextMenu:{
1439
+ * details: {text:"Details"},
1440
+ * edit: {text:"Edit"},
1441
+ * add: {text:"Add"},
1442
+ * remove: {text:"Remove"}
1443
+ * myMenuItem: {text:"My node menu Item", onClick: function {}}
1444
+ * }
1445
+ * });
1446
+ * ```
1447
+ * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...}
1448
+ */
1449
+ nodeContextMenu?: OrgChart.menu,
1450
+ /**
1451
+ * Enables export to excel, export to svg and other OrgChart operations. Also you can define your own OrgChart operation.
1452
+ * ```typescript
1453
+ * var chart = new OrgChart('#tree', {
1454
+ * menu:{
1455
+ * svg: { text: "Export SVG" },
1456
+ * csv: { text: "Export CSV" }
1457
+ * myMenuItem: {text:"My node menu Item", onClick: function {}}
1458
+ * }
1459
+ * });
1460
+ * ```
1461
+ * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...}
1462
+ */
1463
+ menu?: OrgChart.menu,
1464
+ /**
1465
+ * With the toolbar enabled allows you to change the layout, zoom in/out, expand all nodes, etc.
1466
+ * ```typescript
1467
+ * var chart = new OrgChart('#tree', {
1468
+ * toolbar: {
1469
+ * layout: true,
1470
+ * zoom: true,
1471
+ * fit: true,
1472
+ * expandAll: false,
1473
+ * fullScreen: true
1474
+ * },
1475
+ * });
1476
+ * ```
1477
+ */
1478
+ toolbar?: OrgChart.toolbar,
1479
+ /**
1480
+ * Stops the chart locking to the top of the screen once you move it.
1481
+ * ```typescript
1482
+ * var chart = new OrgChart('#tree', {
1483
+ * sticky: false
1484
+ * });
1485
+ * ```
1486
+ */
1487
+ sticky?: boolean,
1488
+ /**
1489
+ * nodeMouseClick can accept the following values:
1490
+ * - OrgChart.action.edit - will open the edit view for the clicked node on the right hand side
1491
+ * - OrgChart.action.details - will open the details view for the clicked node on the right hand side, the details view is very similar to the edit view the only difference is that is read only.
1492
+ * - OrgChart.action.expandCollapse - will expand or collapse the children nodes
1493
+ * - OrgChart.action.none - do nothing on node click event
1494
+ * - OrgChart.action.pan - allows you to move the chart in any direction
1495
+ *
1496
+ * Default value - *OrgChart.action.details*
1497
+ * ```typescript
1498
+ * var chart = new OrgChart('#tree', {
1499
+ * nodeMouseClick: OrgChart.action.edit
1500
+ * });
1501
+ * ```
1502
+ */
1503
+ nodeMouseClick?: OrgChart.action,
1504
+ /**
1505
+ * nodeMouseDbClick can accept the following values:
1506
+ * - OrgChart.action.edit - will open the edit view for the clicked node on the right hand side
1507
+ * - OrgChart.action.details - will open the details view for the clicked node on the right hand side, the details view is very similar to the edit view the only difference is that is read only
1508
+ * - OrgChart.action.expandCollapse - will expand or collapse the children nodes
1509
+ * - OrgChart.action.none - do nothing on node click event
1510
+ *
1511
+ * Default value - *OrgChart.action.none*
1512
+ * ```typescript
1513
+ * var chart = new OrgChart('#tree', {
1514
+ * nodeMouseDbClick: OrgChart.action.edit
1515
+ * });
1516
+ * ```
1517
+ */
1518
+ nodeMouseDbClick?: OrgChart.action,
1519
+ /**
1520
+ * mouseScrool can accept the following values:
1521
+ * - OrgChart.action.zoom - will zoom in/out on mouse scroll
1522
+ * - OrgChart.action.ctrlZoom - will zoom in/out on mouse scroll and ctrl button is pressed
1523
+ * - OrgChart.action.xScroll - left/right move of the chart on mouse scroll
1524
+ * - OrgChart.action.yScroll - up/down move of the chart on mouse scroll
1525
+ * - OrgChart.action.none - do nothing on mouse scroll
1526
+ *
1527
+ * Default value - *OrgChart.action.zoom*
1528
+ * ```typescript
1529
+ * var chart = new OrgChart('#tree', {
1530
+ * mouseScrool: OrgChart.action.ctrlZoom
1531
+ * });
1532
+ * ```
1533
+ */
1534
+ mouseScrool?: OrgChart.action,
1535
+ /**
1536
+ * Shows horizontal scrollbar. Default value - *false*.
1537
+ * ```typescript
1538
+ * var chart = new OrgChart('#tree', {
1539
+ * showXScroll: true
1540
+ * });
1541
+ * ```
1542
+ */
1543
+ showXScroll?: boolean ,
1544
+ /**
1545
+ * Shows vertical scrollbar. Default value - *false*.
1546
+ * ```typescript
1547
+ * var chart = new OrgChart('#tree', {
1548
+ * showYScroll: true
1549
+ * });
1550
+ * ```
1551
+ */
1552
+ showYScroll?: boolean ,
1553
+ /**
1554
+ * Set template if you want to change the appearance of the chart. Org Chart JS comes with number of build-in templates:
1555
+ * - ana
1556
+ * - ula
1557
+ * - olivia
1558
+ * - belinda
1559
+ * - rony
1560
+ * - mery
1561
+ * - polina
1562
+ * - mila
1563
+ * - diva
1564
+ * - base
1565
+ * - isla
1566
+ * - deborah
1567
+ *
1568
+ * Default value - *ana*.
1569
+ * ```typescript
1570
+ * var chart = new OrgChart('#tree', {
1571
+ * template: 'olivia'
1572
+ * });
1573
+ * ```
1574
+ * {@link https://balkan.app/OrgChartJS/Docs/PredefinedTemplates | See doc...}
1575
+ */
1576
+ template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | string,
1577
+ /**
1578
+ * With tags option you can:
1579
+ * - Set a specific template for tagged node/s {@link https://balkan.app/OrgChartJS/Docs/MultipleTemplates | See doc...}
1580
+ * - Set node as assistant {@link https://balkan.app/OrgChartJS/Docs/Assistant | See doc...}
1581
+ * - Change node menu, circle menu and context menu items for tagged node/s {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...}
1582
+ * - Set the node level {@link https://balkan.app/OrgChartJS/Demos/SubLevels | See demo...}
1583
+ * - Set specific options for sub trees like layout templates etc {@link https://balkan.app/OrgChartJS/Docs/SubTrees | See doc...}
1584
+ * ```typescript
1585
+ * var chart = new OrgChart('#tree', {
1586
+ * tags: {
1587
+ * myTag: {template: 'olivia'}
1588
+ * },
1589
+ * nodes: [{id: 1}, {id: 2, tags: ['myTag']}]
1590
+ * });
1591
+ * ```
1592
+ */
1593
+ tags?: {
1594
+ [key: string]: {
1595
+ template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | string,
1596
+ subLevels?: number,
1597
+ nodeMenu?: OrgChart.menu,
1598
+ nodeCircleMenu?: OrgChart.menu,
1599
+ nodeContextMenu?: OrgChart.menu,
1600
+ subTreeConfig?: {
1601
+ orientation?: OrgChart.orientation,
1602
+ levelSeparation?: number,
1603
+ mixedHierarchyNodesSeparation?: number,
1604
+ subtreeSeparation?: number,
1605
+ siblingSeparation?: number,
1606
+ layout?: OrgChart.layout | number,
1607
+ columns?: number,
1608
+ collapse?: {
1609
+ level?: number,
1610
+ allChildren?: boolean
1611
+ }
1612
+ }
1613
+ };
1614
+ },
1615
+ /**
1616
+ * Minimize/Maximize node. The template has to have min defined. Default value - *false*.
1617
+ * ```typescript
1618
+ * var chart = new OrgChart('#tree', {
1619
+ * min: true
1620
+ * });
1621
+ * ```
1622
+ * {@link https://balkan.app/OrgChartJS/Docs/MinMax | See doc...}
1623
+ */
1624
+ min?: false,
1625
+ /**
1626
+ * Node binding in Org Chart JS maps node data to node template parameters.
1627
+ * ```typescript
1628
+ * var chart = new OrgChart('#tree', {
1629
+ * nodeBinding: {
1630
+ * field_0: "name"
1631
+ * },
1632
+ * nodes: [
1633
+ * { id: 1, name: "Amber McKenzie" }
1634
+ * ]
1635
+ * });
1636
+ * ```
1637
+ */
1638
+ nodeBinding?: { [key: string]: string },
1639
+ /**
1640
+ * Link binding in Org Chart JS maps node data to link template parameters.
1641
+ * ```typescript
1642
+ * var chart = new OrgChart('#tree', {
1643
+ * nodeBinding: {
1644
+ * link_field_0: "createdAt"
1645
+ * },
1646
+ * nodes: [
1647
+ * { id: "1", name: "Amber McKenzie" },
1648
+ * { id: "2", pid: "1", createdAt: "Since 08/08/2018" },
1649
+ * { id: "3", pid: "1", createdAt: "Since 05/04/2018" }
1650
+ * ]
1651
+ * });
1652
+ * ```
1653
+ * {@link https://balkan.app/OrgChartJS/Docs/Link | See doc...}
1654
+ */
1655
+ linkBinding?: { [key: string]: string },
1656
+ /**
1657
+ * Search by the fields defined in searchFields.
1658
+ * ```typescript
1659
+ * var chart = new OrgChart('#tree', {
1660
+ * searchFields: ["name", "title", etc...]
1661
+ * });
1662
+ * ```
1663
+ * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
1664
+ */
1665
+ searchFields?: Array<string>,
1666
+ /**
1667
+ * Displays a field in the search result.
1668
+ * ```typescript
1669
+ * var chart = new OrgChart('#tree', {
1670
+ * searchDisplayField: "name"
1671
+ * });
1672
+ * ```
1673
+ * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
1674
+ */
1675
+ searchDisplayField?: string,
1676
+ /**
1677
+ * Search by weight of the fields.
1678
+ * ```typescript
1679
+ * var chart = new OrgChart('#tree', {
1680
+ * searchFieldsWeight: {
1681
+ * "Name": 100, //percent
1682
+ * "Title": 20 //percent
1683
+ * }
1684
+ * });
1685
+ * ```
1686
+ * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
1687
+ */
1688
+ searchFieldsWeight?: { [key: string]: number },
1689
+ /**
1690
+ * Array of node data JSON objects. nodes option is the data source of the chart. Node JSON objects could have unlimited number of properties, id, pid, ppid, stpid and tags are reserved node properties.
1691
+ * - id - unique identifier, it clould be integer or string
1692
+ * - pid - is the parent id
1693
+ * - stpid - subtree parent id
1694
+ * - ppid - parent partner id
1695
+ * - tags - array of strings
1696
+ * ```typescript
1697
+ * var chart = new OrgChart('#tree', {
1698
+ * nodes: [
1699
+ * { id: 1 },
1700
+ * { id: 2, pid: 1, tags: ["Sales"] },
1701
+ * { id: 3, stpid: 2 }
1702
+ * ]
1703
+ * });
1704
+ * ```
1705
+ */
1706
+ nodes?: Array<string | number>,
1707
+ /**
1708
+ * Adds curved link.
1709
+ * ```typescript
1710
+ * var chart = new OrgChart('#tree', {
1711
+ * clinks: [
1712
+ * from: 4, to: 0, label: 'text'},
1713
+ * {from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
1714
+ * {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
1715
+ * ]
1716
+ * });
1717
+ * ```
1718
+ */
1719
+ clinks?: Array<OrgChart.link>,
1720
+ /**
1721
+ * Adds second link.
1722
+ * ```typescript
1723
+ * var chart = new OrgChart('#tree', {
1724
+ * slinks: [
1725
+ * from: 4, to: 0, label: 'text'},
1726
+ * {from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
1727
+ * {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' }
1728
+ * ]
1729
+ * });
1730
+ * ```
1731
+ */
1732
+ slinks?: Array<OrgChart.link>,
1733
+ /**
1734
+ * The gap between each level. Default value - *60*
1735
+ * ```typescript
1736
+ * var chart = new OrgChart('#tree', {
1737
+ * levelSeparation: 50
1738
+ * });
1739
+ * ```
1740
+ */
1741
+ levelSeparation?: number,
1742
+ /**
1743
+ * The gap between nodes in a subtree. Default value - *20*
1744
+ * ```typescript
1745
+ * var chart = new OrgChart('#tree', {
1746
+ * siblingSeparation: 50
1747
+ * });
1748
+ * ```
1749
+ */
1750
+ siblingSeparation?: number,
1751
+ /**
1752
+ * The gap between subtrees. Default value - *40*
1753
+ * ```typescript
1754
+ * var chart = new OrgChart('#tree', {
1755
+ * subtreeSeparation: 50
1756
+ * });
1757
+ * ```
1758
+ */
1759
+ subtreeSeparation?: number,
1760
+ /**
1761
+ * The gap between nodes in vertical layout. Default value - *20*
1762
+ * ```typescript
1763
+ * var chart = new OrgChart('#tree', {
1764
+ * mixedHierarchyNodesSeparation: 5
1765
+ * });
1766
+ * ```
1767
+ */
1768
+ mixedHierarchyNodesSeparation?: number,
1769
+ /**
1770
+ * Set the assistant separation value. Default value - *100*
1771
+ * ```typescript
1772
+ * var chart = new OrgChart('#tree', {
1773
+ * assistantSeparation: 150
1774
+ * });
1775
+ * ```
1776
+ */
1777
+ assistantSeparation?: number,
1778
+ /**
1779
+ * Minimum gap between partner and node with partners. Default value - *50*
1780
+ * ```typescript
1781
+ * var chart = new OrgChart('#tree', {
1782
+ * minPartnerSeparation: 100
1783
+ * });
1784
+ * ```
1785
+ */
1786
+ minPartnerSeparation?: number,
1787
+ /**
1788
+ * Gap between partner links. Default value - *20*
1789
+ * ```typescript
1790
+ * var chart = new OrgChart('#tree', {
1791
+ * partnerChildrenSplitSeparation: 50
1792
+ * });
1793
+ * ```
1794
+ */
1795
+ partnerChildrenSplitSeparation?: number,
1796
+ /**
1797
+ * Gap between partners. Default value - *15*
1798
+ * ```typescript
1799
+ * var chart = new OrgChart('#tree', {
1800
+ * partnerNodeSeparation: 30
1801
+ * });
1802
+ * ```
1803
+ */
1804
+ partnerNodeSeparation?: number,
1805
+ /**
1806
+ * The number of colums if the chart has multiple root nodes. Default value - *10*
1807
+ * ```typescript
1808
+ * var chart = new OrgChart('#tree', {
1809
+ * columns: 1
1810
+ * });
1811
+ * ```
1812
+ */
1813
+ columns?: number,
1814
+ /**
1815
+ * The padding option sets the padding area on all four sides of the OrgChart. Default value - *30*
1816
+ * ```typescript
1817
+ * var chart = new OrgChart('#tree', {
1818
+ * padding: 20
1819
+ * });
1820
+ * ```
1821
+ */
1822
+ padding?: number,
1823
+ /**
1824
+ * Specifies the orientation of the Org Chart JS. could accept one of the following values:
1825
+ * - OrgChart.orientation.top
1826
+ * - OrgChart.orientation.bottom
1827
+ * - OrgChart.orientation.right
1828
+ * - OrgChart.orientation.left
1829
+ * - OrgChart.orientation.top_left
1830
+ * - OrgChart.orientation.bottom_left
1831
+ * - OrgChart.orientation.right_top
1832
+ * - OrgChart.orientation.left_top
1833
+ *
1834
+ * Default value - *OrgChart.orientation.top*
1835
+ * ```typescript
1836
+ * var chart = new OrgChart('#tree', {
1837
+ * orientation: OrgChart.orientation.bottom
1838
+ * });
1839
+ * ```
1840
+ */
1841
+ orientation?: OrgChart.orientation,
1842
+ /**
1843
+ * Sets the layout algoritm:
1844
+ * - OrgChart.layout.normal
1845
+ * - OrgChart.layout.mixed
1846
+ * - OrgChart.layout.tree
1847
+ * - OrgChart.layout.treeLeftOffset
1848
+ * - OrgChart.layout.treeRightOffset
1849
+ *
1850
+ * Default value - *OrgChart.layout.normal*
1851
+ * ```typescript
1852
+ * var chart = new OrgChart('#tree', {
1853
+ * layout: OrgChart.layout.mixed
1854
+ * });
1855
+ * ```
1856
+ */
1857
+ layout?: OrgChart.layout | number,
1858
+ /**
1859
+ * The scale factor determines what fraction of the entire scale is visible at one time.
1860
+ * - OrgChart.match.height
1861
+ * - OrgChart.match.width
1862
+ * - OrgChart.match.boundary
1863
+ * - [number]
1864
+ *
1865
+ * Default value - *1*
1866
+ * ```typescript
1867
+ * var chart = new OrgChart('#tree', {
1868
+ * scaleInitial: OrgChart.match.boundary
1869
+ * });
1870
+ * ```
1871
+ * {@link https://balkan.app/OrgChartJS/Docs/Layout | See doc...}
1872
+ */
1873
+ scaleInitial?: number | OrgChart.match,
1874
+ /**
1875
+ * Determines the minimum scale factor. Default value - *0.1*
1876
+ * ```typescript
1877
+ * var chart = new OrgChart('#tree', {
1878
+ * scaleMin: 0.2
1879
+ * });
1880
+ * ```
1881
+ */
1882
+ scaleMin?: number,
1883
+ /**
1884
+ * Determines the naximum scale factor. Default value - *5*
1885
+ * ```typescript
1886
+ * var chart = new OrgChart('#tree', {
1887
+ * scaleMax: 10
1888
+ * });
1889
+ * ```
1890
+ */
1891
+ scaleMax?: number,
1892
+ /**
1893
+ * The orderBy option is used to sort the nodes in ascending order by specified field. The default order is by nodes order in the nodes array. Default value - *null*
1894
+ * ```typescript
1895
+ * var chart = new OrgChart('#tree', {
1896
+ * orderBy: "orderId",
1897
+ * nodes: [
1898
+ * { id: 10, pid: 1, orderId: 2 },
1899
+ * { id: 11, pid: 1, orderId: 1 }
1900
+ * ]
1901
+ * });
1902
+ * ```
1903
+ * ```typescript
1904
+ * var chart = new OrgChart('#tree', {
1905
+ * orderBy: [field: "orderId", desc: true],
1906
+ * nodes: [
1907
+ * { id: 10, pid: 1, orderId: 2 },
1908
+ * { id: 11, pid: 1, orderId: 1 }
1909
+ * ]
1910
+ * });
1911
+ * ```
1912
+ */
1913
+ orderBy?: string,
1914
+ /**
1915
+ * @ignore
1916
+ */
1917
+ editUI?: OrgChart.editUI,
1918
+ /**
1919
+ * @ignore
1920
+ */
1921
+ searchUI?: OrgChart.searchUI,
1922
+ /**
1923
+ * @ignore
1924
+ */
1925
+ xScrollUI?: any,
1926
+ /**
1927
+ * @ignore
1928
+ */
1929
+ yScrollUI?: any,
1930
+ /**
1931
+ * @ignore
1932
+ */
1933
+ nodeMenuUI?: OrgChart.menuUI,
1934
+ /**
1935
+ * @ignore
1936
+ */
1937
+ nodeCircleMenuUI?: OrgChart.circleMenuUI,
1938
+ /**
1939
+ * @ignore
1940
+ */
1941
+ nodeContextMenuUI?: OrgChart.menuUI,
1942
+ /**
1943
+ * @ignore
1944
+ */
1945
+ toolbarUI?: OrgChart.toolbarUI,
1946
+ /**
1947
+ * @ignore
1948
+ */
1949
+ notifierUI?: any,
1950
+ /**
1951
+ * @ignore
1952
+ */
1953
+ menuUI?: OrgChart.menuUI,
1954
+ /**
1955
+ * @ignore
1956
+ */
1957
+ UI?: any,
1958
+ /**
1959
+ * The URL to the export server. Default value - *https://balkan.app/export*
1960
+ * ```typescript
1961
+ * var chart = new OrgChart('#tree', {
1962
+ * exportUrl: "https://balkan.app/export"
1963
+ * });
1964
+ * ```
1965
+ */
1966
+ exportUrl?: string,
1967
+ /**
1968
+ * Collapse specified level of the chart and its children if allChildren is true.
1969
+ * ```typescript
1970
+ * var chart = new OrgChart('#tree', {
1971
+ * collapse: {level: 2, allChildren: true}
1972
+ * });
1973
+ * ```
1974
+ */
1975
+ collapse?: {
1976
+ level: number,
1977
+ allChildren?: boolean
1978
+ },
1979
+ /**
1980
+ * Expand specified node ids and its children if allChildren is true. The expand option works only if collapse is set.
1981
+ *
1982
+ * In the example above the second level of the chart will be collapsed but node with id 155 and its children will be expanded.
1983
+ * ```typescript
1984
+ * var chart = new OrgChart('#tree', {
1985
+ * collapse: {level: 2, allChildren: true},
1986
+ * expand: {nodes: [155], allChildren: true}
1987
+ * });
1988
+ * ```
1989
+ */
1990
+ expand?: {
1991
+ nodes?: Array<string | number>,
1992
+ allChildren?: boolean
1993
+ },
1994
+ /**
1995
+ * The align option specifies the alignment of the nodes inside Org Chart JS.
1996
+ * - OrgChart.align.center - centered
1997
+ * - OrgChart.align.orientation - according to the orientation option
1998
+ *
1999
+ * Default value - *OrgChart.align.center*
2000
+ * ```typescript
2001
+ * var chart = new OrgChart('#tree', {
2002
+ * align: OrgChart.align.orientation
2003
+ * });
2004
+ * ```
2005
+ */
2006
+ align?: OrgChart.align | number,
2007
+ /**
2008
+ * Can be used to control the transition of the nodes on expand/collapse operation. Default value - *func: OrgChart.anim.outPow, duration: 200*
2009
+ * ```typescript
2010
+ * var chart = new OrgChart('#tree', {
2011
+ * anim: {func: OrgChart.anim.outBack, duration: 500}
2012
+ * });
2013
+ * ```
2014
+ */
2015
+ anim?: {
2016
+ /**
2017
+ * defines how long time an animation should take to complete
2018
+ */
2019
+ func?: OrgChart.anim,
2020
+ /**
2021
+ * Easing functions specify the speed at which an animation progresses at different points within the animation.
2022
+ */
2023
+ duration?: number
2024
+ },
2025
+ /**
2026
+ * Can be used to control the zooming sensitivity. Default value - *speed: 120, smooth: 12*
2027
+ * ```typescript
2028
+ * var chart = new OrgChart('#tree', {
2029
+ * zoom: {speed: 130, smooth: 10}
2030
+ * });
2031
+ * ```
2032
+ */
2033
+ zoom?: {
2034
+ speed?: number,
2035
+ smooth?: number
2036
+ },
2037
+ /**
2038
+ * Define nodes as roots. Default value - *null*
2039
+ * ```typescript
2040
+ * var chart = new OrgChart('#tree', {
2041
+ * roots: [2, 4]
2042
+ * });
2043
+ * ```
2044
+ */
2045
+ roots?: Array<string | number>,
2046
+ /**
2047
+ * Persist the state (scale, position, expanded/collapsed and min/max nodes) in the url or indexedDB. Default value - *null*
2048
+ * ```typescript
2049
+ * var chart = new OrgChart('#tree', {
2050
+ * state: {
2051
+ * name: 'StateForMyOrgChart',
2052
+ * readFromLocalStorage: true,
2053
+ * writeToLocalStorage: true,
2054
+ * readFromIndexedDB: true,
2055
+ * writeToIndexedDB: true,
2056
+ * readFromUrlParams: true,
2057
+ * writeToUrlParams: true
2058
+ * }
2059
+ * });
2060
+ * ```
2061
+ */
2062
+ state?: {
2063
+ name?: string,
2064
+ readFromLocalStorage?: boolean,
2065
+ writeToLocalStorage?: boolean,
2066
+ readFromIndexedDB?: boolean,
2067
+ writeToIndexedDB?: boolean,
2068
+ readFromUrlParams?: boolean,
2069
+ writeToUrlParams?: boolean
2070
+ },
2071
+ /**
2072
+ * Configure the buildin edit form.
2073
+ * {@link https://balkan.app/OrgChartJS/Docs/Edit | See doc...}
2074
+ */
2075
+ editForm?: {
2076
+ readOnly?: boolean,
2077
+ titleBinding?: string,
2078
+ photoBinding?: string,
2079
+ addMore?: string,
2080
+ addMoreBtn?: string,
2081
+ addMoreFieldName?: string,
2082
+ generateElementsFromFields?: boolean,
2083
+ buttons?: {
2084
+ [key: string]: {
2085
+ icon?: string,
2086
+ text?: string,
2087
+ hideIfEditMode?: boolean,
2088
+ hideIfDetailsMode?: boolean
2089
+ }
2090
+ },
2091
+ elements?: { [key: string]: OrgChart.editFormElement | Array<OrgChart.editFormElement> }
2092
+ }
2093
+ }
1980
2094
  }export default OrgChart