forked from BALKANGraph/OrgChartJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorgchart.d.ts
2213 lines (2124 loc) · 71.6 KB
/
orgchart.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare class OrgChart extends OrgChartBase {
nodes: { [key in any]: OrgChart.node };
isVisible: boolean;
/**
* @param element HTML element or string selector for example '#tree'
* @param options configuration options
*/
constructor(element: HTMLElement | string, options?: OrgChart.options);
/**
* Updates the node data
* @param newData node data
*/
update(newData: object): OrgChart;
/**
* Removes specified node from nodes collection
* @param id identification number of the node
*/
remove(id: string | number): OrgChart;
/**
* Adds new node to the nodes collection
* @param data node data
*/
add(data: object): OrgChart;
/**
* Gets node data.
* @param id identification number of the node
*/
get(id: string | number): object;
/**
* If specified node has assistant/s or partner/s as children will return false.
* @param id identification number of the node
*/
canRemove(id: string | number): boolean;
/**
* Expands specified nodes.
* @param id the id of the node that will not move during the animation
* @param ids node ids that will be expanded
* @param callback called after the animation completes
*/
expand(id: string | number, ids: Array<string | number>, callback?: () => void): void;
/**
* Collapses specified nodes.
* @param id the id of the node that will not move
* @param ids node ids that will be collapsed
* @param callback called after the animation completes
*/
collapse(id: string | number, ids: Array<string | number>, callback?: () => void): void;
/**
* Expand/Collapse lists of nodes.
* @param id the id of the node that will not move
* @param expandIds expand all nodes with ids
* @param collapseIds collpase all nodes with ids
* @param callback called after the animation completes
*/
expandCollapse(id: string | number, expandIds: Array<string | number>, collapseIds: Array<string | number>, callback?: () => void): void;
/**
* Changes roots order.
* @param id id of a node that will not change is position, can be null
* @param roots roots id array in the required order
* @param callback called after the roots are changed and animation completes
*/
changeRoots(id: string | number, roots: Array<string | number>, callback?: () => void): void;
/**
* Maximize the node. Without parameters maximize all nodes.
* @param id the id of the node, if id is null, undefined ot empty string will maximize all nodes
* @param horizontalCenter center horizontally
* @param verticalCenter center vertically
* @param callback called when the animation completes
*/
maximize(id?: string | number, horizontalCenter?: boolean, verticalCenter?: boolean, callback?: () => void): void;
/**
* Minimize the node. Without parameters minimize all nodes.
* @param id the id of the node, if id is null, undefined ot empty string will minimize all nodes
* @param callback called when the animation completes
*/
minimize(id?: string | number, callback?: () => void): void;
/**
* Load nodes data.
* @param data node data array
*/
load(data: Array<object>): OrgChart;
/**
* Updates the node data, redraws the chart and fires update event.
* @param data node data
* @param callback function called when the animation completes
* @param fireEvent if it set to true the update event is called
*/
updateNode(data: object, callback?: () => void, fireEvent?: boolean): void;
/**
* Loads nodes from xml.
* @param xml Xml with node structure
*/
loadXML(xml: string): OrgChart;
/**
* Gets nodes as xml.
*/
getXML(): string;
/**
* Draws the chart.
* @param action Action for example OrgChart.action.centerNode, default is OrgChart.action.update
* @param actionParams parameters for the action
* @param callback called when the animation completes
*/
draw(action?: OrgChart.action, actionParams?: any, callback?: () => void): void;
/**
* Gets the width of the container.
*/
width(): number;
/**
* Gets the height of the container.
*/
height(): number;
/**
* Gets the view box attribute of the svg html element.
*/
getViewBox(): Array<number>;
/**
* Sets the view box attribute of the svg html element.
* @param viewBox
*/
setViewBox(viewBox: Array<number>): void;
/**
* Gets the current scale of the chart.
* @param viewBox
*/
getScale(viewBox?: Array<number>): number;
/**
* Animates specified node with ripple animation - highlight the node.
* @param id the id of the node
* @param clientX x value of the ripple center in the node
* @param clientY y value of the ripple center in the node
*/
ripple(id: string | number, clientX?: number, clientY?: number): void;
/**
* Centers specified node on the screen.
* @param nodeId the id of the node
* @param options { parentState: OrgChart.COLLAPSE_PARENT_NEIGHBORS, childrenState: OrgChart.COLLAPSE_SUB_CHILDRENS, rippleId: rippleId, vertical: false, horizontal: false });
* @param callback called when the animation completes
*/
center(nodeId: string | number, options?: {
parentState: any,
childrenState: any,
rippleId: string | number,
vertical: boolean,
horizontal: boolean
} | null, callback?: () => void): void;
/**
* Fits the content to the visible area.
* @param callback called when the animation completes
*/
fit(callback?: () => void): void;
/**
* Toggles full screen mode.
*/
toggleFullScreen(): void;
/**
* Gets the node as {@link OrgChart.node} object.
* @param nodeId
*/
getNode(nodeId: string | number): OrgChart.node;
/**
* Sets layout.
* @param layout layout type
* @param lcn lyout config name for the specified sub tree
*/
/**
* Adds new node to the nodes collection, redraws the chart and fires remove event
* @param data node data
* @param callback called at the end of animation
* @param fireEvent indicates if the add event will be called or not
*/
addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
setLayout(layout: OrgChart.layout | number, lcn?: string): void;
/**
* Sets orientation.
* @param orientation orientation type
* @param lcn lyout config name for the specified sub tree
*/
setOrientation(orientation: OrgChart.orientation, lcn?: string): void;
/**
* Search in the chart.
* @param value search for value
* @param searchInFileds search in field names
* @param retrieveFields retrive data for fields
* {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...}
*/
search(value: string, searchInFileds?: Array<string>, retrieveFields?: Array<string>): Array<{
id: number | string,
name: string,
__score: number,
__searchField: string,
__searchMarks: string
}>;
/**
* Gets collpased node ids of the specifeid node
* @param node
*/
getCollapsedIds(node: OrgChart.node): Array<string | number>;
/**
* State to url.
* {@link https://balkan.app/OrgChartJS/Docs/State | See doc...}
*/
stateToUrl(): string;
/**
* Genereates unique identification number that can be used for new nodes
*/
generateId(): string;
/**
* Destroys the object.
*/
destroy(): void;
/**
* Adds curved link.
* @param from from node with id
* @param to to node with id
* @param label link label
* @param template link template, for example 'orange'
*/
addClink(from: string | number, to: string | number, label?: string, template?: string): OrgChart;
/**
* Removes curved link.
* @param from from node with id
* @param to to node with id
*/
removeClink(from: string | number, to: string | number): OrgChart;
/**
* Adds second link.
* @param from from node with id
* @param to to node with id
* @param label link label
* @param template link template, for example 'orange'
*/
addSlink(from: string | number, to: string | number, label?: string, template?: string): OrgChart;
/**
* Removes second link.
* @param from from node with id
* @param to to node with id
*/
removeSlink(from: string | number, to: string | number): OrgChart;
/**
* Gets svg html element
*/
getSvg(): SVGAElement;
/**
* Gets node html element
* @param id node id
*/
getNodeElement(id: string | number): HTMLElement;
/**
* Gets menu button html element
*/
getMenuButton(): HTMLElement;
/**
* Exports the details form to PDF.
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
exportPDFProfile(options: OrgChart.exportOptions, callback?: () => void): void;
exportPDFPreview(options: OrgChart.exportOptions): void;
/**
* Exports the details form to PDF.
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
exportPNGProfile(options: OrgChart.exportOptions, callback?: () => void): void;
/**
* Exports to CSV
* @param id if not defained exports all nodes if defined exports childrens
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
exportCSV(id?: string | number): void;
/**
* Shares node data, uses build-in device sharing functionallity.
* @param id node id
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
shareProfile(id: string | number): void;
/**
* Exports to PDF document
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
exportPDF(options?: OrgChart.exportOptions, callback?: () => void): void;
/**
* Exports to PNG document
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
exportPNG(options?: OrgChart.exportOptions, callback?: () => void): void;
/**
* Exports to SVG document
* @param options export options
* @param callback called when the export completes
* {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...}
*/
exportSVG(options?: OrgChart.exportOptions, callback?: () => void): void;
/**
* Imports CSV file.
* {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
*/
importCSV(): void;
/**
* Imports XML file.
* {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...}
*/
importXML(filename?: string): void;
/**
* Zoom out or zoom in the chart.
* @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.
* @param center array [x, y], where x is x percantege from the width and y is y percentage from the height.
* @param shouldAnimate should animate
* @param callback called when the animation completes
*/
zoom(delta: boolean | number, center?: Array<number>, shouldAnimate?: boolean, callback?: () => void): void;
/**
* Magnify(Zoom in) specific node in the chart.
* @param id id of the node
* @param scale scale to magnify
* @param front show on front or back
* @param anim animation type
*/
magnify(id: string | number, scale: number, front?: boolean, anim?: OrgChart.anim | null, callback?: () => void): void;
/**
* The onField() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onField((args) => {
* //return false; to cancel
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onField(listener: (args: {
/**
* the node
*/
node: OrgChart.node,
/**
* node data json object
*/
data: object,
/**
* value of the filed, can be changed in the event
*/
value: any,
/**
* svg or html element of the filed, can be changed in the event
*/
element: string,
/**
* name of the field
*/
name: string
}) => void | boolean): OrgChart;
/**
* Occurs when the nodes in OrgChart has been created and loaded to the DOM.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onInit(() => {
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onInit(listener: () => void): OrgChart;
/**
* The onRedraw event occurs when the chart is redrawed.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onRedraw(() => {
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onRedraw(listener: () => void): OrgChart;
/**
* The onExpandCollpaseButtonClick event occurs when the chart is redrawed.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onExpandCollpaseButtonClick(() => {
* //return false; to cancel the operation
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onExpandCollpaseButtonClick(listener: (args: {
/**
* Indicates id the operation is collaps or expand
*/
collapsing: boolean,
/**
* the id of the clicked node
*/
id: number | string,
/**
* node ids that will be expanded or collapsed
*/
ids: Array<number | string>
}) => void): OrgChart;
/**
* 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.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onExportStart(() => {
* args.styles += '<link href="https://fonts.googleapis.com/css?family=Gochi+Hand" rel="stylesheet">';
* //return false; to cancel the operation
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onExportStart(listener: (args:
{
/**
* the content to be exported
*
* this property is initialized only for PDF/PNG/SVG exports
*/
content: string,
/**
* export options
*
* this property is initialized only for PDF/PNG/SVG exports
*/
options: OrgChart.exportOptions,
/**
* add extra styles
*
* this property is initialized only for PDF/PNG/SVG exports
*/
styles: string,
/**
* an object that discribes pages to be exported
*
* this property is initialized only for PDF/PNG exports
*/
pages: any,
/**
* extension
*
* this property is initialized only for CSV/XML
*/
ext: string,
/**
* filename, you can change the filename here
*
* this property is initialized only for CSV/XML exports
*/
filename: string,
/**
* array of node objects
*
* this property is initialized only for CSV/XML exports
*/
nodes: Array<object>
}) => void): OrgChart;
/**
* 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.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onExportEnd(() => {
* //return false; to cancel the operation for example id you prefer the exported document to not download
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onExportEnd(listener: (args:
/**
* for PDF/PNG
*/
{
/**
* the array buffer is the exported document, you can save it on a server or send it via email
*
* this property is initialized only for PDF/PNG exports
*/
ArrayBuffer: ArrayBuffer
/**
* extension
*
* this property is initialized only for CSV/XML exports
*/
ext: string,
/**
* filename, you can change the filename here
*
* this property is initialized only for CSV/XML exports
*/
filename: string,
/**
* an array of node objects
*
* this property is initialized only for CSV/XML exports
*/
nodes: Array<object>,
/**
* csv ot xml string
*
* this property is initialized only for CSV/XML/SVG exports
*/
content: string
/**
* export options
*
* this property is initialized only for SVG exports
*/
options: OrgChart.exportOptions,
/**
* add extra styles
*
* this property is initialized only for SVG exports
*/
styles: string,
}) => void): OrgChart;
/**
* On node click event listener.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onNodeClick(() => {
* //return false; to cancel the operation
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onNodeClick(listener: (args: {
/**
* node JSON object
*/
node: OrgChart.node,
/**
* the browser event
*/
event: any
}) => void): OrgChart;
/**
* On node double click event listener.
* ```typescript
* var chart = new OrgChart('#tree', {});
* chart.onNodeDoubleClick(() => {
* //return false; to cancel the operation
* });
* chart.load(nodes);
* ```
* @category Event Listeners
* @param listener
*/
onNodeDoubleClick(listener: (args: {
/**
* clicked node data
*/
data: object
}) => void): OrgChart;
editUI: OrgChart.editUI;
searchUI: OrgChart.searchUI;
nodeMenuUI: OrgChart.menuUI;
nodeCircleMenuUI: OrgChart.circleMenuUI;
nodeContextMenuUI: OrgChart.menuUI;
menuUI: OrgChart.menuUI;
toolbarUI: OrgChart.toolbarUI;
config: OrgChart.options
static fileUploadDialog(callback: (file: any) => void): void;
static isMobile(): boolean;
/**
* Checks if the used libraris is licnsed or not
*/
static isTrial(): boolean;
/**
* Count all children nodes of the specified id.
* @param chart OrgChart instance
* @param node
* @param count
*/
static childrenCount(chart: OrgChart, node: OrgChart.node, count?: number): number;
static collapsedChildrenCount(chart: OrgChart, node: OrgChart.node, count?: number): number;
static getRootOf(node: OrgChart.node): OrgChart.node;
/**
* is null, empty or undefined
* @param val
*/
static isNEU(val: any): boolean;
static gradientCircleForDefs(id: string | number, colors: Array<string> | string, r: number, strokeWidth: number): string;
static convertCsvToNodes(text: string) : Array<OrgChart.node>;
/**
* Shows/hides lloading image. Usefull when export large data to pdf. You can override and show your own loading image.
*/
static loading: {
show: (chart: OrgChart) => void,
hide: (chart: OrgChart) => void
}
static clinkTemplates: {
[key: string]: OrgChart.linkTemplate
}
static slinkTemplates: {
[key: string]: OrgChart.linkTemplate
}
static templates :{ [key: string]: OrgChart.template} ;
static scroll: {
visible?: boolean,
smooth?: number,
speed?: number,
safari?: { smooth?: number; speed?: number; },
edge?: { smooth?: number; speed?: number; },
chrome?: { smooth?: number; speed?: number; },
firefox?: { smooth?: number; speed?: number; },
opera?: { smooth?: number; speed?: number; }
};
static events: {
on(type: "node-created" | "layout", listener: (args: any, args1: any, args2: any) => void): void
};
static state: { clear(stateName: string): void };
static animate(element: Object, attrStart?: Object, attrEnd?: Object, duration?: number, func?: OrgChart.anim, callback?: Function, tick?: boolean): void;
static VERSION: string;
/**
* @ignore
*/
static TEXT_THRESHOLD: number;
/**
* @ignore
*/
static IMAGES_THRESHOLD: number;
/**
* @ignore
*/
static LINKS_THRESHOLD: number;
/**
* @ignore
*/
static BUTTONS_THRESHOLD: number;
/**
* @ignore
*/
static ANIM_THRESHOLD: number;
/**
* @ignore
*/
static IT_IS_LONELY_HERE: string;
/**
* @ignore
*/
static RES: {
/**
* @ignore
*/
IT_IS_LONELY_HERE_LINK: string
};
/**
* @ignore
*/
static FIRE_DRAG_NOT_CLICK_IF_MOVE: number;
/**
* @ignore
*/
static STRING_TAGS: boolean;
/**
* @ignore
*/
static SEARCH_PLACEHOLDER: string;
/**
* @ignore
*/
static IMPORT_MESSAGE: string;
/**
* @ignore
*/
static FIXED_POSITION_ON_CLICK: boolean;
/**
* @ignore
*/
static RENDER_LINKS_BEFORE_NODES: boolean;
/**
* @ignore
*/
static MIXED_LAYOUT_ALL_NODES: boolean;
/**
* @ignore
*/
static MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN: boolean;
/**
* @ignore
*/
static LINK_ROUNDED_CORNERS: number;
/**
* @ignore
*/
static MOVE_STEP: number;
/**
* @ignore
*/
static MOVE_INTERVAL: number;
/**
* @ignore
*/
static CLINK_CURVE: number;
/**
* @ignore
*/
static SEARCH_RESULT_LIMIT: number;
/**
* @ignore
*/
static MAX_DEPTH: number;
/**
* @ignore
*/
static SCALE_FACTOR: number;
/**
* @ignore
*/
static LAZY_LOADING_FACTOR: number;
/**
* Can be used to instruct the browser to defer loading of OrgChart that are off-screen until the user scrolls near them.
* The init event listener will be called as soon as the OrgChart become visible.
*/
static LAZY_LOADING: boolean;
/**
* Hides the Edit Form when the chart is moved with pan
*/
static HIDE_EDIT_FORM_ON_PAN: boolean;
/**
* @ignore
*/
static element: HTMLElement;
static randomId(): any;
static searchUI: any;
static attr: any;
static toolbarUI: any;
static elements: any;
static expcollOpenTag: any;
static grCloseTag: any;
}
declare namespace OrgChart {
/**
* deprecated
* @ignore
*/
const none: number;
/**
* @ignore
*/
const COLLAPSE_PARENT_NEIGHBORS: number;
/**
* @ignore
*/
const COLLAPSE_SUB_CHILDRENS: number;
var template: object;
interface node {
/**
* the same id you provided in the source node
*/
id?: string | number,
/**
* 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.
*/
ppid?: string | number,
/**
* 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
*/
parent?: node,
/**
* 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.
*/
stpid?: string | number,
/**
* - 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
*/
stParent?: node,
isPartner?: boolean,
partnerSeparation?: number,
/**
* array of ids, always initialized
*/
childrenIds?: Array<string | number>,
/**
* array of children nodes, initialized on demand if all children are collpased it will be empty array
*/
children?: Array<node>,
/**
* array of sub tree children root node ids, always initialized
*/
stChildrenIds?: Array<string | number>,
/**
* array of sub tree children root nodes, initialized on demand if the node is minimized it will be empty array
*/
stChildren?: Array<node>,
/**
* array of string values, the same array you provided in the source node
*/
tags?: Array<string>,
/**
* template name, you can specify multiple templates with tags in one chart
*/
templateName?: string,
/**
* a reference to the left node neighbor, the default value is undefined
*/
leftNeighbor?: node | undefined,
/**
* a reference to the right node neighbor, the default value is undefined
*/
rightNeighbor?: node | undefined,
/**
* x position, default value undefined
*/
x?: number | undefined,
/**
* y position, default value undefined
*/
y?: number | undefined,
/**
* width of the node, default value undefined
*/
w?: number | undefined,
/**
* height of the node, default value undefined
*/
h?: number | undefined,
/**
* if the node is assistant is true if not false if the node is not initialized is undefined
*/
isAssistant?: boolean | undefined,
/**
* sub tree container nodes array, property only for the root node, default value undefined
*/
stContainerNodes?: Array<node> | undefined,
/**
* it is set only if you define order option, default value undefined
*/
order?: number | undefined,
/**
* true if the node is collpased, false if it is not and undefined if not initalized
*/
collapsed?: boolean | undefined,
/**
* a level of the node starting from zero
*/
level?: number,
/**
* true if the node is minimized, default value undefined
*/
min?: boolean | undefined,
/**
* sub levels, default value undefined
*/
subLevels?: number | undefined,
/**
* set only if the node contains sub trees and padding is defined in the template, default value undefined
*/
padding?: number | undefined,
/**
* layout configuration name, default value undefined
*/
lcn?: string | undefined,
/**
* for assistant nodes and mixed layout we create dynamic nodes called splits, default value undefined
*/
isSplit?: boolean | undefined
}
interface template
{
defs?: string,
size?: Array<number>,
expandCollapseSize?: number,
linkAdjuster?: {
fromX?: number,
fromY?: number,
toX?: number,
toY?: number
},
ripple?: {
radius?: number,
color?: string,
rect?: Array<number>
},
assistanseLink?: string,
svg?: string,
link?: string,
pointer?: string,
node?: string,
plus?: string,
minus?: string,
nodeMenuButton?: string,
menuButton?: string,
img_0?: string,
link_field_0?: string,
editFormHeaderColor?: string,
nodeCircleMenuButton?: object,
min?: template,
[name: string]: any
}
interface editUI {
/**
* Inits edit ui
* @param obj
*/
init(obj: OrgChart): void;
/**
* The on() method of the editUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
* @category Event Listeners
* @param type A case-sensitive string representing the event type to listen for.
* @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
*/
on(type: "show" | "save" | "cancel" | "element-btn-click" | "button-click" | "hide", listener: (sender: editUI, args: any, args1: any, args2: any) => void | boolean): editUI;
/**
* Shows the edit form for the specified node id
* @param id node id
* @param detailsMode If true the edit form is in read only mode
* @param dontAnim
*/
show(id: string | number, detailsMode: boolean, dontAnim?: boolean): void;
/**
* Hides the edit form
*/
hide(): void;
content(id: string | number, detailsMode: boolean, dontAnim: boolean, width: string, dontRenderButtons: boolean): string;
/**
* Sets the avatar of the edit form
* @param avatarUrl avatar url
*/
setAvatar(avatarUrl?: string): void;
}
interface searchUI {
init(obj: OrgChart): void;
/**
* The on() method of the searchUI interface sets up a function that will be called whenever the specified event is delivered to the target. *
* @category Event Listeners
* @param type A case-sensitive string representing the event type to listen for.
* @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
*/
on(type: "searchclick", listener: (sender: OrgChart, args: any, args1: any, args2: any) => void | boolean): searchUI;
/**
* Hides the search grid
*/
hide(): void;
/**
* Finds filed data by specified value
* @param value search for value
*/
find(value: string): void;