├── OrgChart.js ├── README.md ├── bower.json ├── orgchart.d.ts └── package.json /README.md: -------------------------------------------------------------------------------- 1 | # ![OrgChart JS](https://balkangraph.com/content/img/icon-orgchart-js.png) OrgChart JS 2 | Build organizational chart app with BALKAN OrgChart JS JavaScript library. **OrgChart JS** is a simple, flexible and highly customizable organization chart plugin for presenting the structure of your organization and the relationships in an elegant way. 3 | 4 | ![OrgChart JS](https://balkan.app/Content/Img/oc.png) 5 | 6 | ## [Demos](https://balkan.app/OrgChartJS/Demos/BasicUsage)      [Docs](https://balkan.app/OrgChartJS/Docs/GettingStarted)      [Download](https://balkan.app/OrgChartJS/Download)      [Support](https://balkan.app/OrgChartJS/Support) 7 | 8 | ## Features 9 | - Supports both local data and remote data (JSON) 10 | - Smooth expand/collapse effects 11 | - Align the chart in 8 orientations 12 | - Allows user to change orgchart structure by drag/drop nodes 13 | - Supports pan and zoom 14 | - Edit Form 15 | - Node Customization 16 | - Search 17 | - Scroll Bars 18 | - Lazy Loading 19 | - Mixed Hierarchy 20 | - Exporting 21 | - Assistant 22 | - Partners 23 | - Sub Trees 24 | - Family Tree 25 | 26 | ## Installation 27 | Option 1 - [standalone build](https://balkan.app/OrgChartJS/Docs/GettingStarted) 28 | 29 | Option 2 - NPM 30 | ``` 31 | npm i @balkangraph/orgchart.js 32 | ``` 33 | 34 | Option 3 - Bower 35 | ``` 36 | bower install orgchart.js 37 | ``` 38 | 39 | 40 | ## Usage 41 | ``` 42 | 43 |
44 | 56 | ``` 57 | 58 | 59 | ## 1 click to talk 2 us 60 | 61 | [![OrgChart](https://balkangraph.com/content/img/phone-icon4.png)](https://webcall.me/BALKANGraph) 62 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orgchart.js", 3 | "authors": [ 4 | "BALKAN App" 5 | ], 6 | "description": "OrgChart JS is a simple, flexible and highly customizable organization chart plugin.", 7 | "main": "orgchart.js", 8 | "keywords": [ 9 | "diagram", 10 | "chart", 11 | "tree", 12 | "orgchart", 13 | "graph", 14 | "svg", 15 | "hierarchy", 16 | "family-tree", 17 | "decision-tree", 18 | "visualization", 19 | "tree-layout", 20 | "hierarchical", 21 | "javascript", 22 | "js", 23 | "html", 24 | "html5" 25 | ], 26 | "license": "MIT", 27 | "homepage": "https://balkan.app" 28 | } -------------------------------------------------------------------------------- /orgchart.d.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /** 5 | * ```typescript 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * OrgChartJS 12 | * 16 | * 17 | * 18 | * 19 | *
20 | * 32 | * 33 | * 34 | * ``` 35 | */ 36 | declare class OrgChart { 37 | /** 38 | * ```typescript 39 | * let chart = new OrgChart('#tree', {}); 40 | * ``` 41 | * @param element HTML element or string selector for example '#tree' 42 | * @param options configuration options 43 | */ 44 | constructor(element?: HTMLElement | string, options?: OrgChart.options); 45 | 46 | 47 | /** 48 | * SVG icons 49 | * @param w - width 50 | * @param h - height 51 | * @param c - color 52 | * @param x - X position 53 | * @param y - Y position 54 | * @returns string with the SVG definition 55 | */ 56 | static icon: { 57 | /** 58 | * ```typescript 59 | * let pngIcon = OrgChart.icon.png(24, 24, "#7A7A7A"); 60 | * ``` 61 | */ 62 | png: (w: string| number, h: string | number, c: string) => string, 63 | /** 64 | * ```typescript 65 | * let pdfIcon = OrgChart.icon.pdf(24, 24, "#7A7A7A"); 66 | * ``` 67 | */ 68 | pdf: (w: string | number, h: string | number, c: string) => string, 69 | /** 70 | * ```typescript 71 | * let svgIcon = OrgChart.icon.svg(24, 24, "#7A7A7A"); 72 | * ``` 73 | */ 74 | svg: (w: string| number, h: string| number, c: string | number) => string, 75 | /** 76 | * ```typescript 77 | * let csvIcon = OrgChart.icon.csv(24, 24, "#7A7A7A"); 78 | * ``` 79 | */ 80 | csv: (w: string| number, h: string| number, c: string| number) => string, 81 | /** 82 | * ```typescript 83 | * let excelIcon = OrgChart.icon.excel(24, 24, "#7A7A7A"); 84 | * ``` 85 | */ 86 | excel: (w: string| number, h: string| number, c: string| number) => string, 87 | /** 88 | * ```typescript 89 | * let powerPointIcon = OrgChart.icon.powerpoint(24, 24, "#7A7A7A"); 90 | * ``` 91 | */ 92 | powerpoint: (w: string| number, h: string| number, c: string| number) => string, 93 | /** 94 | * ```typescript 95 | * let powerPointPreviewIcon = OrgChart.icon.pppreview(24, 24, "#7A7A7A"); 96 | * ``` 97 | */ 98 | pppreview: (w: string| number, h: string| number, c: string| number) => string, 99 | /** 100 | * ```typescript 101 | * let editIcon = OrgChart.icon.edit(24, 24, "#7A7A7A"); 102 | * ``` 103 | */ 104 | edit: (w: string| number, h: string| number, c: string| number) => string, 105 | /** 106 | * ```typescript 107 | * let detailsIcon = OrgChart.icon.details(24, 24, "#7A7A7A"); 108 | * ``` 109 | */ 110 | details: (w: string| number, h: string| number, c: string| number) => string, 111 | /** 112 | * ```typescript 113 | * let removeIcon = OrgChart.icon.remove(24, 24, "#7A7A7A"); 114 | * ``` 115 | */ 116 | remove: (w: string| number, h: string| number, c: string| number) => string, 117 | /** 118 | * ```typescript 119 | * let addIcon = OrgChart.icon.add(24, 24, "#7A7A7A"); 120 | * ``` 121 | */ 122 | add: (w: string| number, h: string| number, c: string| number) => string, 123 | /** 124 | * ```typescript 125 | * let xmlIcon = OrgChart.icon.xml(24, 24, "#7A7A7A"); 126 | * ``` 127 | */ 128 | xml: (w: string| number, h: string| number, c: string| number) => string, 129 | /** 130 | * ```typescript 131 | * let visioIcon = OrgChart.icon.visio(24, 24, "#7A7A7A"); 132 | * ``` 133 | */ 134 | visio: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string, 135 | /** 136 | * ```typescript 137 | * let linkIcon = OrgChart.icon.link(24, 24, "#7A7A7A"); 138 | * ``` 139 | */ 140 | link: (w: string| number, h: string| number, c: string| number) => string, 141 | /** 142 | * ```typescript 143 | * let happyIcon = OrgChart.icon.happy(24, 24, "#7A7A7A"); 144 | * ``` 145 | */ 146 | happy: (w: string| number, h: string| number, c: string| number) => string, 147 | /** 148 | * ```typescript 149 | * let sadIcon = OrgChart.icon.sad(24, 24, "#7A7A7A"); 150 | * ``` 151 | */ 152 | sad: (w: string| number, h: string| number, c: string| number) => string, 153 | /** 154 | * ```typescript 155 | * let shareIcon = OrgChart.icon.share(24, 24, "#7A7A7A"); 156 | * ``` 157 | */ 158 | share: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string, 159 | /** 160 | * ```typescript 161 | * let userIcon = OrgChart.icon.user(24, 24, "#7A7A7A"); 162 | * ``` 163 | */ 164 | user: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string, 165 | /** 166 | * ```typescript 167 | * let undoIcon = OrgChart.icon.undo(24, 24, "#7A7A7A"); 168 | * ``` 169 | */ 170 | undo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string, 171 | /** 172 | * ```typescript 173 | * let redoIcon = OrgChart.icon.redo(24, 24, "#7A7A7A"); 174 | * ``` 175 | */ 176 | redo: (w: string| number, h: string| number, c: string| number, x?: string| number, y?: string| number) => string 177 | } 178 | 179 | 180 | 181 | /** 182 | * Can update link (Does the node is dropping under itself) 183 | * ```typescript 184 | * let canDropTheNode = chart.canUpdateLink(draggedNodeId, droppedNodeId)); 185 | * ``` 186 | * @param id child id 187 | * @param pid parent id 188 | */ 189 | canUpdateLink(id: string | number, pid: string | number): boolean; 190 | 191 | 192 | /** 193 | * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. * 194 | * ```typescript 195 | * let chart = new OrgChart('#tree', {}); 196 | * chart.on('init', function () { 197 | * // console.log("initiated") 198 | * }) 199 | * chart.load(nodes); 200 | * ``` 201 | * @category Event Listeners 202 | * @param type A case-sensitive string representing the event type to listen for. 203 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function. 204 | */ 205 | on(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener: (sender: OrgChart, args?: any, args1?: any, args2?: any) => void | boolean): OrgChart; 206 | 207 | /** 208 | * Removes an event listener previously registered. The event listener to be removed is identified using a combination of the event type and the event listener function itself. Returns true if success and false if fail. 209 | * ```typescript 210 | * let chart = new OrgChart('#tree', {}); 211 | * let listener = function(sender, args){ 212 | * console.log(sender.removeListener('update', listener)); 213 | * }; 214 | * chart.on('update', listener); 215 | * chart.load(nodes) 216 | * ``` 217 | }; 218 | 219 | family.on('update', listener); 220 | * @param type A string which specifies the type of event for which to remove an event listener 221 | * @param listener The event listener function of the event handler to remove from the event target 222 | */ 223 | removeListener(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener?: () => void): boolean; 224 | 225 | 226 | /** 227 | * Occurs when the node data has been updated by updateNode method. 228 | * ```typescript 229 | * var chart = new OrgChart('#tree', {}); 230 | * chart.onUpdateNode((args) => { 231 | * //return false; to cancel the operation 232 | * }); 233 | * ``` 234 | * @category Event Listeners 235 | * @param listener 236 | */ 237 | onUpdateNode(listener: (args: { 238 | /** 239 | * old node data 240 | */ 241 | oldData: nodeData, 242 | /** 243 | * new node data 244 | */ 245 | newData: nodeData 246 | }) => void): OrgChart; 247 | 248 | /** 249 | * Occurs when new nodes are added, removed, updated or imported, also when slink or clink is added or removed and after undo or redo operations. 250 | * Use this event listener to synch your server side database with this.config.nodes, this.config.clinks, this.config.slinks etc. 251 | * ```typescript 252 | * var chart = new OrgChart('#tree', {}); 253 | * chart.onUpdated(() => { 254 | * //Update your server database with this.config.nodes, this.config.clinks, this.config.slinks etc. 255 | * }); 256 | * ``` 257 | * @category Event Listeners 258 | */ 259 | onUpdated(): OrgChart; 260 | 261 | 262 | /** 263 | * Occurs when a node has been removed by removeNode method. 264 | * ```typescript 265 | * var chart = new OrgChart('#tree', {}); 266 | * chart.onRemoveNode((args) => { 267 | * //return false; to cancel the operation 268 | * }); 269 | * ``` 270 | * @category Event Listeners 271 | * @param listener 272 | */ 273 | onRemoveNode(listener: (args: { 274 | /** 275 | * node id 276 | */ 277 | id: number | string, 278 | /** 279 | * 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. 280 | */ 281 | newPidsAndStpidsForIds: { 282 | newPidsForIds: { [key in any]: string | number }, 283 | newStpidsForIds: { [key in any]: string | number } 284 | } 285 | }) => void): OrgChart; 286 | 287 | /** 288 | * Occurs when a node has been added by addNode method. 289 | * ```typescript 290 | * var chart = new OrgChart('#tree', {}); 291 | * chart.onAddNode((args) => { 292 | * //return false; to cancel the operation 293 | * }); 294 | * ``` 295 | * @category Event Listeners 296 | * @param listener 297 | */ 298 | onAddNode(listener: (args: { 299 | /** 300 | * new added data node 301 | */ 302 | data: nodeData 303 | }) => void): OrgChart; 304 | /** 305 | * The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on. 306 | * ```typescript 307 | * var chart = new OrgChart('#tree', {}); 308 | * chart.onDrag(() => { 309 | * //return false; to cancel the operation 310 | * }); 311 | * ``` 312 | * @category Event Listeners 313 | * @param listener 314 | */ 315 | onDrag(listener: (args: { 316 | /** 317 | * dragged node id 318 | */ 319 | dragId: string | number, 320 | event: MouseEvent, 321 | /** 322 | * array of node ids 323 | * 324 | * this property is initialized only if movable option is set 325 | */ 326 | nodeIds: Array 327 | }) => void): OrgChart; 328 | /** 329 | * The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on. 330 | * ```typescript 331 | * var chart = new OrgChart('#tree', {}); 332 | * chart.onDrop(() => { 333 | * //return false; to cancel the operation 334 | * }); 335 | * ``` 336 | * @category Event Listeners 337 | * @param listener 338 | */ 339 | onDrop(listener: (args: { 340 | /** 341 | * dragged node id 342 | */ 343 | dragId: string | number, 344 | /** 345 | * dropped node id 346 | */ 347 | dropId: string | number, 348 | /** 349 | * draging element 350 | */ 351 | dragNodeElement: HTMLElement, 352 | /** 353 | * Mouse event 354 | */ 355 | event: MouseEvent 356 | }) => void): OrgChart; 357 | 358 | /** 359 | * All chart nodes 360 | * ```typescript 361 | * let chart = new OrgChart('#tree', {}); 362 | * chart.onInit(() => { 363 | * let nodes = chart.nodes; 364 | * }); 365 | * chart.load(nodes) 366 | * ``` 367 | */ 368 | nodes: { [key in any]: OrgChart.node }; 369 | 370 | /** 371 | * Returns true if chart is visible 372 | * ```typescript 373 | * let chart = new OrgChart('#tree', {}); 374 | * chart.onInit(() => { 375 | * console.log(chart.isVisible); 376 | * }); 377 | * chart.load(nodes) 378 | * ``` 379 | */ 380 | isVisible: boolean; 381 | 382 | /** 383 | * Returns the visible nodes ids 384 | * ```typescript 385 | * let chart = new OrgChart('#tree', {}); 386 | * chart.onInit(() => { 387 | * console.log(chart.visibleNodeIds); 388 | * }); 389 | * chart.load(nodes) 390 | * ``` 391 | */ 392 | visibleNodeIds: Array; 393 | 394 | /** 395 | * Updates the node data 396 | * ```typescript 397 | * let chart = new OrgChart('#tree', {}); 398 | * ... 399 | * chart.update({ id: 1, name: "Updated Name", title: "Updated Title" }); 400 | * chart.draw(); 401 | * ``` 402 | * @param newData node data 403 | */ 404 | update(newData: object): OrgChart; 405 | 406 | /** 407 | * Removes specified node from nodes collection 408 | * ```typescript 409 | * let chart = new OrgChart('#tree', {}); 410 | * ... 411 | * chart.remove(2); 412 | * chart.draw(); 413 | * ``` 414 | 415 | * @param id identification number of the node 416 | */ 417 | remove(id: string | number): OrgChart; 418 | /** 419 | * Adds new node to the nodes collection 420 | * ```typescript 421 | * let chart = new OrgChart('#tree', {}); 422 | * ... 423 | * chart.add({ id: 2, pid: 1, name: "Ashley Barnett", title: "Sales Manager" }) 424 | * chart.draw(); 425 | * ``` 426 | 427 | * @param data node data 428 | */ 429 | add(data: object): OrgChart; 430 | 431 | /** 432 | * Adds new node to the nodes collection, redraws the chart and fires remove event 433 | * ```typescript 434 | * let chart = new OrgChart('#tree', {}); 435 | * ... 436 | * chart.addNode({ id: 1, name: "Denny Curtis", title: "CEO" }); 437 | * ``` 438 | * @param data node data 439 | * @param callback called at the end of animation 440 | * @param fireEvent indicates if the add event will be called or not 441 | */ 442 | addNode(data: nodeData, callback?: () => void, fireEvent?: boolean): void; 443 | 444 | /** 445 | * Removes specified node from nodes collection, redraws the chart and fires remove event. 446 | * ```typescript 447 | * var chart = new OrgChart('#tree', {}); 448 | * chart.removeNode(2); 449 | * ``` 450 | * @param id identification number of the node 451 | * @param callback called at the end of animation 452 | * @param fireEvent indicates if the remove event will be called or not 453 | */ 454 | removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void; 455 | 456 | 457 | /** 458 | * Gets node data. 459 | * ```typescript 460 | * let chart = new OrgChart('#tree', {}); 461 | * ... 462 | * let node = chart.get(2); 463 | * ``` 464 | * @param id identification number of the node 465 | */ 466 | get(id: string | number): nodeData; 467 | /** 468 | * If specified node has assistant/s or partner/s as children will return false. 469 | * ```typescript 470 | * let chart = new OrgChart('#tree', {}); 471 | * ... 472 | * let canRemove = chart.canRemove(2); 473 | * ``` 474 | * @param id identification number of the node 475 | */ 476 | canRemove(id: string | number): boolean; 477 | /** 478 | * Expands specified nodes. 479 | * ```typescript 480 | * let chart = new OrgChart('#tree', {}); 481 | * ... 482 | * chart.expand(1, [2]); 483 | * ``` 484 | * @param id the id of the node that will not move during the animation 485 | * @param ids node ids that will be expanded 486 | * @param callback called after the animation completes 487 | */ 488 | expand(id: string | number, ids: Array | "all", callback?: () => void): void; 489 | /** 490 | * Collapses specified nodes. 491 | * ```typescript 492 | * let chart = new OrgChart('#tree', {}); 493 | * ... 494 | * chart.collapse(1, [2]); 495 | * ``` 496 | * @param id the id of the node that will not move 497 | * @param ids node ids that will be collapsed 498 | * @param callback called after the animation completes 499 | */ 500 | collapse(id: string | number, ids: Array, callback?: () => void): void; 501 | /** 502 | * Expand/Collapse lists of nodes. 503 | * ```typescript 504 | * let chart = new OrgChart('#tree', {}); 505 | * ... 506 | * chart.expandCollapse(1, [2], [3]); 507 | * ``` 508 | * @param id the id of the node that will not move 509 | * @param expandIds expand all nodes with ids 510 | * @param collapseIds collpase all nodes with ids 511 | * @param callback called after the animation completes 512 | */ 513 | expandCollapse(id: string | number, expandIds: Array, collapseIds: Array, callback?: () => void): void; 514 | /** 515 | * Changes roots order. 516 | * ```typescript 517 | * let chart = new OrgChart('#tree', {}); 518 | * ... 519 | * chart.changeRoots(1, [2]); 520 | * ``` 521 | * @param id id of a node that will not change is position, can be null 522 | * @param roots roots id array in the required order 523 | * @param callback called after the roots are changed and animation completes 524 | */ 525 | changeRoots(id: string | number, roots: Array, callback?: () => void): void; 526 | /** 527 | * Maximize the node. Without parameters maximize all nodes. 528 | * ```typescript 529 | * let chart = new OrgChart('#tree', {}); 530 | * ... 531 | * chart.maximize(); 532 | * ``` 533 | * @param id the id of the node, if id is null, undefined ot empty string will maximize all nodes 534 | * @param horizontalCenter center horizontally 535 | * @param verticalCenter center vertically 536 | * @param callback called when the animation completes 537 | */ 538 | maximize(id?: string | number, horizontalCenter?: boolean, verticalCenter?: boolean, callback?: () => void): void; 539 | /** 540 | * ```typescript 541 | * let chart = new OrgChart('#tree', {}); 542 | * ... 543 | * chart.minimize(); 544 | * ``` 545 | * Minimize the node. Without parameters minimize all nodes. 546 | * @param id the id of the node, if id is null, undefined ot empty string will minimize all nodes 547 | * @param callback called when the animation completes 548 | */ 549 | minimize(id?: string | number, callback?: () => void): void; 550 | /** 551 | * Load nodes data. 552 | * ```typescript 553 | * let chart = new OrgChart('#tree', {}); 554 | * ... 555 | * chart.load([ 556 | * { id: 1, name: "Denny Curtis" }, 557 | * { id: 2, pid: 1, name: "Ashley Barnett" }, 558 | * { id: 3, pid: 1, name: "Caden Ellison" } 559 | * ]); 560 | * ``` 561 | * @param data nodes data array 562 | * @param callback function called after the load 563 | */ 564 | load(data: Array, callback?: () => void): OrgChart; 565 | 566 | 567 | 568 | /** 569 | * Updates the node data, redraws the chart and fires update event. 570 | * ```typescript 571 | * let chart = new OrgChart('#tree', {}); 572 | * ... 573 | * chart.updateNode({ id: 4, pid: 2, name: "Updated Name", title: "Updated Title" }); 574 | * ``` 575 | * @param data node data 576 | * @param callback function called when the animation completes 577 | * @param fireEvent if it set to true the update event is called 578 | */ 579 | updateNode(data: nodeData, callback?: () => void, fireEvent?: boolean): void; 580 | 581 | /** 582 | * Loads nodes from xml. 583 | * ```typescript 584 | * let chart = new OrgChart('#tree', {}); 585 | * let xml = ''; 586 | * chart.loadXML(xml); 587 | * ``` 588 | * @param xml Xml with node structure 589 | * @param callback function called after the load 590 | */ 591 | loadXML(xml: string, callback?: () => void): OrgChart; 592 | /** 593 | * Gets nodes as xml. 594 | * ```typescript 595 | * let chart = new OrgChart('#tree', {}); 596 | * let xml = chart.getXML(); 597 | * ``` 598 | */ 599 | getXML(): string; 600 | /** 601 | * Draws the chart. 602 | * ```typescript 603 | * let chart = new OrgChart('#tree', {}); 604 | * ... 605 | * chart.update({ id: 1, name: "Updated Name", title: "Updated Title" }); 606 | * chart.draw(); 607 | * ``` 608 | * @param action Action for example OrgChart.action.centerNode, default is OrgChart.action.update 609 | * @param actionParams parameters for the action 610 | * @param callback called when the animation completes 611 | */ 612 | draw(action?: OrgChart.action, actionParams?: any, callback?: () => void): void; 613 | /** 614 | * Gets the width of the container. 615 | * ```typescript 616 | * let chart = new OrgChart('#tree', {}); 617 | * ... 618 | * let width = chart.width(); 619 | * ``` 620 | */ 621 | width(): number; 622 | /** 623 | * ```typescript 624 | * let chart = new OrgChart('#tree', {}); 625 | * ... 626 | * let height = chart.height(); 627 | * ``` 628 | * Gets the height of the container. 629 | */ 630 | height(): number; 631 | /** 632 | * Gets the view box attribute of the svg html element. 633 | * ```typescript 634 | * let chart = new OrgChart('#tree', {}); 635 | * ... 636 | * let viewBox = chart.getViewBox(); 637 | * ``` 638 | */ 639 | getViewBox(): Array; 640 | /** 641 | * Sets the view box attribute of the svg html element. 642 | * ```typescript 643 | * let chart = new OrgChart('#tree', {}); 644 | * ... 645 | * chart.setViewBox(); 646 | * ``` 647 | * @param viewBox 648 | */ 649 | setViewBox(viewBox: Array): void; 650 | /** 651 | * Gets the current scale of the chart. 652 | * ```typescript 653 | * let chart = new OrgChart('#tree', {}); 654 | * ... 655 | * let scale = chart.getScale(); 656 | * ``` 657 | * @param viewBox 658 | */ 659 | getScale(viewBox?: Array): number; 660 | 661 | /** 662 | * Sets the current scale of the chart. 663 | * Returns the actual scale limited by scaleMax and scaleMin 664 | * ```typescript 665 | * let chart = new OrgChart('#tree', {}); 666 | * ... 667 | * chart.setScale(1.2); 668 | * ``` 669 | * @param newScale new scale value 670 | */ 671 | setScale(newScale: number): number; 672 | /** 673 | * Animates specified node with ripple animation - highlight the node. 674 | * ```typescript 675 | * let chart = new OrgChart('#tree', {}); 676 | * ... 677 | * chart.ripple(2); 678 | * ``` 679 | * @param id the id of the node 680 | * @param clientX x value of the ripple center in the node 681 | * @param clientY y value of the ripple center in the node 682 | */ 683 | ripple(id: string | number, clientX?: number, clientY?: number): void; 684 | /** 685 | * Centers specified node on the screen. 686 | * ```typescript 687 | * let chart = new OrgChart('#tree', {}); 688 | * ... 689 | * chart.center(2); 690 | * ``` 691 | * @param nodeId the id of the node 692 | * @param options parentState: OrgChart.COLLAPSE_PARENT_NEIGHBORS, childrenState: OrgChart.COLLAPSE_SUB_CHILDRENS, rippleId: rippleId, vertical: false, horizontal: false 693 | * @param callback called when the animation completes 694 | */ 695 | center(nodeId: string | number, options?: { 696 | parentState: any, 697 | childrenState: any, 698 | rippleId: string | number, 699 | vertical: boolean, 700 | horizontal: boolean 701 | } | null, callback?: () => void): void; 702 | 703 | 704 | 705 | /** 706 | * Fits the content to the visible area. 707 | * ```typescript 708 | * let chart = new OrgChart('#tree', {}); 709 | * ... 710 | * chart.fit(); 711 | * ``` 712 | * @param callback called when the animation completes 713 | */ 714 | fit(callback?: () => void): void; 715 | /** 716 | * Toggles full screen mode. 717 | * ```typescript 718 | * let chart = new OrgChart('#tree', {}); 719 | * ... 720 | * chart.toggleFullScreen(); 721 | * ``` 722 | */ 723 | toggleFullScreen(): void; 724 | /** 725 | * Gets the node as {@link OrgChart.node} object. 726 | * ```typescript 727 | * let chart = new OrgChart('#tree', {}); 728 | * ... 729 | * let node = chart.getNode(2); 730 | * ``` 731 | * @param nodeId 732 | */ 733 | getNode(nodeId: string | number): OrgChart.node; 734 | 735 | 736 | /** 737 | * Sets layout. 738 | * ```typescript 739 | * let chart = new OrgChart('#tree', {}); 740 | * ... 741 | * chart.setLayout(OrgChart.tree); 742 | * ``` 743 | * @param layout layout type 744 | * @param lcn lyout config name for the specified sub tree 745 | */ 746 | 747 | setLayout(layout: OrgChart.layout | number, lcn?: string): void; 748 | /** 749 | * Sets orientation. 750 | * ```typescript 751 | * let chart = new OrgChart('#tree', {}); 752 | * ... 753 | * chart.setOrientation(2); 754 | * ``` 755 | * @param orientation orientation type 756 | * @param lcn lyout config name for the specified sub tree 757 | * @param callback called at the end of animation 758 | */ 759 | setOrientation(orientation: OrgChart.orientation, lcn?: string, callback?: () => void): void; 760 | 761 | /** 762 | * ```typescript 763 | * let chart = new OrgChart('#tree', {}); 764 | * ... 765 | * chart.moveNodesToVisibleArea([2, 3]); 766 | * ``` 767 | * Moves specified nodes to the visible area. 768 | * @param ids Array of node ids 769 | * @param callback called at the end of animation 770 | */ 771 | moveNodesToVisibleArea(ids: Array, callback?: () => void): void; 772 | 773 | /** 774 | * Search in the chart. 775 | * ```typescript 776 | * let chart = new OrgChart('#tree', {}); 777 | * ... 778 | * chart.search("Ava"); 779 | * ``` 780 | * @param value search for value 781 | * @param searchInFields search in field names 782 | * @param retrieveFields retrive data for fields 783 | * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...} 784 | */ 785 | search(value: string, searchInFields?: Array, retrieveFields?: Array): Array<{ 786 | id: number | string, 787 | name: string, 788 | __score: number, 789 | __searchField: string, 790 | __searchMarks: string 791 | }>; 792 | /** 793 | * Gets collpased node ids of the specifeid node 794 | * ```typescript 795 | * let chart = new OrgChart('#tree', {}); 796 | * ... 797 | * let ids = chart.getCollapsedIds(2); 798 | * ``` 799 | * @param node 800 | */ 801 | getCollapsedIds(node: OrgChart.node): Array; 802 | /** 803 | * State to url. 804 | * ```typescript 805 | * let chart = new OrgChart('#tree', {}); 806 | * ... 807 | * let url = chart.stateToUrl(); 808 | * ``` 809 | * {@link https://balkan.app/OrgChartJS/Docs/State | See doc...} 810 | */ 811 | stateToUrl(): string; 812 | /** 813 | * Genereates unique identification number that can be used for new nodes 814 | * ```typescript 815 | * let chart = new OrgChart('#tree', {}); 816 | * ... 817 | * let id = chart.generateId(); 818 | * ``` 819 | */ 820 | generateId(): string; 821 | /** 822 | * Destroys the object. 823 | * ```typescript 824 | * let chart = new OrgChart('#tree', {}); 825 | * ... 826 | * chart.destroy(); 827 | * ``` 828 | */ 829 | destroy(): void; 830 | /** 831 | * Replaces the id, pid, stpid, ppid and the ids in clinks, slinks, dottedLines, groupDottedLines. 832 | * After the replacment updates the UI 833 | * ```typescript 834 | * let chart = new OrgChart('#tree', {}); 835 | * ... 836 | * chart.replaceIds[{2:21, 3:31}); 837 | * ``` 838 | * @param old_new_ids dictionary containing old and new ids 839 | * @param callback called when the replacment completes 840 | */ 841 | replaceIds(old_new_ids: { 842 | [key: string]: string | number 843 | }, callback?: () => void): void; 844 | /** 845 | * Adds curved link. 846 | * ```typescript 847 | * let chart = new OrgChart('#tree', {}); 848 | * ... 849 | * chart.addClink(4, 0, 'text') 850 | * chart.draw(); 851 | * ``` 852 | * @param from from node with id 853 | * @param to to node with id 854 | * @param label link label 855 | * @param template link template, for example 'orange' 856 | */ 857 | addClink(from: string | number, to: string | number, label?: string, template?: string): OrgChart; 858 | /** 859 | * Removes curved link. 860 | * ```typescript 861 | * let chart = new OrgChart('#tree', {}); 862 | * ... 863 | * chart.removeClink(4, 0) 864 | * chart.draw(); 865 | * ``` 866 | * @param from from node with id 867 | * @param to to node with id 868 | */ 869 | removeClink(from: string | number, to: string | number): OrgChart; 870 | /** 871 | * Adds second link. 872 | * ```typescript 873 | * let chart = new OrgChart('#tree', {}); 874 | * ... 875 | * chart.addSlink(4, 0, 'text') 876 | * chart.draw(); 877 | * ``` 878 | * @param from from node with id 879 | * @param to to node with id 880 | * @param label link label 881 | * @param template link template, for example 'orange' 882 | */ 883 | addSlink(from: string | number, to: string | number, label?: string, template?: string): OrgChart; 884 | /** 885 | * Removes second link. 886 | * ```typescript 887 | * let chart = new OrgChart('#tree', {}); 888 | * ... 889 | * chart.removeSlink(4, 0) 890 | * chart.draw(); 891 | * ``` 892 | * @param from from node with id 893 | * @param to to node with id 894 | */ 895 | removeSlink(from: string | number, to: string | number): OrgChart; 896 | /** 897 | * Gets svg html element 898 | * ```typescript 899 | * let chart = new OrgChart('#tree', {}); 900 | * ... 901 | * let svg = chart.getSvg(); 902 | * ``` 903 | */ 904 | getSvg(): SVGAElement; 905 | /** 906 | * Gets node html element 907 | * ```typescript 908 | * let chart = new OrgChart('#tree', {}); 909 | * ... 910 | * let nodeElement = chart.getNodeElement(2); 911 | * ``` 912 | * @param id node id 913 | */ 914 | getNodeElement(id: string | number): HTMLElement; 915 | /** 916 | * Gets menu button html element 917 | * ```typescript 918 | * let chart = new OrgChart('#tree', {}); 919 | * ... 920 | * let menuButton = chart.getMenuButton(2); 921 | * ``` 922 | */ 923 | getMenuButton(): HTMLElement; 924 | /** 925 | * Exports the details form to PDF. 926 | * ```typescript 927 | * let chart = new OrgChart('#tree', {}); 928 | * ... 929 | * chart.exportPDFProfile({nodeId: 2}); 930 | * ``` 931 | * @param options export options 932 | * @param callback called when the export completes 933 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 934 | */ 935 | exportPDFProfile(options: OrgChart.exportOptions, callback?: () => void): void; 936 | /** 937 | * Exports the details form to PDF. 938 | * ```typescript 939 | * let chart = new OrgChart('#tree', {}); 940 | * ... 941 | * chart.exportPNGProfile({nodeId: 2}); 942 | * ``` 943 | * @param options export options 944 | * @param callback called when the export completes 945 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 946 | */ 947 | exportPNGProfile(options: OrgChart.exportOptions, callback?: () => void): void; 948 | /** 949 | * Exports to CSV 950 | * ```typescript 951 | * let chart = new OrgChart('#tree', {}); 952 | * ... 953 | * chart.exportCSV(); 954 | * ``` 955 | * @param filename The name of the exported file 956 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 957 | */ 958 | exportCSV(filename?: string | OrgChart.exportCSVXMLJSONOptions): void; 959 | /** 960 | * Exports to XML 961 | * ```typescript 962 | * let chart = new OrgChart('#tree', {}); 963 | * ... 964 | * chart.exportXML(); 965 | * ``` 966 | * @param filename The name of the exported file 967 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 968 | */ 969 | exportXML(filename: string | OrgChart.exportCSVXMLJSONOptions): void; 970 | /** 971 | * Exports to JSON 972 | * ```typescript 973 | * let chart = new OrgChart('#tree', {}); 974 | * ... 975 | * chart.exportJSON(); 976 | * ``` 977 | * @param filename The name of the exported file 978 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 979 | */ 980 | exportJSON(filename?: string | OrgChart.exportCSVXMLJSONOptions ): void; 981 | 982 | /** 983 | * ```typescript 984 | * let chart = new OrgChart('#tree', {}); 985 | * ... 986 | * chart.shareProfile(2); 987 | * ``` 988 | * Shares node data, uses build-in device sharing functionallity. 989 | * @param id node id 990 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 991 | */ 992 | shareProfile(id: string | number): void; 993 | /** 994 | * Exports to PDF document 995 | * ```typescript 996 | * let chart = new OrgChart('#tree', {}); 997 | * ... 998 | * chart.exportPDF(); 999 | * ``` 1000 | * @param options export options 1001 | * @param callback called when the export completes 1002 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 1003 | */ 1004 | exportPDF(options?: OrgChart.exportOptions, callback?: () => void): void; 1005 | /** 1006 | * Exports to PNG document 1007 | * ```typescript 1008 | * let chart = new OrgChart('#tree', {}); 1009 | * ... 1010 | * chart.exportPNG(); 1011 | * ``` 1012 | * @param options export options 1013 | * @param callback called when the export completes 1014 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 1015 | */ 1016 | exportPNG(options?: OrgChart.exportOptions, callback?: () => void): void; 1017 | /** 1018 | * Exports to SVG document 1019 | * ```typescript 1020 | * let chart = new OrgChart('#tree', {}); 1021 | * ... 1022 | * chart.exportSVG(); 1023 | * ``` 1024 | * @param options export options 1025 | * @param callback called when the export completes 1026 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 1027 | */ 1028 | exportSVG(options?: OrgChart.exportOptions, callback?: () => void): void; 1029 | /** 1030 | * Exports to Visio document 1031 | * ```typescript 1032 | * let chart = new OrgChart('#tree', {}); 1033 | * ... 1034 | * chart.exportVisio(); 1035 | * ``` 1036 | * @param options export options 1037 | * @param callback called when the export completes 1038 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 1039 | */ 1040 | exportVisio(options?: OrgChart.exportOptions, callback?: () => void): void; 1041 | exportToPowerPoint(options?: OrgChart.exportPowerPontOptions, callback?: () => void): void; 1042 | exportToPDF(options?: OrgChart.exportPDFOptions, callback?: () => void): void; 1043 | exportToPNG(options?: OrgChart.exportPNGOptions, callback?: () => void): void; 1044 | 1045 | /** 1046 | * Imports CSV file. 1047 | * ```typescript 1048 | * let chart = new OrgChart('#tree', {}); 1049 | * ... 1050 | * chart.importCSV(); 1051 | * ``` 1052 | * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...} 1053 | */ 1054 | importCSV(): void; 1055 | /** 1056 | * Imports XML file. 1057 | * ```typescript 1058 | * let chart = new OrgChart('#tree', {}); 1059 | * ... 1060 | * chart.importXML(); 1061 | * ``` 1062 | * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...} 1063 | */ 1064 | importXML(): void; 1065 | 1066 | /** 1067 | * Imports JSON file. 1068 | * ```typescript 1069 | * let chart = new OrgChart('#tree', {}); 1070 | * ... 1071 | * chart.importJSON(); 1072 | * ``` 1073 | * {@link https://balkan.app/OrgChartJS/Docs/Importing | See doc...} 1074 | */ 1075 | importJSON(): void; 1076 | 1077 | /** 1078 | * Zoom out or zoom in the chart. 1079 | * ```typescript 1080 | * let chart = new OrgChart('#tree', {}); 1081 | * ... 1082 | * chart.zoom(true); 1083 | * ``` 1084 | * @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. 1085 | * @param center array [x, y], where x is x percantege from the width and y is y percentage from the height. 1086 | * @param shouldAnimate should animate 1087 | * @param callback called when the animation completes 1088 | */ 1089 | zoom(delta: boolean | number, center?: Array, shouldAnimate?: boolean, callback?: () => void): void; 1090 | 1091 | /** 1092 | * Magnify(Zoom in) specific node in the chart. 1093 | * ```typescript 1094 | * let chart = new OrgChart('#tree', {}); 1095 | * ... 1096 | * chart.magnify(2, 1.25); 1097 | * ``` 1098 | * @param id id of the node 1099 | * @param scale scale to magnify 1100 | * @param front show on front or back 1101 | * @param anim animation type 1102 | */ 1103 | magnify(id: string | number, scale: number, front?: boolean, anim?: OrgChart.anim | null, callback?: () => void): void; 1104 | 1105 | /** 1106 | * Starts the move 1107 | * ```typescript 1108 | * let chart = new OrgChart('#tree', {}); 1109 | * ... 1110 | * chart.moveStart({right: true}); 1111 | * ``` 1112 | * @param movePosition move position 1113 | * @param tick callback function in each step 1114 | * @param func the name of the animation function, for example OrgChart.anim.inSin 1115 | * @param duration duration before going to 100 percent speed 1116 | */ 1117 | moveStart(movePosition: OrgChart.move, tick?: () => void, func?: OrgChart.anim, duration?: number): void; 1118 | 1119 | /** 1120 | * Ends the move 1121 | * ```typescript 1122 | * let chart = new OrgChart('#tree', {}); 1123 | * ... 1124 | * chart.moveEnd(); 1125 | */ 1126 | moveEnd(): void; 1127 | 1128 | /** 1129 | * Undo data operations like adding/removing nodes. Set undoRedoStorageName option before calling this method. 1130 | * ```typescript 1131 | * let chart = new OrgChart('#tree', {}); 1132 | * ... 1133 | * chart.undo(); 1134 | * ``` 1135 | * @param callback called when the animation completes 1136 | */ 1137 | undo(callback?: () => void): void; 1138 | /** 1139 | * Redo data operations like adding/removing nodes. Set undoRedoStorageName option before calling this method. 1140 | * ```typescript 1141 | * let chart = new OrgChart('#tree', {}); 1142 | * ... 1143 | * chart.redo(); 1144 | * ``` 1145 | * @param callback called when the animation completes 1146 | */ 1147 | redo(callback?: () => void): void; 1148 | 1149 | /** 1150 | * Clears all Redo stack steps. 1151 | * ```typescript 1152 | * let chart = new OrgChart('#tree', {}); 1153 | * ... 1154 | * chart.clearRedo(); 1155 | * ``` 1156 | */ 1157 | clearRedo(): void; 1158 | 1159 | /** 1160 | * Clears all Undo stack steps. 1161 | * ```typescript 1162 | * let chart = new OrgChart('#tree', {}); 1163 | * ... 1164 | * chart.clearUndo(); 1165 | * ``` 1166 | */ 1167 | clearUndo(): void; 1168 | /** 1169 | * Returns the number of Undo stack steps 1170 | * ```typescript 1171 | * let chart = new OrgChart('#tree', {}); 1172 | * ... 1173 | * let undoSteps = chart.undoStepsCount(); 1174 | * ``` 1175 | */ 1176 | undoStepsCount(): number; 1177 | /** 1178 | * Returns the number of Redo stack steps 1179 | * ```typescript 1180 | * let chart = new OrgChart('#tree', {}); 1181 | * ... 1182 | * let redoSteps = chart.redoStepsCount(); 1183 | * ``` 1184 | */ 1185 | redoStepsCount(): number; 1186 | 1187 | 1188 | /** 1189 | * The onField() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. 1190 | * ```typescript 1191 | * let chart = new OrgChart('#tree', {}); 1192 | * chart.onField((args) => { 1193 | * //return false; to cancel 1194 | * }); 1195 | * chart.load(nodes); 1196 | * ``` 1197 | * @category Event Listeners 1198 | * @param listener 1199 | */ 1200 | onField(listener: (this: OrgChart, args: { 1201 | /** 1202 | * the node 1203 | */ 1204 | node: OrgChart.node, 1205 | /** 1206 | * node data json object 1207 | */ 1208 | data: object, 1209 | /** 1210 | * value of the filed, can be changed in the event 1211 | */ 1212 | value: any, 1213 | /** 1214 | * svg or html element of the filed, can be changed in the event 1215 | */ 1216 | element: string, 1217 | /** 1218 | * name of the field 1219 | */ 1220 | name: string 1221 | /** 1222 | * field template name 1223 | */ 1224 | field: string 1225 | }) => void | boolean): OrgChart; 1226 | 1227 | /** 1228 | * Occurs when the nodes in OrgChart has been created and loaded to the DOM. 1229 | * ```typescript 1230 | * let chart = new OrgChart('#tree', {}); 1231 | * chart.onInit(() => { 1232 | * }); 1233 | * chart.load(nodes); 1234 | * ``` 1235 | * @category Event Listeners 1236 | * @param listener 1237 | */ 1238 | onInit(listener: (this: OrgChart) => void): OrgChart; 1239 | 1240 | /** 1241 | * The onRedraw event occurs when the chart is redrawed. 1242 | * ```typescript 1243 | * let chart = new OrgChart('#tree', {}); 1244 | * chart.onRedraw(() => { 1245 | * }); 1246 | * chart.load(nodes); 1247 | * ``` 1248 | * @category Event Listeners 1249 | * @param listener 1250 | */ 1251 | onRedraw(listener: (this: OrgChart) => void): OrgChart; 1252 | 1253 | /** 1254 | * The onExpandCollpaseButtonClick event occurs when the chart is redrawed. 1255 | * ```typescript 1256 | * let chart = new OrgChart('#tree', {}); 1257 | * chart.onExpandCollpaseButtonClick(() => { 1258 | * //return false; to cancel the operation 1259 | * }); 1260 | * chart.load(nodes); 1261 | * ``` 1262 | * @category Event Listeners 1263 | * @param listener 1264 | */ 1265 | onExpandCollpaseButtonClick(listener: (this: OrgChart, args: { 1266 | /** 1267 | * Indicates id the operation is collaps or expand 1268 | */ 1269 | collapsing: boolean, 1270 | /** 1271 | * the id of the clicked node 1272 | */ 1273 | id: number | string, 1274 | /** 1275 | * node ids that will be expanded or collapsed 1276 | */ 1277 | ids: Array 1278 | }) => void): OrgChart; 1279 | 1280 | /** 1281 | * 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. 1282 | * ```typescript 1283 | * let chart = new OrgChart('#tree', {}); 1284 | * chart.onExportStart(() => { 1285 | * args.styles += ''; 1286 | * //return false; to cancel the operation 1287 | * }); 1288 | * chart.load(nodes); 1289 | * ``` 1290 | * @category Event Listeners 1291 | * @param listener 1292 | */ 1293 | onExportStart(listener: (this: OrgChart, args: 1294 | { 1295 | /** 1296 | * the content to be exported 1297 | * 1298 | * this property is initialized only for PDF/PNG/SVG exports 1299 | */ 1300 | content: string, 1301 | /** 1302 | * export options 1303 | * 1304 | * this property is initialized only for PDF/PNG/SVG exports 1305 | */ 1306 | options: OrgChart.exportOptions, 1307 | /** 1308 | * add extra styles 1309 | * 1310 | * this property is initialized only for PDF/PNG/SVG exports 1311 | */ 1312 | styles: string, 1313 | /** 1314 | * an object that discribes pages to be exported 1315 | * 1316 | * this property is initialized only for PDF/PNG exports 1317 | */ 1318 | pages: any, 1319 | /** 1320 | * extension 1321 | * 1322 | * this property is initialized only for CSV/XML 1323 | */ 1324 | ext: string, 1325 | /** 1326 | * filename, you can change the filename here 1327 | * 1328 | * this property is initialized only for CSV/XML exports 1329 | */ 1330 | filename: string, 1331 | /** 1332 | * array of node objects 1333 | * 1334 | * this property is initialized only for CSV/XML exports 1335 | */ 1336 | nodes: Array 1337 | }) => void): OrgChart; 1338 | 1339 | /** 1340 | * 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. 1341 | * ```typescript 1342 | * let chart = new OrgChart('#tree', {}); 1343 | * chart.onExportEnd(() => { 1344 | * //return false; to cancel the operation for example id you prefer the exported document to not download 1345 | * }); 1346 | * chart.load(nodes); 1347 | * ``` 1348 | * @category Event Listeners 1349 | * @param listener 1350 | */ 1351 | onExportEnd(listener: (this: OrgChart, args: 1352 | /** 1353 | * for PDF/PNG 1354 | */ 1355 | { 1356 | /** 1357 | * the array buffer is the exported document, you can save it on a server or send it via email 1358 | * 1359 | * this property is initialized only for PDF/PNG exports 1360 | */ 1361 | ArrayBuffer: ArrayBuffer 1362 | /** 1363 | * extension 1364 | * 1365 | * this property is initialized only for CSV/XML exports 1366 | */ 1367 | ext: string, 1368 | /** 1369 | * filename, you can change the filename here 1370 | * 1371 | * this property is initialized only for CSV/XML exports 1372 | */ 1373 | filename: string, 1374 | /** 1375 | * an array of node objects 1376 | * 1377 | * this property is initialized only for CSV/XML exports 1378 | */ 1379 | nodes: Array, 1380 | /** 1381 | * csv ot xml string 1382 | * 1383 | * this property is initialized only for CSV/XML/SVG exports 1384 | */ 1385 | content: string 1386 | /** 1387 | * export options 1388 | * 1389 | * this property is initialized only for SVG exports 1390 | */ 1391 | options: OrgChart.exportOptions, 1392 | /** 1393 | * add extra styles 1394 | * 1395 | * this property is initialized only for SVG exports 1396 | */ 1397 | styles: string, 1398 | }) => void): OrgChart; 1399 | 1400 | /** 1401 | * On node click event listener. 1402 | * ```typescript 1403 | * let chart = new OrgChart('#tree', {}); 1404 | * chart.onNodeClick(() => { 1405 | * //return false; to cancel the operation 1406 | * }); 1407 | * chart.load(nodes); 1408 | * ``` 1409 | * @category Event Listeners 1410 | * @param listener 1411 | */ 1412 | onNodeClick(listener: (this: OrgChart, args: { 1413 | /** 1414 | * node JSON object 1415 | */ 1416 | node: OrgChart.node, 1417 | /** 1418 | * the browser event 1419 | */ 1420 | event: any 1421 | }) => void): OrgChart; 1422 | 1423 | 1424 | /** 1425 | * On canvas SVG click event listener. 1426 | * ```typescript 1427 | * let chart = new OrgChart('#tree', {}); 1428 | * chart.onCanvasClick(() => { 1429 | * }); 1430 | * chart.load(nodes); 1431 | * ``` 1432 | * @category Event Listeners 1433 | * @param listener 1434 | */ 1435 | onCanvasClick(listener: (this: OrgChart, args: { 1436 | /** 1437 | * the browser event 1438 | */ 1439 | event: any 1440 | }) => void): OrgChart; 1441 | 1442 | /** 1443 | * In onAIToolCalls we parse the AI responce to our functions 1444 | * ```typescript 1445 | * chart.onAIToolCalls(function(args){ 1446 | * for(var toolCall of args.toolCalls){ 1447 | * if (toolCall.FunctionName == 'sendEmail'){ 1448 | * toolCall.FunctionResult = sendEmail(toolCall.FunctionArguments); 1449 | * } 1450 | * } 1451 | * }); 1452 | * ``` 1453 | * [Go to AI doc page for more details](https://balkan.app/OrgChartJS/Docs/AI) 1454 | * @param listener 1455 | */ 1456 | onAIToolCalls(listener: (this: OrgChart, args: { 1457 | toolCalls: Array<{ 1458 | FunctionName : string, 1459 | FunctionResult : string, 1460 | FunctionArguments : { [key: string]: any } 1461 | }> 1462 | }) => void): OrgChart; 1463 | 1464 | /** 1465 | * On node double click event listener. 1466 | * ```typescript 1467 | * let chart = new OrgChart('#tree', {}); 1468 | * chart.onNodeDoubleClick(() => { 1469 | * //return false; to cancel the operation 1470 | * }); 1471 | * chart.load(nodes); 1472 | * ``` 1473 | * @category Event Listeners 1474 | * @param listener 1475 | */ 1476 | onNodeDoubleClick(listener: (this: OrgChart, args: { 1477 | /** 1478 | * clicked node data 1479 | */ 1480 | data: object 1481 | }) => void): OrgChart; 1482 | 1483 | /** 1484 | * The tree div element. 1485 | * ```typescript 1486 | * let chart = new OrgChart('#tree', {}); 1487 | * let element = chart.element; 1488 | * ``` 1489 | */ 1490 | element: HTMLElement; 1491 | 1492 | /** 1493 | * The chart editUI object. 1494 | * ```typescript 1495 | * let chart = new OrgChart('#tree', {}); 1496 | * let editUI = chart.editUI; 1497 | * ``` 1498 | */ 1499 | editUI: OrgChart.editUI; 1500 | 1501 | /** 1502 | * The chart aiUI object. 1503 | * ```typescript 1504 | * let chart = new OrgChart('#tree', {}); 1505 | * let aiUI = chart.aiUI; 1506 | * ``` 1507 | */ 1508 | aiUI: OrgChart.aiUI; 1509 | 1510 | /** 1511 | * The chart searchUI object. 1512 | * ```typescript 1513 | * let chart = new OrgChart('#tree', {}); 1514 | * let searchUI = chart.searchUI; 1515 | * ``` 1516 | */ 1517 | searchUI: OrgChart.searchUI; 1518 | 1519 | /** 1520 | * The chart nodeMenuUI object. 1521 | * ```typescript 1522 | * let chart = new OrgChart('#tree', {}); 1523 | * let nodeMenuUI = chart.nodeMenuUI; 1524 | * ``` 1525 | */ 1526 | nodeMenuUI: OrgChart.menuUI; 1527 | 1528 | powerPointPreviewUI: OrgChart.powerPointPreviewUI; 1529 | 1530 | pdfPreviewUI: OrgChart.pdfPreviewUI; 1531 | pngPreviewUI: OrgChart.pngPreviewUI; 1532 | 1533 | /** 1534 | * The chart filterUI object. 1535 | * ```typescript 1536 | * let chart = new OrgChart('#tree', {}); 1537 | * let filterUI = chart.filterUI; 1538 | * ``` 1539 | */ 1540 | filterUI: OrgChart.filterUI; 1541 | 1542 | /** 1543 | * @ignore 1544 | */ 1545 | xScrollUI: OrgChart.xScrollUI; 1546 | 1547 | /** 1548 | * @ignore 1549 | */ 1550 | yScrollUI: OrgChart.yScrollUI; 1551 | 1552 | /** 1553 | * The chart undoRedoUI object. 1554 | * ```typescript 1555 | * let chart = new OrgChart('#tree', {}); 1556 | * let undoRedoUI = chart.undoRedoUI; 1557 | * ``` 1558 | */ 1559 | undoRedoUI: OrgChart.undoRedoUI; 1560 | 1561 | /** 1562 | * The chart nodeCircleMenuUI object. 1563 | * ```typescript 1564 | * let chart = new OrgChart('#tree', {}); 1565 | * let nodeCircleMenuUI = chart.nodeCircleMenuUI; 1566 | * ``` 1567 | */ 1568 | nodeCircleMenuUI: OrgChart.circleMenuUI; 1569 | 1570 | /** 1571 | * The chart nodeContextMenuUI object. 1572 | * ```typescript 1573 | * let chart = new OrgChart('#tree', {}); 1574 | * let nodeContextMenuUI = chart.nodeContextMenuUI; 1575 | * ``` 1576 | */ 1577 | nodeContextMenuUI: OrgChart.menuUI; 1578 | 1579 | /** 1580 | * The chart menuUI object. 1581 | * ```typescript 1582 | * let chart = new OrgChart('#tree', {}); 1583 | * let menuUI = chart.menuUI; 1584 | * ``` 1585 | */ 1586 | menuUI: OrgChart.menuUI; 1587 | 1588 | /** 1589 | * The chart toolbarUI object. 1590 | * ```typescript 1591 | * let chart = new OrgChart('#tree', {}); 1592 | * let toolbarUI = chart.toolbarUI; 1593 | * ``` 1594 | */ 1595 | toolbarUI: OrgChart.toolbarUI; 1596 | 1597 | /** 1598 | * The chart config object. 1599 | * ```typescript 1600 | * let chart = new OrgChart('#tree', {}); 1601 | * let config = chart.config; 1602 | * ``` 1603 | */ 1604 | config: OrgChart.options; 1605 | 1606 | /** 1607 | * All root nodes in the chart 1608 | * ```typescript 1609 | * let chart = new OrgChart('#tree', {}); 1610 | * chart.onInit(() => { 1611 | * let roots = chart.roots 1612 | * }); 1613 | * chart.load(nodes) 1614 | * ``` 1615 | */ 1616 | roots: Array; 1617 | 1618 | /** 1619 | * Opens file upload dialog 1620 | * ```typescript 1621 | * let chart = new OrgChart('#tree', {}); 1622 | * 1623 | * chart.editUI.on('element-btn-click', function (sender, args) { 1624 | * OrgChart.fileUploadDialog(function (file) { 1625 | * var formData = new FormData(); 1626 | * formData.append('file', file); 1627 | * alert('upload the file'); 1628 | * }) 1629 | * }); 1630 | * 1631 | * chart.load(nodes) 1632 | * ``` 1633 | */ 1634 | 1635 | static fileUploadDialog(callback: (file: any) => void): void; 1636 | 1637 | /** 1638 | * Exports multiple charts or a chart by teams. 1639 | * ```typescript 1640 | * let chart1 = new OrgChart('#tree', {}); 1641 | * let chart2 = new OrgChart('#tree', {}); 1642 | * let chart3 = new OrgChart('#tree', {}); 1643 | * let chart4 = new OrgChart('#tree', {}); 1644 | * document.getElementById('btn_export').addEventListener('click', function(){ 1645 | * OrgChart.exportPDFFromCharts([ 1646 | * {chartInstance: chart1, scale: 'fit', format: 'A4', header: 'OrgChart 1' }, 1647 | * {chartInstance: chart2, scale: 'fit', format: 'A4', header: 'OrgChart 2' }, 1648 | * {chartInstance: chart3, scale: 'fit', format: 'A4', header: 'OrgChart 3' }, 1649 | * {chartInstance: chart4, scale: 'fit', format: 'A4', header: 'OrgChart 4' }, 1650 | * ], "test.pdf"); 1651 | * }); 1652 | * ``` 1653 | */ 1654 | static exportPDFFromCharts(optionList: Array<{ 1655 | chartInstance: OrgChart, 1656 | childLevels?: number, 1657 | parentLevels?: number, 1658 | margin?: Array, 1659 | padding?: number, 1660 | landscape?: boolean, 1661 | type?: "preview" | "nodes", 1662 | scale?: "fit" | number, 1663 | format?: "A1" | "A2" | "A3" | "A4" | "A5" | "A4" | "Letter" | "Legal", 1664 | header?: string, 1665 | footer?: string, 1666 | expandChildren?: boolean, 1667 | min?: boolean, 1668 | nodeId? : number | string 1669 | }>, filename?: string, openInNewTab?: boolean, callback?: (arrayBuffer: ArrayBuffer) => void): void; 1670 | 1671 | /** 1672 | * Checks if the screen is mobile 1673 | * ```typescript 1674 | * console.log(OrgChart.isMobile()); 1675 | * ``` 1676 | */ 1677 | static isMobile(): boolean; 1678 | /** 1679 | * Checks if the used library is licnsed or not 1680 | * ```typescript 1681 | * console.log(OrgChart.isTrial()); 1682 | * ``` 1683 | */ 1684 | static isTrial(): boolean; 1685 | /** 1686 | * Count all children nodes of the specified id. 1687 | * ```typescript 1688 | * let chart = new OrgChart('#tree', {}); 1689 | * chart.onInit(() => { 1690 | * console.log(OrgChart.childrenCount(chart, chart.getNode(2))) 1691 | * }); 1692 | * chart.load(nodes) 1693 | * ``` 1694 | * @param chart OrgChart instance 1695 | * @param node 1696 | * @param count 1697 | */ 1698 | static childrenCount(chart: OrgChart, node: OrgChart.node): number; 1699 | 1700 | /** 1701 | * Count the total (to the leafs) children nodes of the specified id. 1702 | * ```typescript 1703 | * let chart = new OrgChart('#tree', {}); 1704 | * chart.onInit(() => { 1705 | * console.log(OrgChart.childrenTotalCount(chart, chart.getNode(2))) 1706 | * }); 1707 | * chart.load(nodes) 1708 | * ``` 1709 | * @param chart OrgChart instance 1710 | * @param node 1711 | * @param count 1712 | */ 1713 | static childrenTotalCount(chart: OrgChart, node: OrgChart.node): number; 1714 | 1715 | /** 1716 | * Count the collapsed children nodes of the specified id. 1717 | * ```typescript 1718 | * let chart = new OrgChart('#tree', {}); 1719 | * chart.onInit(() => { 1720 | * console.log(OrgChart.collapsedChildrenCount(chart, chart.getNode(2))) 1721 | * }); 1722 | * chart.load(nodes) 1723 | * ``` 1724 | * @param chart OrgChart instance 1725 | * @param node 1726 | * @param count 1727 | */ 1728 | static collapsedChildrenCount(chart: OrgChart, node: OrgChart.node): number; 1729 | 1730 | /** 1731 | * Count the total (to the leafs) collapsed children nodes of the specified id. 1732 | * ```typescript 1733 | * let chart = new OrgChart('#tree', {}); 1734 | * chart.onInit(() => { 1735 | * console.log(OrgChart.collapsedChildrenCount(chart, chart.getNode(2))) 1736 | * }); 1737 | * chart.load(nodes) 1738 | * ``` 1739 | * @param chart OrgChart instance 1740 | * @param node 1741 | * @param count 1742 | */ 1743 | static collapsedChildrenTotalCount(chart: OrgChart, node: OrgChart.node): number; 1744 | 1745 | /** 1746 | * Get the root node of the specified id. 1747 | * ```typescript 1748 | * let chart = new OrgChart('#tree', {}); 1749 | * chart.onInit(() => { 1750 | * let root = OrgChart.getRootOf(chart.getNode(4)); 1751 | * }); 1752 | * chart.load(nodes) 1753 | * ``` 1754 | * @param node 1755 | */ 1756 | static getRootOf(node: OrgChart.node): OrgChart.node; 1757 | 1758 | /** 1759 | * is null, empty or undefined 1760 | * ```typescript 1761 | * console.log(OrgChart.isNEU(any_prmeter)) 1762 | * ``` 1763 | * @param val 1764 | */ 1765 | static isNEU(val: any): boolean; 1766 | 1767 | /** 1768 | * Defines gradient circle form array of colors 1769 | * ```typescript 1770 | * OrgChart.templates.myTemplate.defs = OrgChart.gradientCircleForDefs('circle', ['#FF0000', '#FFD800'], 60, 10); 1771 | * ``` 1772 | * @param id - id of the element 1773 | * @param colors - array of colors 1774 | * @param r - radius 1775 | * @param strokeWidth - stroke width 1776 | */ 1777 | static gradientCircleForDefs(id: string | number, colors: Array | string, r: number, strokeWidth: number): string; 1778 | 1779 | /** 1780 | * Convert CSV to nodes 1781 | * ```typescript 1782 | * let chart = new OrgChart('#tree', {}); 1783 | * fetch('https://balkan.app/content/data.csv') 1784 | * .then(response => response.text()) 1785 | * .then(text => { 1786 | * var nodes = OrgChart.convertCsvToNodes(text); 1787 | * chart.load(nodes); 1788 | * }); 1789 | * ``` 1790 | * @param text 1791 | */ 1792 | static convertCsvToNodes(text: string) : Array; 1793 | 1794 | /** 1795 | * @ignore 1796 | */ 1797 | static roundPathCorners(commands: string | Array>, radius: number, useFractionalRadius: boolean) : string; 1798 | 1799 | /** 1800 | * @ignore 1801 | */ 1802 | static convertNodesToCsv(nodes: Array) : string; 1803 | 1804 | /** 1805 | * Replace a text in a field 1806 | * ```typescript 1807 | * let chart = new OrgChart('#tree', {}); 1808 | * chart.onField(function (args) { 1809 | * var val = OrgChart.wrapText(args.value, OrgChart.templates.ana.field_1) 1810 | * args.value = val; 1811 | * }); 1812 | * chart.load(nodes); 1813 | * ``` 1814 | */ 1815 | static wrapText(text: string, field: Object): string; 1816 | 1817 | static filterUI: { 1818 | /** 1819 | * Change the text "Filter by" 1820 | * ```typescript 1821 | * OrgChart.filterUI.textFilterBy = 'Filtre par'; 1822 | * ``` 1823 | */ 1824 | textFilterBy: string, 1825 | /** 1826 | * Chart the text "all" 1827 | * ```typescript 1828 | * OrgChart.filterUI.all = '[Toute]' 1829 | * ``` 1830 | */ 1831 | all: string, 1832 | }; 1833 | 1834 | static aiUI: { 1835 | /** 1836 | * Change the title 1837 | * ```typescript 1838 | * OrgChart.aiUI.title = 'AI for My Company'; 1839 | * ``` 1840 | */ 1841 | title: string 1842 | }; 1843 | 1844 | /** 1845 | * Shows/hides lloading image. Usefull when export large data to pdf. You can override and show your own loading image. 1846 | */ 1847 | static loading: { 1848 | /** 1849 | * ```typescript 1850 | * let chart = new OrgChart('#tree', {}); 1851 | * chart.on('init', function (sender) { 1852 | * OrgChart.loading.show(sender); 1853 | *}); 1854 | * ``` 1855 | * @param chart 1856 | * @returns void 1857 | */ 1858 | show: (chart: OrgChart) => void, 1859 | /** 1860 | * ```typescript 1861 | * let chart = new OrgChart('#tree', {}); 1862 | * fetch('https://balkan.app/content/100k.json') 1863 | * .then((response) => response.json()) 1864 | * .then((data) => chart.load(data, function () { 1865 | * OrgChart.loading.hide(chart); 1866 | * })); 1867 | * ``` 1868 | * @param chart 1869 | * @returns void 1870 | */ 1871 | hide: (chart: OrgChart) => void 1872 | } 1873 | /** 1874 | * ```typescript 1875 | * OrgChart.clinkTemplates.myTemplate = Object.assign({}, OrgChart.clinkTemplates.orange); 1876 | * OrgChart.clinkTemplates.myTemplate.label = 1877 | * '{val}'; 1878 | * ``` 1879 | */ 1880 | static clinkTemplates: { 1881 | [key: string]: OrgChart.linkTemplate 1882 | } 1883 | /** 1884 | * ```typescript 1885 | * OrgChart.slinkTemplates.myTemplate = Object.assign({}, OrgChart.slinkTemplates.orange); 1886 | * OrgChart.slinkTemplates.myTemplate.labelPosition = 'start'; 1887 | * 1888 | * ``` 1889 | */ 1890 | static slinkTemplates: { 1891 | [key: string]: OrgChart.linkTemplate 1892 | } 1893 | 1894 | /** 1895 | * ```typescript 1896 | * OrgChart.templates.mainTemplate = Object.assign({}, OrgChart.templates.ana); 1897 | * OrgChart.templates.mainTemplate.node = 1898 | * ``; 1899 | * ``` 1900 | */ 1901 | static templates: { [key: string]: OrgChart.template} ; 1902 | 1903 | 1904 | /** 1905 | * You can change the smooth and the speed of the scroll 1906 | * or you can change the values for any specific browser 1907 | * ```typescript 1908 | * OrgChart.scroll.smooth = 12; 1909 | * OrgChart.scroll.speed = 120; 1910 | * OrgChart.scroll.safari = { 1911 | * smooth: 12, 1912 | * speed: 500 1913 | * } 1914 | * let chart = new OrgChart(document.getElementById("tree"), { 1915 | * ... 1916 | * showXScroll: true, 1917 | * }); 1918 | * ``` 1919 | */ 1920 | static scroll: { 1921 | smooth?: number, 1922 | speed?: number, 1923 | safari?: { smooth?: number; speed?: number; }, 1924 | edge?: { smooth?: number; speed?: number; }, 1925 | chrome?: { smooth?: number; speed?: number; }, 1926 | firefox?: { smooth?: number; speed?: number; }, 1927 | opera?: { smooth?: number; speed?: number; } 1928 | }; 1929 | 1930 | /** 1931 | * @ignore 1932 | */ 1933 | static events: { 1934 | /** 1935 | * layout event listener is obsolete, use node-layout instead 1936 | * @param type 1937 | * @param listener 1938 | */ 1939 | on(type: "layout", listener: (args: any, args1: any, args2: any) => void): void 1940 | }; 1941 | 1942 | /** 1943 | * @ignore 1944 | */ 1945 | static state: { clear(stateName: string): void }; 1946 | 1947 | /** 1948 | * Animate an element 1949 | * ```typescript 1950 | * editForm.prototype.show = function (nodeId) { 1951 | * OrgChart.animate(div, { opacity: 0, right: -100 }, { opacity: 1, right: 10 }, 300, OrgChart.anim.outSin); 1952 | * }; 1953 | * ``` 1954 | * @param element - element 1955 | * @param attrStart - object with start CSS properties 1956 | * @param attrEnd - object with end CSS properties 1957 | * @param duration - duration in miliseconds 1958 | * @param func - funcition to animate with 1959 | * @param callback - callback function 1960 | */ 1961 | static animate(element: Object, attrStart?: Object, attrEnd?: Object, duration?: number, func?: OrgChart.anim, callback?: Function, tick?: boolean): void; 1962 | 1963 | /** 1964 | * Minimap options. 1965 | * ```typescript 1966 | * OrgChart.miniMap.colors = ["#FFCA28", "#F57C00", "#039be5", "#757575"]; 1967 | * OrgChart.miniMap.selectorBackgroundColor = "#888888"; 1968 | * OrgChart.miniMap.focusStroke = "#039BE5"; 1969 | * OrgChart.miniMap.opacity = 0.8; 1970 | * OrgChart.miniMap.border = '2px solid #039BE5'; 1971 | * OrgChart.miniMap.width = 200; 1972 | * OrgChart.miniMap.height = 100; 1973 | * OrgChart.miniMap.padding = 10; 1974 | * OrgChart.miniMap.position = { 1975 | * top: 'padding', 1976 | * left: 'padding', 1977 | * right: undefined, 1978 | * bottom: undefined 1979 | * }; 1980 | * ``` 1981 | */ 1982 | static miniMap: { 1983 | colors: Array, 1984 | selectorBackgroundColor: string, 1985 | focusStroke: string, 1986 | opacity: number, 1987 | border: string, 1988 | width: number, 1989 | height: number, 1990 | padding: number, 1991 | position: Object 1992 | }; 1993 | 1994 | /** 1995 | * OrgChart version 1996 | * ```typescript 1997 | * OrgChart.VERSION; 1998 | * ``` 1999 | */ 2000 | static VERSION: string; 2001 | /** 2002 | * @ignore 2003 | */ 2004 | static TEXT_THRESHOLD: number; 2005 | /** 2006 | * @ignore 2007 | */ 2008 | static IMAGES_THRESHOLD: number; 2009 | /** 2010 | * @ignore 2011 | */ 2012 | static LINKS_THRESHOLD: number; 2013 | /** 2014 | * @ignore 2015 | */ 2016 | static BUTTONS_THRESHOLD: number; 2017 | /** 2018 | * @ignore 2019 | */ 2020 | static ANIM_THRESHOLD: number; 2021 | 2022 | /** 2023 | * @ignore 2024 | */ 2025 | static IT_IS_LONELY_HERE: string; 2026 | /** 2027 | * The text that we have if the chart is empty. 2028 | * ```TypeScript 2029 | * OrgChart.IT_IS_LONELY_HERE_LINK = "Click here to add your first node" 2030 | * ``` 2031 | */ 2032 | static IT_IS_LONELY_HERE_LINK: string; 2033 | /** 2034 | * @ignore 2035 | */ 2036 | static RES: { 2037 | /** 2038 | * @ignore 2039 | */ 2040 | IT_IS_LONELY_HERE_LINK: string 2041 | }; 2042 | 2043 | 2044 | /** 2045 | * @ignore 2046 | */ 2047 | static FIRE_DRAG_NOT_CLICK_IF_MOVE: number; 2048 | /** 2049 | * @ignore 2050 | */ 2051 | static STRING_TAGS: boolean; 2052 | /** 2053 | * Search placeholder 2054 | * ```TypeScript 2055 | * OrgChart.SEARCH_PLACEHOLDER = "Chercher"; // the default value is "Search" 2056 | * ``` 2057 | */ 2058 | static SEARCH_PLACEHOLDER: string; 2059 | /** 2060 | * Search help symbol. 2061 | * ```TypeScript 2062 | * OrgChart.SEARCH_HELP_SYMBOL = "help"; 2063 | * ``` 2064 | */ 2065 | static SEARCH_HELP_SYMBOL: string; 2066 | 2067 | /** 2068 | * Close search result list by click outside list and clean search input 2069 | * ```TypeScript 2070 | * OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE = true; // default value is false 2071 | * ``` 2072 | */ 2073 | static SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE: boolean; 2074 | /** 2075 | * @ignore 2076 | */ 2077 | static IMPORT_MESSAGE: string; 2078 | /** 2079 | * @ignore 2080 | */ 2081 | static FIXED_POSITION_ON_CLICK: boolean; 2082 | /** 2083 | * Render links before nodes, default is false 2084 | * ```typescript 2085 | * OrgChart.RENDER_LINKS_BEFORE_NODES = true; 2086 | * ``` 2087 | */ 2088 | static RENDER_LINKS_BEFORE_NODES: boolean; 2089 | /** 2090 | * Render clinks before nodes, default is false 2091 | * ```typescript 2092 | * OrgChart.RENDER_CLINKS_BEFORE_NODES = true; 2093 | * ``` 2094 | */ 2095 | static RENDER_CLINKS_BEFORE_NODES: boolean; 2096 | /** 2097 | * If false arrange vertically the nodes wothout children 2098 | * Default value: true 2099 | * ```typescript 2100 | * OrgChart.MIXED_LAYOUT_ALL_NODES = false; 2101 | * ``` 2102 | */ 2103 | static MIXED_LAYOUT_ALL_NODES: boolean; 2104 | /** 2105 | * Set mixed layout if there are collapsed children 2106 | * Defaul value: false 2107 | * ```typescript 2108 | * OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN = true; 2109 | * ``` 2110 | */ 2111 | static MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN: boolean; 2112 | /** 2113 | * Use mixed layout for example tree or treeLeftOffset if number of children is more then specified value 2114 | * Default value: 1 2115 | * ```typescript 2116 | * OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN = 0; 2117 | * ``` 2118 | */ 2119 | static MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN: number; 2120 | /** 2121 | * Set the radius of the roundet links 2122 | * ```typescript 2123 | * OrgChart.LINK_ROUNDED_CORNERS = 20; 2124 | * ``` 2125 | */ 2126 | static LINK_ROUNDED_CORNERS: number; 2127 | /** 2128 | * @ignore 2129 | */ 2130 | static MOVE_STEP: number; 2131 | /** 2132 | * Set the clink curve value 2133 | * set to 0 for a straight clicnk 2134 | * ```typescript 2135 | * OrgChart.CLINK_CURVE = 1.5; 2136 | * ``` 2137 | */ 2138 | static CLINK_CURVE: number; 2139 | /** 2140 | * Set the limit of the search result items 2141 | * ```typescript 2142 | * OrgChart.SEARCH_RESULT_LIMIT = 5; 2143 | * ``` 2144 | */ 2145 | static SEARCH_RESULT_LIMIT: number; 2146 | /** 2147 | * @ignore 2148 | */ 2149 | static MAX_DEPTH: number; 2150 | /** 2151 | * @ignore 2152 | */ 2153 | static SCALE_FACTOR: number; 2154 | /** 2155 | * Determines when the invisible nodes will become visible. 2156 | * The number tells on how many free pixel to show nodes 2157 | * The defaul value is *auto* 2158 | * ```typescript 2159 | * OrgChart.LAZY_LOADING_FACTOR = 10; 2160 | * ``` 2161 | */ 2162 | static LAZY_LOADING_FACTOR: number | string; 2163 | /** 2164 | * Can be used to instruct the browser to defer loading of OrgChart that are off-screen until the user scrolls near them. 2165 | * The init event listener will be called as soon as the OrgChart become visible. 2166 | * Default value: true 2167 | * ```typescript 2168 | * OrgChart.LAZY_LOADING = false; 2169 | * ``` 2170 | */ 2171 | static LAZY_LOADING: boolean; 2172 | 2173 | /** 2174 | * Minimum in search input before triggering the search. 2175 | * ```typescript 2176 | * OrgChart.MINIMUM_SYMBOLS_IN_SEARCH_INPUT = 3; 2177 | * ``` 2178 | */ 2179 | static MINIMUM_SYMBOLS_IN_SEARCH_INPUT: number; 2180 | 2181 | 2182 | /** 2183 | * System instructions let you steer the behavior of a model based on your specific needs and use cases. 2184 | * ```typescript 2185 | * OrgChart.AI_SYSTEM_MESSAGES = ["You are an HR assistant for interactive Organizational Char in MyCompamyName."]; 2186 | * ``` 2187 | */ 2188 | static AI_SYSTEM_MESSAGES: Array; 2189 | 2190 | /** 2191 | * Hides the Edit Form when the chart is moved with pan 2192 | * ```typescript 2193 | * OrgChart.HIDE_EDIT_FORM_ON_PAN = false; // the default value is true 2194 | * ``` 2195 | */ 2196 | static HIDE_EDIT_FORM_ON_PAN: boolean; 2197 | 2198 | /** 2199 | * @ignore 2200 | */ 2201 | static ARRAY_FIELDS: Array; 2202 | 2203 | /** 2204 | * Csv import and export delimiter/separator 2205 | * ```typescript 2206 | * OrgChart.CSV_DELIMITER = ','; 2207 | * ``` 2208 | */ 2209 | static CSV_DELIMITER: string; 2210 | 2211 | /** 2212 | * Edit Form close button 2213 | * ```typescript 2214 | * OrgChart.EDITFORM_CLOSE_BTN = '
X
'; 2215 | * ``` 2216 | */ 2217 | static EDITFORM_CLOSE_BTN: string; 2218 | /** 2219 | * Escape HTML to prevent Cross-site scripting (also known as XSS) attacks 2220 | * ```typescript 2221 | * OrgChart.ESCAPE_HTML = true; // the default value is false 2222 | * ``` 2223 | */ 2224 | static ESCAPE_HTML: boolean; 2225 | 2226 | /** 2227 | * Align children of assistant vertically 2228 | * ```typescript 2229 | * OrgChart.VERTICAL_CHILDREN_ASSISTANT = true; 2230 | * ``` 2231 | */ 2232 | static VERTICAL_CHILDREN_ASSISTANT: boolean; 2233 | 2234 | /** 2235 | * Cut nodes when export with pages, dafault is false 2236 | * ```typescript 2237 | * OrgChart.EXPORT_PAGES_CUT_NODES = true; 2238 | * ``` 2239 | */ 2240 | static EXPORT_PAGES_CUT_NODES: boolean; 2241 | 2242 | /** 2243 | * Reset movable nodes to its original position when expand or collapse 2244 | * Works with *movable nodes* functionality 2245 | * ```typescript 2246 | * OrgChart.RESET_MOVABLE_ONEXPANDCOLLAPSE = true; 2247 | * ``` 2248 | */ 2249 | static RESET_MOVABLE_ONEXPANDCOLLAPSE: boolean; 2250 | 2251 | /** 2252 | * Filter menu is ordered alphabetically by default 2253 | * ```typescript 2254 | * OrgChart.FILTER_ALPHABETICALLY = false; 2255 | * ``` 2256 | */ 2257 | static FILTER_ALPHABETICALLY: boolean; 2258 | 2259 | /** 2260 | * Generates random id for a node 2261 | * ```typescript 2262 | * let id = OrgChart.randomId(); 2263 | * ``` 2264 | */ 2265 | static randomId(): any; 2266 | 2267 | /** 2268 | * @ignore 2269 | */ 2270 | static searchUI: any; 2271 | /** 2272 | * @ignore 2273 | */ 2274 | static editUI: any; 2275 | /** 2276 | * @ignore 2277 | */ 2278 | static pdfPrevUI: OrgChart.pdfPrevUI; 2279 | // static menuUI: any; 2280 | /** 2281 | * @ignore 2282 | */ 2283 | static attr: any; 2284 | /** 2285 | * @ignore 2286 | */ 2287 | static toolbarUI: any; 2288 | /** 2289 | * @ignore 2290 | */ 2291 | static elements: any; 2292 | /** 2293 | * @ignore 2294 | */ 2295 | static expcollOpenTag: any; 2296 | /** 2297 | * @ignore 2298 | */ 2299 | static upOpenTag: any; 2300 | /** 2301 | * @ignore 2302 | */ 2303 | static grCloseTag: any; 2304 | } 2305 | 2306 | /** 2307 | * The node JSON data 2308 | * ```ts 2309 | * { id: 2, pid: 1, tags: ["HR"], name: "Anna Smith" } 2310 | * ``` 2311 | */ 2312 | interface nodeData { 2313 | 2314 | /** 2315 | * the id of the node 2316 | */ 2317 | id: number | string, 2318 | 2319 | /** 2320 | * the parent id 2321 | */ 2322 | pid?: number | string, 2323 | 2324 | /** 2325 | * the parent partner id 2326 | */ 2327 | ppid?: number | string, 2328 | 2329 | /** 2330 | * the subtree parent id 2331 | */ 2332 | stPid?: number | string, 2333 | 2334 | /** 2335 | * Set custom configuration for the tagged node 2336 | *{@link https://balkan.app/OrgChartJS/Docs/Tags | See Tags doc page...} 2337 | */ 2338 | tags?: Array, 2339 | [key: string]: any 2340 | } 2341 | 2342 | declare namespace OrgChart { 2343 | 2344 | // interface node { 2345 | // /** 2346 | // * 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 2347 | // */ 2348 | // pid?: string | number, 2349 | // } 2350 | /** 2351 | * deprecated, use OrgChart.align.center isntead 2352 | * @ignore 2353 | */ 2354 | const CENTER: number; 2355 | /** 2356 | * deprecated, use OrgChart.align.orientation isntead 2357 | * @ignore 2358 | */ 2359 | const ORIENTATION: number; 2360 | 2361 | 2362 | /** 2363 | * deprecated, use OrgChart.layout.normal isntead 2364 | * @ignore 2365 | */ 2366 | const normal: number; 2367 | 2368 | /** 2369 | * deprecated, use OrgChart.layout.mixed isntead 2370 | * @ignore 2371 | */ 2372 | const mixed: number; 2373 | /** 2374 | * deprecated, use OrgChart.layout.tree isntead 2375 | * @ignore 2376 | */ 2377 | const tree: number; 2378 | /** 2379 | * deprecated, use OrgChart.layout.treeLeftOffset isntead 2380 | * @ignore 2381 | */ 2382 | const treeLeftOffset: any; 2383 | /** 2384 | * deprecated, use OrgChart.layout.treeRightOffset isntead 2385 | * @ignore 2386 | */ 2387 | const treeRightOffset: any; 2388 | 2389 | interface options { 2390 | /** 2391 | * With the drag and drop features enabled you can move nodes easily and change the tree structure. Default value - *false*. 2392 | * ```typescript 2393 | * var chart = new OrgChart('#tree', { 2394 | * enableDragDrop: true 2395 | * }); 2396 | * ``` 2397 | */ 2398 | enableDragDrop?: boolean, 2399 | /** 2400 | * Collapse specified level of the chart and its children if allChildren is true. 2401 | * ```typescript 2402 | * var chart = new OrgChart('#tree', { 2403 | * collapse: {level: 2, allChildren: true} 2404 | * }); 2405 | * ``` 2406 | */ 2407 | collapse?: { 2408 | level: number, 2409 | allChildren?: boolean 2410 | }, 2411 | /** 2412 | * Expand specified node ids and its children if allChildren is true. The expand option works only if collapse is set. 2413 | * 2414 | * In the example above the second level of the chart will be collapsed but node with id 155 and its children will be expanded. 2415 | * ```typescript 2416 | * var chart = new OrgChart('#tree', { 2417 | * collapse: {level: 2, allChildren: true}, 2418 | * expand: {nodes: [155], allChildren: true} 2419 | * }); 2420 | * ``` 2421 | */ 2422 | expand?: { 2423 | nodes?: Array, 2424 | allChildren?: boolean 2425 | }, 2426 | } 2427 | 2428 | /** 2429 | * deprecated 2430 | * @ignore 2431 | */ 2432 | const none: number; 2433 | 2434 | /** 2435 | * @ignore 2436 | */ 2437 | const COLLAPSE_PARENT_NEIGHBORS: number; 2438 | 2439 | /** 2440 | * @ignore 2441 | */ 2442 | const COLLAPSE_SUB_CHILDRENS: number; 2443 | 2444 | 2445 | /** 2446 | * The OrgChart node model 2447 | * ```typescript 2448 | * var chart = new OrgChart('#tree', {}); 2449 | * chart.onInit(() => { 2450 | * let node = chart.getNode(2); 2451 | * console.log(node); 2452 | * }); 2453 | * chart.load(nodes) 2454 | * ``` 2455 | */ 2456 | interface node { 2457 | /** 2458 | * the same id you provided in the source node 2459 | */ 2460 | id?: string | number, 2461 | /** 2462 | * 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. 2463 | */ 2464 | ppid?: string | number, 2465 | /** 2466 | * 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 2467 | */ 2468 | parent?: node, 2469 | /** 2470 | * 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. 2471 | */ 2472 | stpid?: string | number, 2473 | /** 2474 | * - 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 2475 | */ 2476 | stParent?: node, 2477 | isPartner?: boolean, 2478 | partnerSeparation?: number, 2479 | /** 2480 | * array of ids, always initialized 2481 | */ 2482 | childrenIds?: Array, 2483 | /** 2484 | * array of children nodes, initialized on demand if all children are collpased it will be empty array 2485 | */ 2486 | children?: Array, 2487 | /** 2488 | * array of sub tree children root node ids, always initialized 2489 | */ 2490 | stChildrenIds?: Array, 2491 | /** 2492 | * array of sub tree children root nodes, initialized on demand if the node is minimized it will be empty array 2493 | */ 2494 | stChildren?: Array, 2495 | /** 2496 | * array of string values, the same array you provided in the source node 2497 | */ 2498 | tags?: Array, 2499 | /** 2500 | * template name, you can specify multiple templates with tags in one chart 2501 | */ 2502 | templateName?: string, 2503 | /** 2504 | * a reference to the left node neighbor, the default value is undefined 2505 | */ 2506 | leftNeighbor?: node | undefined, 2507 | /** 2508 | * a reference to the right node neighbor, the default value is undefined 2509 | */ 2510 | rightNeighbor?: node | undefined, 2511 | /** 2512 | * x position, default value undefined 2513 | */ 2514 | x?: number | undefined, 2515 | /** 2516 | * y position, default value undefined 2517 | */ 2518 | y?: number | undefined, 2519 | /** 2520 | * width of the node, default value undefined 2521 | */ 2522 | w?: number | undefined, 2523 | /** 2524 | * height of the node, default value undefined 2525 | */ 2526 | h?: number | undefined, 2527 | /** 2528 | * if the node is assistant is true if not false if the node is not initialized is undefined 2529 | */ 2530 | isAssistant?: boolean | undefined, 2531 | /** 2532 | * sub tree container nodes array, property only for the root node, default value undefined 2533 | */ 2534 | stContainerNodes?: Array | undefined, 2535 | /** 2536 | * it is set only if you define order option, default value undefined 2537 | */ 2538 | order?: number | undefined, 2539 | /** 2540 | * true if the node is collpased, false if it is not and undefined if not initalized 2541 | */ 2542 | collapsed?: boolean | undefined, 2543 | /** 2544 | * a level of the node starting from zero 2545 | */ 2546 | level?: number, 2547 | /** 2548 | * true if the node is minimized, default value undefined 2549 | */ 2550 | min?: boolean | undefined, 2551 | /** 2552 | * sub levels, default value undefined 2553 | */ 2554 | subLevels?: number | undefined, 2555 | /** 2556 | * set only if the node contains sub trees and padding is defined in the template, default value undefined 2557 | */ 2558 | padding?: number | undefined, 2559 | /** 2560 | * layout configuration name, default value undefined 2561 | */ 2562 | lcn?: string | undefined, 2563 | /** 2564 | * for assistant nodes and mixed layout we create dynamic nodes called splits, default value undefined 2565 | */ 2566 | isSplit?: boolean | undefined, 2567 | /** 2568 | * indicates if the node is child of partner node 2569 | */ 2570 | isChildOfPartner?: boolean, 2571 | /** 2572 | * move the the node on x axis 2573 | */ 2574 | movex?: number | undefined, 2575 | /** 2576 | * move the the node on y axis 2577 | */ 2578 | movey?: number | undefined 2579 | } 2580 | 2581 | /** 2582 | * Template definition 2583 | * ```typescript 2584 | * OrgChart.templates.myTemplate = Object.assign({}, OrgChart.templates.ana); 2585 | * ``` 2586 | */ 2587 | interface template 2588 | { 2589 | /** 2590 | * SVG of the template 2591 | * ```typescript 2592 | * OrgChart.templates.myTemplate.defs = 2593 | * ` 2594 | * 2595 | * 2596 | * 2597 | * `; 2598 | * ``` 2599 | */ 2600 | defs?: string, 2601 | 2602 | /** 2603 | * Size of the template 2604 | * ```typescript 2605 | * OrgChart.templates.myTemplate.size = [200, 100]; 2606 | * ``` 2607 | */ 2608 | size?: Array, 2609 | 2610 | /** 2611 | * Size of the expandCollapse button 2612 | * ```typescript 2613 | * OrgChart.templates.myTemplate.expandCollapseSize = 30; 2614 | * ``` 2615 | */ 2616 | expandCollapseSize?: number, 2617 | 2618 | /** 2619 | * Adjust link positions 2620 | * ```typescript 2621 | * OrgChart.templates.myTemplate.linkAdjuster = { 2622 | * fromX: 0, 2623 | * fromY: -10, 2624 | * toX: 0, 2625 | * toY: 0 2626 | * } 2627 | * ``` 2628 | */ 2629 | linkAdjuster?: { 2630 | fromX?: number, 2631 | fromY?: number, 2632 | toX?: number, 2633 | toY?: number 2634 | }, 2635 | 2636 | /** 2637 | * Ripple 2638 | * ```typescript 2639 | * OrgChart.templates.myTemplate.ripple = 2640 | * radius: 100, 2641 | * color: "#e6e6e6", 2642 | * rect: null 2643 | * } 2644 | * ``` 2645 | */ 2646 | ripple?: { 2647 | radius?: number, 2648 | color?: string, 2649 | rect?: Array 2650 | }, 2651 | 2652 | /** 2653 | * Assistance link 2654 | * ```typescript 2655 | * OrgChart.templates.myTemplate.assistanseLink = 2656 | * ``; 2658 | * } 2659 | * ``` 2660 | */ 2661 | assistanseLink?: string, 2662 | 2663 | /** 2664 | * Assistance link 2665 | * ```typescript 2666 | * OrgChart.templates.myTemplate.svg = 2667 | * `{content} 2669 | * `; 2670 | * ``` 2671 | */ 2672 | svg?: string, 2673 | 2674 | /** 2675 | * Link 2676 | * ```typescript 2677 | * OrgChart.templates.myTemplate.link = 2678 | * ``; 2679 | * ``` 2680 | */ 2681 | link?: string, 2682 | 2683 | /** 2684 | * Pointer 2685 | * ```typescript 2686 | * OrgChart.templates.myTemplate.pointer = 2687 | * ` 2688 | * 2689 | * 2690 | * 2691 | * 2692 | * 2693 | * `; 2694 | * ``` 2695 | */ 2696 | pointer?: string, 2697 | 2698 | /** 2699 | * Node definition - A string that should contains SVG markup. 2700 | * ```typescript 2701 | * OrgChart.templates.myTemplate.node = 2702 | * ``; 2703 | * ``` 2704 | */ 2705 | node?: string, 2706 | 2707 | /** 2708 | * Plus/expand button 2709 | * ```typescript 2710 | * OrgChart.templates.myTemplate.plus = 2711 | * ` 2712 | * 2713 | * `; 2714 | * ``` 2715 | */ 2716 | plus?: string, 2717 | 2718 | /** 2719 | * Minus/collapse button 2720 | * ```typescript 2721 | * OrgChart.templates.myTemplate.minus = 2722 | * ` 2723 | * `; 2724 | * ``` 2725 | */ 2726 | minus?: string, 2727 | 2728 | /** 2729 | * Node menu button 2730 | * ```typescript 2731 | * OrgChart.templates.myTemplate.nodeMenuButton = 2732 | * ` 2733 | * 2734 | * 2735 | * 2736 | * `; 2737 | * ``` 2738 | */ 2739 | nodeMenuButton?: string, 2740 | 2741 | /** 2742 | * Menu button 2743 | * ```typescript 2744 | * OrgChart.templates.myTemplate.menuButton = 2745 | * `
2746 | *
2747 | *
2748 | *
2749 | *
`; 2750 | * ``` 2751 | */ 2752 | menuButton?: string, 2753 | 2754 | /** 2755 | * Node image 2756 | * ```typescript 2757 | * OrgChart.templates.myTemplate.img_0 = 2758 | * ` 2759 | * 2760 | * `; 2761 | * ``` 2762 | */ 2763 | img_0?: string, 2764 | 2765 | /** 2766 | * Link label 2767 | * ```typescript 2768 | * OrgChart.templates.myTemplate.link_field_0 = 2769 | * `{val}`; 2770 | * ``` 2771 | */ 2772 | link_field_0?: string, 2773 | 2774 | /** 2775 | * Edit form header color 2776 | * ```typescript 2777 | * OrgChart.templates.myTemplate.editFormHeaderColor = '#039BE5' 2778 | * ``` 2779 | */ 2780 | editFormHeaderColor?: string, 2781 | 2782 | /** 2783 | * EMode circle menu button 2784 | * ```typescript 2785 | * OrgChart.templates.myTemplate.nodeCircleMenuButton = { 2786 | * radius: 18, 2787 | * x: 250, 2788 | * y: 60, 2789 | * color: '#fff', 2790 | * stroke: '#aeaeae' 2791 | * } 2792 | * ``` 2793 | */ 2794 | nodeCircleMenuButton?: object, 2795 | 2796 | /** 2797 | * Minimized template 2798 | * ```typescript 2799 | * OrgChart.templates.myTemplate.min = Object.assign({}, OrgChart.templates.ana); 2800 | * OrgChart.templates.myTemplate.min.size = [250, 60]; 2801 | * OrgChart.templates.myTemplate.min.img_0 = ""; 2802 | * OrgChart.templates.myTemplate.min.field_0 = 2803 | * `{val}`; 2804 | * OrgChart.templates.myTemplate.min.field_1 = ""; 2805 | * ``` 2806 | */ 2807 | min?: OrgChart.template, 2808 | 2809 | /** 2810 | * A custom field definition 2811 | * ```typescript 2812 | * OrgChart.templates.myTemplate.number = 2813 | * `{val}`; 2814 | * ``` 2815 | */ 2816 | [name: string]: any 2817 | } 2818 | 2819 | 2820 | /** 2821 | * Edit/Details Form User Interface 2822 | * ```typescript 2823 | * let chart = new OrgChart("#tree", { 2824 | * }); 2825 | * chart.onInit(function(){ 2826 | * chart.editUI.show(1); 2827 | * }); 2828 | * chart.load(nodes) 2829 | * ``` 2830 | */ 2831 | interface editUI { 2832 | /** 2833 | * Inits edit ui 2834 | * @param obj 2835 | */ 2836 | init(obj: OrgChart): void; 2837 | /** 2838 | * The on() method of the editUI interface sets up a function that will be called whenever the specified event is delivered to the target. * 2839 | * @category Event Listeners 2840 | * @param type A case-sensitive string representing the event type to listen for. 2841 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function. 2842 | */ 2843 | on(type: "show" | "shown" | "save" | "cancel" | "element-btn-click" | "button-click" | "hide", listener: (sender: editUI, args: any, args1: any, args2: any) => void | boolean): editUI; 2844 | /** 2845 | * Shows the edit form for the specified node id 2846 | * @param id node id 2847 | * @param detailsMode If true the edit form is in read only mode 2848 | * @param dontAnim 2849 | */ 2850 | show(id: string | number, detailsMode?: boolean, dontAnim?: boolean): void; 2851 | /** 2852 | * Hides the edit form 2853 | */ 2854 | hide(): void; 2855 | content(id: string | number, detailsMode: boolean, dontAnim: boolean, width: string, dontRenderButtons: boolean): string; 2856 | // static renderHeaderContent(title: string, photo: string, node: OrgChart.node, data: object): string; 2857 | } 2858 | 2859 | /** 2860 | * AI User Interface 2861 | * ```typescript 2862 | * let chart = new OrgChart("#tree", { 2863 | * enableAI: true, 2864 | * }); 2865 | * chart.onInit(function(){ 2866 | * chart.aiUI.show(); 2867 | * }); 2868 | * chart.load(nodes) 2869 | * ``` 2870 | */ 2871 | interface aiUI { 2872 | /** 2873 | * The width of the ai UI 2874 | */ 2875 | get width(): number; 2876 | /** 2877 | * Prompt text box 2878 | */ 2879 | inputElement: HTMLInputElement; 2880 | /** 2881 | * Inits ai ui 2882 | * @param obj 2883 | */ 2884 | init(obj: OrgChart): void; 2885 | /** 2886 | * Shows the ai form 2887 | * @param dontFocus if true the imput will not be focused 2888 | * @param dontAnim If true hsoe withput animation 2889 | */ 2890 | show(dontFocus?: boolean, dontAnim?: boolean): void; 2891 | /** 2892 | * Hides the ai form 2893 | */ 2894 | hide(): void; 2895 | /** 2896 | * Returns true if the ai UI is visible 2897 | */ 2898 | isVisible(): boolean; 2899 | } 2900 | 2901 | interface searchUI { 2902 | /** 2903 | * @ignore 2904 | */ 2905 | init(obj: OrgChart): void; 2906 | 2907 | /** 2908 | * The on() method of the searchUI interface sets up a function that will be called whenever the specified event is delivered to the target. * 2909 | * ```typescript 2910 | * let chart = new OrgChart("#tree", {}); 2911 | * chart.searchUI.on('searchclick', function (sender, args) { 2912 | * sender.hide(); 2913 | * }); 2914 | * chart.load(nodes) 2915 | * ``` 2916 | * @category Event Listeners 2917 | * @param type A case-sensitive string representing the event type to listen for. 2918 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function. 2919 | */ 2920 | on(type: "add-item" | "show-items" | "hide" | "searchclick" , listener: (sender: searchUI, args: any, args1: any, args2: any) => void | boolean): searchUI; 2921 | 2922 | /** 2923 | * Hides the search grid 2924 | * ```typescript 2925 | * let chart = new OrgChart("#tree", {}); 2926 | * chart.searchUI.on('searchclick', function (sender, args) { 2927 | * sender.hide(); 2928 | * }); 2929 | * chart.load(nodes) 2930 | * ``` 2931 | */ 2932 | hide(): void; 2933 | 2934 | /** 2935 | * Finds filed data by specified value 2936 | * ```typescript 2937 | * let chart = new OrgChart("#tree", {}); 2938 | * chart.onInit(() => { 2939 | * chart.searchUI.find("Denny"); 2940 | * }); 2941 | * chart.load(nodes) 2942 | * ``` 2943 | * @param value search for value 2944 | */ 2945 | find(value: string): void; 2946 | 2947 | /** 2948 | * ```typescript 2949 | * OrgChart.searchUI.createItem = function (img, id, first, second) { 2950 | * return 2951 | * ` 2952 | * 2953 | *
2954 | * 2955 | * ${first}
${second} 2956 | * `; 2957 | * }; 2958 | * ``` 2959 | * @param img 2960 | * @param id 2961 | * @param first 2962 | * @param second 2963 | */ 2964 | createItem(img: string, id: string | number, first: string, second: string): string; 2965 | 2966 | /** 2967 | * @ignore 2968 | */ 2969 | helpView(): string; 2970 | 2971 | /** 2972 | * @ignore 2973 | */ 2974 | addMatchTag(id: string | number) : boolean; 2975 | 2976 | /** 2977 | * Input field 2978 | * ```typescript 2979 | * let chart = new OrgChart("#tree", {}); 2980 | * chart.onInit(() => { 2981 | * chart.searchUI.input.focus(); 2982 | * }); 2983 | * chart.load(nodes) 2984 | * ``` 2985 | */ 2986 | input: HTMLElement; 2987 | 2988 | /** 2989 | * @ignore 2990 | */ 2991 | searchTableWrapper: HTMLElement; 2992 | 2993 | /** 2994 | * @ignore 2995 | */ 2996 | lastSearch: Array; 2997 | /** 2998 | * @ignore 2999 | */ 3000 | instance: OrgChart; 3001 | /** 3002 | * @ignore 3003 | */ 3004 | searchFieldsAbbreviation: {[key: string]: string}; 3005 | } 3006 | 3007 | 3008 | interface filterUI { 3009 | /** 3010 | * @ignore 3011 | */ 3012 | init(instance: OrgChart): void; 3013 | 3014 | /** 3015 | * @ignore 3016 | */ 3017 | update(): void; 3018 | 3019 | /** 3020 | * Opens filter Tab 3021 | * ```typescript 3022 | * let chart = new OrgChart("#tree", { 3023 | * }) 3024 | * chart.onInit(() => { 3025 | * chart.filterUI.show("city") 3026 | * }) 3027 | * chart.load(nodes) 3028 | * ``` 3029 | * @param filterTabName the name of the filter tab 3030 | */ 3031 | show(filterTabName: string): void; 3032 | 3033 | /** 3034 | * Opens filter Tab 3035 | * ```typescript 3036 | * chart.element.addEventListener('click', function(event){ 3037 | * if (event.target == chart.getSvg()){ 3038 | * chart.filterUI.hide(); 3039 | * } 3040 | * }); 3041 | * ``` 3042 | */ 3043 | hide(): void; 3044 | 3045 | /** 3046 | * @ignore 3047 | */ 3048 | addFilterTag(data: object): boolean; 3049 | /** 3050 | * The on() method of the filterUI interface sets up a function that will be called whenever the specified event is delivered to the target. * 3051 | * @category Event Listeners 3052 | * @param type A case-sensitive string representing the event type to listen for. 3053 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function. 3054 | */ 3055 | 3056 | /** 3057 | * Opens filter Tab 3058 | * ```typescript 3059 | * let chart = new OrgChart("#tree", { 3060 | * }) 3061 | * chart.filterUI.on('add-filter', function(sender, args){ 3062 | * let names = Object.keys(sender.filterBy); 3063 | * let index = names.indexOf(args.name); 3064 | * if (index == names.length - 1) { 3065 | * args.html += `
reset
`; 3066 | * } 3067 | * }); 3068 | * chart.load(nodes) 3069 | * ``` 3070 | */ 3071 | on(type: "update" | "add-item" | "add-filter" | "show-items" , listener: (sender: filterUI, args: any, args1: any, args2: any) => void | boolean): filterUI; 3072 | 3073 | /** 3074 | * Contains all filters 3075 | * ```typescript 3076 | * let chart = new OrgChart("#tree", { 3077 | * }); 3078 | * chart.onInit(() => { 3079 | * let filterBy = chart.filterUI.filterBy 3080 | * } 3081 | * chart.load(nodes) 3082 | * ``` 3083 | */ 3084 | filterBy?: any; 3085 | 3086 | /** 3087 | * @ignore 3088 | */ 3089 | element: HTMLElement; 3090 | 3091 | /** 3092 | * @ignore 3093 | */ 3094 | instance: OrgChart; 3095 | } 3096 | 3097 | /** 3098 | * @ignore 3099 | */ 3100 | interface xScrollUI { 3101 | addListener(svg: HTMLElement): void; 3102 | create(width: number): void; 3103 | setPosition(width: number): void; 3104 | on(type: "change", listener: (sender: xScrollUI, args: any, args1: any, args2: any) => void | boolean): xScrollUI; 3105 | element: HTMLElement; 3106 | } 3107 | 3108 | /** 3109 | * @ignore 3110 | */ 3111 | interface yScrollUI { 3112 | addListener(svg: HTMLElement): void; 3113 | create(width: number): void; 3114 | setPosition(width: number): void; 3115 | on(type: "change", listener: (sender: yScrollUI, args: any, args1: any, args2: any) => void | boolean): yScrollUI; 3116 | element: HTMLElement; 3117 | } 3118 | 3119 | 3120 | /** 3121 | * Menu UI 3122 | * ```typescript 3123 | * let chart = new OrgChart("#tree", { 3124 | * }) 3125 | * chart.onInit(() => { 3126 | * chart.menuUI.show(chart.getMenuButton()); 3127 | * }) 3128 | * chart.load(nodes) 3129 | * ``` 3130 | */ 3131 | interface menuUI { 3132 | init(obj: OrgChart, menu: { [key: string]: menu }): void; 3133 | /** 3134 | * The on() method of the menuUI interface sets up a function that will be called whenever the specified event is delivered to the target. * 3135 | * @category Event Listeners 3136 | * @param type A case-sensitive string representing the event type to listen for. 3137 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function. 3138 | */ 3139 | on(type: "show", listener: (sender: menuUI, args: any, args1: any, args2: any) => void | boolean): menuUI; 3140 | /** 3141 | * Shows menu next to html element 3142 | * @param stickToElement 3143 | * @param firstNodeId 3144 | * @param secondNodeId 3145 | * @param menu 3146 | */ 3147 | showStickIn(stickToElement: HTMLElement, firstNodeId: string | number, secondNodeId: string | number, menu: { [key: string]: menu }): void; 3148 | /** 3149 | * Returns true if the menu is visible 3150 | */ 3151 | isVisible(): boolean; 3152 | 3153 | /** 3154 | * Hieds the menu 3155 | */ 3156 | hide(): void; 3157 | /** 3158 | * Shows menu by x,y position 3159 | * @param x 3160 | * @param y 3161 | * @param firstNodeId 3162 | * @param secondNodeId 3163 | * @param menu 3164 | */ 3165 | show(x: number | HTMLElement, y?: number, firstNodeId?: string | number, secondNodeId?: string | number, menu?: { [key: string]: menu }): void; 3166 | } 3167 | 3168 | interface powerPointPreviewUI { 3169 | /** 3170 | * The width of the EXPORT UI 3171 | */ 3172 | get width(): number; 3173 | get instance(): OrgChart; 3174 | get options(): OrgChart.exportPowerPontOptions; 3175 | init(obj: OrgChart): void; 3176 | isVisible(): boolean; 3177 | hide(): void; 3178 | show(options: OrgChart.exportPowerPontOptions): void; 3179 | } 3180 | 3181 | interface pdfPreviewUI { 3182 | /** 3183 | * The width of the EXPORT UI 3184 | */ 3185 | get width(): number; 3186 | get instance(): OrgChart; 3187 | get options(): OrgChart.exportPDFOptions; 3188 | init(obj: OrgChart): void; 3189 | isVisible(): boolean; 3190 | hide(): void; 3191 | show(options: OrgChart.exportPDFOptions): void; 3192 | } 3193 | 3194 | interface pngPreviewUI { 3195 | /** 3196 | * The width of the EXPORT UI 3197 | */ 3198 | get width(): number; 3199 | get instance(): OrgChart; 3200 | get options(): OrgChart.exportPNGOptions; 3201 | init(obj: OrgChart): void; 3202 | isVisible(): boolean; 3203 | hide(): void; 3204 | show(options: OrgChart.exportPNGOptions): void; 3205 | } 3206 | 3207 | /** 3208 | * Circle Menu UI 3209 | * ```typescript 3210 | * var chart = new OrgChart('#tree', {}); 3211 | * chart.onInit(() => { 3212 | * chart.nodeCircleMenuUI.show(1); 3213 | * }); 3214 | * ``` 3215 | */ 3216 | interface circleMenuUI { 3217 | /** 3218 | * Inits circle menu instance 3219 | * @param obj 3220 | * @param menu 3221 | */ 3222 | init(obj: OrgChart, menu: { [key: string]: menu }): void; 3223 | /** 3224 | * Shows circle menu 3225 | * 3226 | * 3227 | * @param nodeId 3228 | * @param menu 3229 | */ 3230 | show(nodeId: string | number, menu?: { [key: string]: menu }): void; 3231 | /** 3232 | * Hides circle menu 3233 | */ 3234 | hide(): void; 3235 | /** 3236 | * The on() method of the circleMenuUI interface sets up a function that will be called whenever the specified event is delivered to the target. * 3237 | * @category Event Listeners 3238 | * @param type A case-sensitive string representing the event type to listen for. 3239 | * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function. 3240 | */ 3241 | on(type: "click" | "show" | "drag" | "drop" | "mouseenter" | "mouseout", listener: (sender: circleMenuUI, args: any, args1: any, args2: any) => void | boolean): circleMenuUI; 3242 | } 3243 | 3244 | interface undoRedoUI { 3245 | /** 3246 | * Inits undoRedoUI 3247 | * @ignore 3248 | * @param instance 3249 | */ 3250 | init(instance: OrgChart): void; 3251 | /** 3252 | * Refreshes the UI buttonss 3253 | * @ignore 3254 | */ 3255 | refresh(): void; 3256 | /** 3257 | * @ignore 3258 | */ 3259 | on(type: "change", listener: (sender: undoRedoUI, args: any) => void | boolean): undoRedoUI; 3260 | /** 3261 | * Occurs when the undo redo buttons needs to updated. 3262 | * ```typescript 3263 | * var chart = new OrgChart('#tree', {}); 3264 | * chart.undoRedoUI.onChange((args) => { 3265 | * //return false; to cancel the operation 3266 | * }); 3267 | * ``` 3268 | * @category Event Listeners 3269 | * @param listener 3270 | */ 3271 | onChange(listener: (args: { 3272 | /** 3273 | * Undo stack steps count 3274 | */ 3275 | undoStepsCount: number, 3276 | /** 3277 | * Redo stack steps count 3278 | */ 3279 | redoStepsCount: number 3280 | }) => void): undoRedoUI; 3281 | instance: OrgChart; 3282 | } 3283 | 3284 | interface pdfPrevUI { 3285 | /** 3286 | * Shows the PDF Preview UI 3287 | * ```typescript 3288 | * function pdf() { 3289 | * OrgChart.pdfPrevUI.show(chart, { 3290 | * format: "A4", 3291 | * header: 'My Header', 3292 | * footer: 'My Footer. Page {current-page} of {total-pages}' 3293 | * }); 3294 | * } 3295 | * ``` 3296 | */ 3297 | show(chart: OrgChart, options: exportOptions): pdfPrevUI; 3298 | 3299 | /** 3300 | * Hide the PDF Preview UI 3301 | * ```typescript 3302 | * chart.element.querySelector('#boc-prev-cancel').addEventListener('click', function () { 3303 | * OrgChart.pdfPrevUI.hide(chart); 3304 | * }); 3305 | * ``` 3306 | */ 3307 | hide(chart: OrgChart): void; 3308 | 3309 | } 3310 | 3311 | interface keyNavigation { 3312 | /** 3313 | * Set focus to specified id on initial load 3314 | * ```typescript 3315 | * var chart = new OrgChart('#tree', { 3316 | * keyNavigation:{ 3317 | * focusId: 2 3318 | * } 3319 | * }); 3320 | * ``` 3321 | */ 3322 | focusId: number | string 3323 | } 3324 | 3325 | /** 3326 | * Toolbar UI 3327 | */ 3328 | interface toolbarUI { 3329 | /** 3330 | * @ignore 3331 | * @param obj 3332 | * @param toolbar 3333 | */ 3334 | init(obj: OrgChart, toolbar: toolbar): void; 3335 | 3336 | /** 3337 | * Shows the layout 3338 | * ```typescript 3339 | * var chart = new OrgChart('#tree', {}); 3340 | * chart.onInit(function(){ 3341 | * this.toolbarUI.showLayout(); 3342 | * }); 3343 | * chart.load(nodes) 3344 | * ``` 3345 | */ 3346 | showLayout(): void; 3347 | 3348 | /** 3349 | * Hides the layout 3350 | * ```typescript 3351 | * var chart = new OrgChart('#tree', {}); 3352 | * chart.onInit(function(){ 3353 | * this.toolbarUI.hideLayout(); 3354 | * }); 3355 | * chart.load(nodes) 3356 | * ``` 3357 | */ 3358 | hideLayout(): void; 3359 | 3360 | /** 3361 | * ```typescript 3362 | * OrgChart.toolbarUI.expandAllIcon = 3363 | * ` 3364 | * 3365 | * 3366 | * 3367 | * 3368 | * 3369 | * 3370 | * `; 3371 | * ``` 3372 | */ 3373 | expandAllIcon?: string; 3374 | 3375 | /** 3376 | * ```typescript 3377 | * OrgChart.toolbarUI.fitIcon = 3378 | * ` 3379 | * 3380 | * 3381 | * 3382 | * 3383 | * 3384 | * `; 3385 | * ``` 3386 | */ 3387 | fitIcon?: string; 3388 | 3389 | /** 3390 | * ```typescript 3391 | * OrgChart.toolbarUI.openFullScreenIcon = 3392 | * ` 3393 | * 3394 | * 3395 | * 3396 | * 3397 | * 3398 | * 3399 | * `; 3400 | * ``` 3401 | */ 3402 | openFullScreenIcon?: string; 3403 | 3404 | /** 3405 | * ```typescript 3406 | * OrgChart.toolbarUI.closeFullScreenIcon = 3407 | * ` 3408 | * 3409 | * 3410 | * 3411 | * 3412 | * 3413 | * `; 3414 | * ``` 3415 | */ 3416 | closeFullScreenIcon?: string; 3417 | 3418 | /** 3419 | * ```typescript 3420 | * OrgChart.toolbarUI.zoomInIcon = 3421 | * ` 3422 | * 3423 | * 3424 | * 3425 | * 3426 | * 3427 | * 3428 | * `; 3429 | * ``` 3430 | */ 3431 | zoomInIcon?: string; 3432 | 3433 | /** 3434 | * ```typescript 3435 | * OrgChart.toolbarUI.zoomOutIcon = 3436 | * ` 3437 | * 3438 | * 3439 | * 3440 | * 3441 | * `; 3442 | * ``` 3443 | */ 3444 | zoomOutIcon?: string; 3445 | 3446 | /** 3447 | * ```typescript 3448 | * OrgChart.toolbarUI.layoutIcon = 3449 | * ` 3450 | * 3451 | * 3452 | * `; 3453 | * ``` 3454 | */ 3455 | layoutIcon?: string; 3456 | } 3457 | 3458 | /** 3459 | * When you implement function calling in a prompt, you create a tools object, which contains one or more function declarations. 3460 | * ```typescript 3461 | * var chart = new OrgChart('#tree', { 3462 | * enableAI: true, 3463 | * aiChatTools: [{ 3464 | * functionName: 'sendEmail', 3465 | * functionDescription: 'Send an email to a given employee with a subject and message.', 3466 | * functionParameters: { 3467 | * type: "object", 3468 | * properties: { 3469 | * to: { 3470 | * type: "string", 3471 | * description: "The employee email address." 3472 | * }, 3473 | * subject: { 3474 | * type: "string", 3475 | * description: "Email subject line." 3476 | * }, 3477 | * body: { 3478 | * type: "string", 3479 | * description: "Body of the email message." 3480 | * } 3481 | * }, 3482 | * required: [ 3483 | * "to", 3484 | * "subject", 3485 | * "body" 3486 | * }, 3487 | * additionalProperties: false 3488 | * }, 3489 | * strict: true 3490 | * }] 3491 | * }); 3492 | * ``` 3493 | * [Go to AI doc page for more details](https://balkan.app/OrgChartJS/Docs/AI) 3494 | */ 3495 | interface aiChatTool { 3496 | /** 3497 | * The unique identifier for the function within the API call. 3498 | */ 3499 | functionName?: string, 3500 | /** 3501 | * A comprehensive explanation of the function's purpose and capabilities. 3502 | */ 3503 | functionDescription?: string, 3504 | /** 3505 | * Defines the input data required by the function. 3506 | */ 3507 | functionParameters?: { 3508 | /** 3509 | * Specifies the overall data type, such as object. 3510 | */ 3511 | type?: "object", 3512 | /** 3513 | * Lists individual parameters. 3514 | */ 3515 | properties?: { 3516 | [key: string]: { 3517 | /** 3518 | * The data type of the parameter, such as string, integer, boolean. 3519 | */ 3520 | type?: string, 3521 | /** 3522 | * A clear explanation of the parameter's purpose and expected format. 3523 | */ 3524 | description?: string 3525 | } 3526 | }, 3527 | /** 3528 | * An array of strings listing the parameter names that are mandatory for the function to operate. 3529 | */ 3530 | required?: Array 3531 | } 3532 | } 3533 | 3534 | /** 3535 | * Toolbar buttons. Set to true if you'd like to show a button 3536 | */ 3537 | interface toolbar { 3538 | 3539 | /** 3540 | * Shows the layout options 3541 | * ```typescript 3542 | * var chart = new OrgChart('#tree', { 3543 | * toolbar: { 3544 | * layout: true 3545 | * } 3546 | * }); 3547 | * ``` 3548 | */ 3549 | layout?: boolean, 3550 | 3551 | /** 3552 | * 3553 | * Zoom plus and minus buttons 3554 | * ```typescript 3555 | * var chart = new OrgChart('#tree', { 3556 | * toolbar: { 3557 | * zoom: true 3558 | * } 3559 | * }); 3560 | * ``` 3561 | */ 3562 | zoom?: boolean, 3563 | 3564 | /** 3565 | * Fit to screen option 3566 | * ```typescript 3567 | * var chart = new OrgChart('#tree', { 3568 | * toolbar: { 3569 | * fit: true 3570 | * } 3571 | * }); 3572 | * ``` 3573 | */ 3574 | fit?: boolean, 3575 | 3576 | /** 3577 | * Expand all nodes button 3578 | * ```typescript 3579 | * var chart = new OrgChart('#tree', { 3580 | * toolbar: { 3581 | * expandAll: true 3582 | * } 3583 | * }); 3584 | * ``` 3585 | */ 3586 | expandAll?: boolean, 3587 | 3588 | /** 3589 | * Switch to fullscreen button 3590 | * ```typescript 3591 | * var chart = new OrgChart('#tree', { 3592 | * toolbar: { 3593 | * fullScreen: true 3594 | * } 3595 | * }); 3596 | * ``` 3597 | */ 3598 | fullScreen?: boolean 3599 | } 3600 | 3601 | /** 3602 | * miniMap options 3603 | */ 3604 | interface miniMap { 3605 | 3606 | /** 3607 | * Array of colors to use for the miniMap 3608 | * ```typescript 3609 | * OrgChart.miniMap.colors = ["#FFCA28", "#F57C00", "#039be5", "#757575"]; 3610 | * ``` 3611 | */ 3612 | colors?: Array, 3613 | 3614 | /** 3615 | * The background color in the miniMAp 3616 | * ```typescript 3617 | * OrgChart.miniMap.selectorBackgroundColor = "#888888"; 3618 | * ``` 3619 | */ 3620 | selectorBackgroundColor?: string, 3621 | 3622 | 3623 | /** 3624 | * The background of the focus 3625 | * ```typescript 3626 | * OrgChart.miniMap.backgroundColor = "#fff"; 3627 | * ``` 3628 | */ 3629 | backgroundColor?: string, 3630 | 3631 | /** 3632 | * The stroke of the focus 3633 | * ```typescript 3634 | * OrgChart.miniMap.focusStroke = "#039BE5"; 3635 | * ``` 3636 | */ 3637 | focusStroke?: string, 3638 | 3639 | /** 3640 | * The background opacity 3641 | * ```typescript 3642 | * OrgChart.miniMap.opacity = 0.8; 3643 | * ``` 3644 | */ 3645 | opacity?: Number, 3646 | 3647 | /** 3648 | * The miniMap border 3649 | * ```typescript 3650 | * OrgChart.miniMap.border = '2px solid #039BE5'; 3651 | * ``` 3652 | */ 3653 | border?: string, 3654 | 3655 | /** 3656 | * The miniMap width 3657 | * ```typescript 3658 | * OrgChart.miniMap.width = 200; 3659 | * ``` 3660 | */ 3661 | width?: Number, 3662 | 3663 | /** 3664 | * The miniMap height 3665 | * ```typescript 3666 | * OrgChart.miniMap.width = 100; 3667 | * ``` 3668 | */ 3669 | height?: Number, 3670 | 3671 | /** 3672 | * The miniMap padding 3673 | * ```typescript 3674 | * OrgChart.miniMap.padding = 10; 3675 | * ``` 3676 | */ 3677 | padding?: Number, 3678 | 3679 | /** 3680 | * The miniMap position 3681 | * ```typescript 3682 | * OrgChart.miniMap.padding = { 3683 | * top: 'padding', 3684 | * left: 'padding', 3685 | * right: undefined, 3686 | * bottom: undefined 3687 | * } 3688 | * ``` 3689 | */ 3690 | position?: OrgChart.position, 3691 | 3692 | /** 3693 | * Draggable option 3694 | * default option: true 3695 | * ```typescript 3696 | * OrgChart.miniMap.draggable = false; 3697 | * ``` 3698 | */ 3699 | draggable?: boolean 3700 | } 3701 | 3702 | /** 3703 | * MiniMap position 3704 | * ```typescript 3705 | * OrgChart.miniMap.position = { 3706 | * top: 'padding', 3707 | * left: 'padding', 3708 | * right: undefined, 3709 | * bottom: undefined 3710 | * }; 3711 | * ``` 3712 | */ 3713 | interface position { 3714 | top?: string, 3715 | left?: string, 3716 | right?: string, 3717 | bottom?: string 3718 | } 3719 | 3720 | /** 3721 | * Exports to PDF document 3722 | * ```typescript 3723 | * let chart = new OrgChart('#tree', {}); 3724 | * ... 3725 | * chart.exportPDF({ 3726 | * format: "A4" 3727 | * }); 3728 | * ``` 3729 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 3730 | */ 3731 | interface exportOptions { 3732 | margin?: Array, 3733 | padding?: number, 3734 | landscape?: boolean, 3735 | filename?: string, 3736 | scale?: "fit" | number, 3737 | format?: "A1" | "A2" | "A3" | "A4" | "A5" | "A4" | "Letter" | "Legal", 3738 | header?: string, 3739 | footer?: string, 3740 | openInNewTab?: boolean, 3741 | expandChildren?: boolean, 3742 | /** 3743 | * Export parents of nodeId 3744 | */ 3745 | parentLevels?: boolean, 3746 | /** 3747 | * Export children of nodeId 3748 | */ 3749 | childLevels?: boolean, 3750 | min?: boolean, 3751 | nodeId? : number | string 3752 | } 3753 | 3754 | 3755 | 3756 | interface exportPowerPontOptions { 3757 | openInNewTab?: boolean, 3758 | fileName?: string, 3759 | // width?: number, 3760 | // height?: number, 3761 | padding?: number, 3762 | margin?: Array, 3763 | expandChildren?: boolean, 3764 | childLevels?: boolean, 3765 | parentLevels?: boolean, 3766 | min?: boolean, 3767 | pages?: Array<{ 3768 | chartInstance?: OrgChart, 3769 | nodeId?: number | string, 3770 | expandChildren?: boolean, 3771 | childLevels?: boolean, 3772 | parentLevels?: boolean, 3773 | min?: boolean, 3774 | header?: string, 3775 | footer?: string, 3776 | content?: string 3777 | }>, 3778 | format?: "Screen" | "Widescreen" | "Standard", 3779 | header?: string, 3780 | footer?: string 3781 | } 3782 | 3783 | interface exportPDFOptions { 3784 | openInNewTab?: boolean, 3785 | fileName?: string, 3786 | landscape?: boolean, 3787 | // width?: number, 3788 | // height?: number, 3789 | padding?: number, 3790 | margin?: Array, 3791 | expandChildren?: boolean, 3792 | childLevels?: boolean, 3793 | parentLevels?: boolean, 3794 | min?: boolean, 3795 | pages?: Array<{ 3796 | chartInstance?: OrgChart, 3797 | nodeId?: number | string, 3798 | expandChildren?: boolean, 3799 | childLevels?: boolean, 3800 | parentLevels?: boolean, 3801 | min?: boolean, 3802 | header?: string, 3803 | footer?: string, 3804 | content?: string 3805 | }>, 3806 | format?: "A1" | "A2" | "A3" | "A4" | "A5" | "A4" | "Letter" | "Legal", 3807 | header?: string, 3808 | footer?: string 3809 | } 3810 | 3811 | interface exportPNGOptions { 3812 | openInNewTab?: boolean, 3813 | fileName?: string, 3814 | //landscape?: boolean, 3815 | width?: number, 3816 | height?: number, 3817 | padding?: number, 3818 | margin?: Array, 3819 | expandChildren?: boolean, 3820 | childLevels?: boolean, 3821 | parentLevels?: boolean, 3822 | min?: boolean, 3823 | pages?: Array<{ 3824 | chartInstance?: OrgChart, 3825 | nodeId?: number | string, 3826 | expandChildren?: boolean, 3827 | childLevels?: boolean, 3828 | parentLevels?: boolean, 3829 | min?: boolean, 3830 | header?: string, 3831 | footer?: string, 3832 | content?: string 3833 | }>, 3834 | //format?: "A1" | "A2" | "A3" | "A4" | "A5" | "A4" | "Letter" | "Legal", 3835 | header?: string, 3836 | footer?: string 3837 | } 3838 | 3839 | 3840 | 3841 | /** 3842 | * Exports to CSV, XML or JSON options 3843 | * ```typescript 3844 | * document.getElementById('export').addEventListener('click', function () { 3845 | * chart.exportCSV('My.csv'); 3846 | * }); 3847 | * ``` 3848 | * {@link https://balkan.app/OrgChartJS/Docs/Exporting | See doc...} 3849 | */ 3850 | interface exportCSVXMLJSONOptions { 3851 | filename?: string, 3852 | expandChildren?: boolean, 3853 | min?: boolean, 3854 | nodeId? : number | string 3855 | } 3856 | 3857 | /** 3858 | * ```typescript 3859 | * OrgChart.clinkTemplates.myTemplate = Object.assign({}, OrgChart.clinkTemplates.orange); 3860 | * OrgChart.clinkTemplates.myTemplate.label = 3861 | * '{val}'; 3862 | * ``` 3863 | */ 3864 | interface linkTemplate { 3865 | defs?: string, 3866 | link?: string, 3867 | label?: string, 3868 | labelPosition?: string 3869 | } 3870 | 3871 | /** 3872 | * Menu options 3873 | * ```typescript 3874 | * var chart = new OrgChart('#tree', { 3875 | * nodeMenu:{ 3876 | * call: { 3877 | * icon: webcallMeIcon, 3878 | * text: "Call now", 3879 | * onClick: callHandler 3880 | * } 3881 | * } 3882 | * }); 3883 | * ``` 3884 | * {@link https://balkan.app/OrgChartJS/Docs/Menus#yourMenu | See doc...} 3885 | */ 3886 | interface menu { 3887 | [key: string]: { 3888 | text: string, 3889 | icon?: string, 3890 | onClick?: Function 3891 | } 3892 | } 3893 | /** 3894 | * 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. 3895 | * ```typescript 3896 | * var chart = new OrgChart('#tree', { 3897 | * nodeCircleMenu: { 3898 | * editNode: { 3899 | * icon: OrgChart.icon.edit(24, 24, '#aeaeae'), 3900 | * text: "Edit node", 3901 | * color: "white" 3902 | * }, 3903 | * addClink: { 3904 | * icon: OrgChart.icon.link(24, 24, '#aeaeae'), 3905 | * text: "Add C link", 3906 | * color: '#fff', 3907 | * draggable: true 3908 | * } 3909 | * } 3910 | * }); 3911 | * ``` 3912 | * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...} 3913 | */ 3914 | interface circleMenu { 3915 | [key: string]: { 3916 | text: string, 3917 | icon?: string, 3918 | color?: string, 3919 | draggable?: boolean 3920 | } 3921 | } 3922 | 3923 | /** 3924 | * Edit form element 3925 | * ```typescript 3926 | * let chart = new OrgChart('#tree', { 3927 | * editForm: { 3928 | * elements: [ 3929 | * { type: 'textbox', label: 'Full Name', binding: 'Name' }, 3930 | * { type: 'textbox', label: 'Phone number', binding: 'phone' } 3931 | * ] 3932 | * } 3933 | * }); 3934 | * ``` 3935 | * {@link https://balkan.app/OrgChartJS/Docs/Edit | See doc...} 3936 | */ 3937 | interface editFormElement { 3938 | type?: string, 3939 | label?: string, 3940 | binding?: string, 3941 | options?: Array, 3942 | btn?: string, 3943 | vlidators?: { required?: string, email?: string } 3944 | } 3945 | 3946 | /** 3947 | * Defines a Slink or Clink. 3948 | * ```typescript 3949 | * let chart = new OrgChart('#tree', { 3950 | * clinks: [ 3951 | * { from: 4, to: 0, label: 'text' }, 3952 | * { from: 4, to: 5, template: 'blue', label: '4 reports to 3' }, 3953 | * { from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' } 3954 | * ] 3955 | * }); 3956 | * ``` 3957 | */ 3958 | interface link { 3959 | from?: string | number, 3960 | to?: string | number, 3961 | template?: string, 3962 | label?: string 3963 | } 3964 | 3965 | /** 3966 | * @ignore 3967 | */ 3968 | interface backdrop { 3969 | id?: string | number, 3970 | levels?: number, 3971 | color?: string, 3972 | opacity?: number, 3973 | except?: Array 3974 | } 3975 | 3976 | /** 3977 | * Node object that shows a secondary connection 3978 | * ```typescript 3979 | * let chart = new OrgChart('#tree', { 3980 | * dottedLines: [ 3981 | * { from: 5, to: 1 } 3982 | * ] 3983 | * }); 3984 | * ``` 3985 | * {@link https://balkan.app/OrgChartJS/Docs/DottedLine | See doc...} 3986 | */ 3987 | interface dottedLine { 3988 | from?: string | number, 3989 | to?: string | number, 3990 | tags?: Array 3991 | } 3992 | 3993 | /** 3994 | * The orderBy contains the field name and the *desc* value 3995 | * ```typescript 3996 | * let chart = new OrgChart('#tree', { 3997 | * orderBy: [ 3998 | * { field: 'name', desc: false }, 3999 | * { field: 'surname', desc: true }, 4000 | * ] 4001 | * }); 4002 | * ``` 4003 | */ 4004 | interface orderBy { 4005 | field?: string, 4006 | desc?: boolean 4007 | } 4008 | 4009 | /** 4010 | * Contains the move position 4011 | * ```typescript 4012 | * document.getElementById('btn_left').addEventListener('mousedown', function(){ 4013 | * chart.moveStart({ 4014 | * left: true 4015 | * }); 4016 | * }); 4017 | * ``` 4018 | */ 4019 | interface move { 4020 | left?: boolean, 4021 | right?: boolean, 4022 | up?: boolean, 4023 | down?: boolean, 4024 | } 4025 | 4026 | /** 4027 | * Set the chart orientation 4028 | */ 4029 | enum orientation { 4030 | 4031 | /** 4032 | * top orientation (default) 4033 | * OrgChart.orientation.top = 0; 4034 | * ```typescript 4035 | * let chart = new OrgChart('#tree', { 4036 | * orientation: OrgChart.orientation.left, 4037 | * tags: { 4038 | * "tag1": { 4039 | * subTreeConfig: { 4040 | * orientation: OrgChart.orientation.top 4041 | * } 4042 | * } 4043 | * } 4044 | * }); 4045 | * ``` 4046 | */ 4047 | top, 4048 | 4049 | /** 4050 | * Bottom orientation 4051 | * OrgChart.orientation.bottom = 1; 4052 | * ```typescript 4053 | * let chart = new OrgChart('#tree', { 4054 | * orientation: OrgChart.orientation.bottom, 4055 | * }); 4056 | * ``` 4057 | */ 4058 | bottom, 4059 | 4060 | /** 4061 | * Right orientation 4062 | * OrgChart.orientation.right = 2; 4063 | * ```typescript 4064 | * let chart = new OrgChart('#tree', { 4065 | * orientation: OrgChart.orientation.right, 4066 | * }); 4067 | * ``` 4068 | */ 4069 | right, 4070 | 4071 | /** 4072 | * Left orientation 4073 | * OrgChart.orientation.left = 3; 4074 | * ```typescript 4075 | * let chart = new OrgChart('#tree', { 4076 | * orientation: OrgChart.orientation.left, 4077 | * }); 4078 | * ``` 4079 | */ 4080 | left, 4081 | 4082 | /** 4083 | * Top lrft orientation 4084 | * OrgChart.orientation.top_left = 4; 4085 | * ```typescript 4086 | * let chart = new OrgChart('#tree', { 4087 | * orientation: OrgChart.orientation.top_left, 4088 | * }); 4089 | * ``` 4090 | */ 4091 | top_left, 4092 | 4093 | /** 4094 | * Bottom lrft orientation 4095 | * OrgChart.orientation.bottom_left = 5; 4096 | * ```typescript 4097 | * let chart = new OrgChart('#tree', { 4098 | * orientation: OrgChart.orientation.bottom_left, 4099 | * }); 4100 | * ``` 4101 | */ 4102 | bottom_left, 4103 | 4104 | /** 4105 | * Right top orientation 4106 | * OrgChart.orientation.right_top = 6; 4107 | * ```typescript 4108 | * let chart = new OrgChart('#tree', { 4109 | * orientation: OrgChart.orientation.right_top, 4110 | * }); 4111 | * ``` 4112 | */ 4113 | right_top, 4114 | 4115 | /** 4116 | * Left top orientation 4117 | * OrgChart.orientation.left_top = 7; 4118 | * ```typescript 4119 | * let chart = new OrgChart('#tree', { 4120 | * orientation: OrgChart.orientation.left_top, 4121 | * }); 4122 | * ``` 4123 | */ 4124 | left_top 4125 | } 4126 | 4127 | /** 4128 | * Specifies the layout of the chart 4129 | */ 4130 | enum layout { 4131 | 4132 | /** 4133 | * The default layout 4134 | * OrgChart.layout.normal = OrgChart.normal = 0; 4135 | * ```typescript 4136 | * let chart = new OrgChart('#tree', { 4137 | * layout: OrgChart.mixed 4138 | * }); 4139 | * chart.on('node-layout', function(sender, args){ 4140 | * if (args.pnode.id == 100){ 4141 | * args.layout = OrgChart.layout.normal; 4142 | * } 4143 | * }); 4144 | * chart.load(nodes) 4145 | * ``` 4146 | */ 4147 | normal, 4148 | 4149 | /** 4150 | * mixed layout 4151 | * OrgChart.layout.mixed = OrgChart.mixed = 1; 4152 | * ```typescript 4153 | * let chart = new OrgChart('#tree', { 4154 | * layout: OrgChart.layout.mixed 4155 | * }); 4156 | * ``` 4157 | */ 4158 | mixed, 4159 | 4160 | /** 4161 | * tree layout 4162 | * OrgChart.layout.tree = OrgChart.tree = 2; 4163 | * ```typescript 4164 | * let chart = new OrgChart('#tree', { 4165 | * layout: OrgChart.layout.tree 4166 | * }); 4167 | * ``` 4168 | */ 4169 | tree, 4170 | 4171 | /** 4172 | * treeLeftOffset layout 4173 | * OrgChart.layout.treeLeftOffset = OrgChart.treeLeftOffset = 3; 4174 | * ```typescript 4175 | * let chart = new OrgChart('#tree', { 4176 | * layout: OrgChart.layout.treeLeftOffset 4177 | * }); 4178 | * ``` 4179 | */ 4180 | treeLeftOffset, 4181 | 4182 | /** 4183 | * treeRightOffset layout 4184 | * OrgChart.layout.treeRightOffset = OrgChart.treeRightOffset = 4; 4185 | * ```typescript 4186 | * let chart = new OrgChart('#tree', { 4187 | * layout: OrgChart.layout.treeRightOffset 4188 | * }); 4189 | * ``` 4190 | */ 4191 | treeRightOffset, 4192 | 4193 | /** 4194 | * treeLeft layout 4195 | * OrgChart.layout.treeLeft = 5; 4196 | * ```typescript 4197 | * let chart = new OrgChart('#tree', { 4198 | * layout: OrgChart.layout.treeLeft 4199 | * }); 4200 | * ``` 4201 | */ 4202 | treeLeft, 4203 | 4204 | /** 4205 | * treeRight layout 4206 | * OrgChart.layout.treeRight = 6; 4207 | * ```typescript 4208 | * let chart = new OrgChart('#tree', { 4209 | * layout: OrgChart.layout.treeRight 4210 | * }); 4211 | * ``` 4212 | */ 4213 | treeRight, 4214 | 4215 | /** 4216 | * Create a grid layoput authomatically calculating authomatically the columns 4217 | * OrgChart.layout.grid = -1; 4218 | * ```typescript 4219 | * let chart = new OrgChart('#tree', { 4220 | * layout: OrgChart.layout.grid 4221 | * }); 4222 | * ``` 4223 | * [See grid doc page for more details][https://balkan.app/OrgChartJS/Docs/Layout#grid] 4224 | */ 4225 | grid 4226 | } 4227 | 4228 | /** 4229 | * Specifies the alignment of the nodes inside OrgChart JS 4230 | */ 4231 | enum align { 4232 | 4233 | /** 4234 | * Centered 4235 | * ```typescript 4236 | * var chart = new OrgChart('#tree', { 4237 | * align: OrgChart.align.center 4238 | * }); 4239 | * ``` 4240 | */ 4241 | center, 4242 | 4243 | /** 4244 | * According to the orientation option 4245 | * ```typescript 4246 | * let chart = new OrgChart('#tree', { 4247 | * align: OrgChart.align.orientation 4248 | * }); 4249 | * ``` 4250 | */ 4251 | orientation 4252 | } 4253 | 4254 | /** 4255 | * Animations for the transition of the nodes 4256 | * ```typescript 4257 | * let chart = new OrgChart('#tree', { 4258 | * anim: {func: OrgChart.anim.outBack, duration: 500} 4259 | * }); 4260 | * ``` 4261 | */ 4262 | enum anim { 4263 | inPow, 4264 | outPow, 4265 | inOutPow, 4266 | inSin, 4267 | outSin, 4268 | inOutSin, 4269 | inExp, 4270 | outExp, 4271 | inOutExp, 4272 | inCirc, 4273 | outCirc, 4274 | inOutCirc, 4275 | rebound, 4276 | inBack, 4277 | outBack, 4278 | inOutBack, 4279 | impulse, 4280 | expPulse 4281 | } 4282 | 4283 | /** 4284 | * Specifies a scale that match the boundaries 4285 | */ 4286 | enum match { 4287 | 4288 | /** 4289 | * Match height 4290 | * ```typescript 4291 | * let chart = new OrgChart('#tree', { 4292 | * scaleInitial: OrgChart.match.height 4293 | * }); 4294 | * ``` 4295 | */ 4296 | height, 4297 | 4298 | /** 4299 | * Match width 4300 | * ```typescript 4301 | * let chart = new OrgChart('#tree', { 4302 | * scaleInitial: OrgChart.match.width 4303 | * }); 4304 | * ``` 4305 | */ 4306 | width, 4307 | 4308 | /** 4309 | * Match boundary 4310 | * ```typescript 4311 | * let chart = new OrgChart('#tree', { 4312 | * scaleInitial: OrgChart.match.boundary 4313 | * }); 4314 | * ``` 4315 | */ 4316 | boundary 4317 | } 4318 | 4319 | 4320 | /** 4321 | * Add movable functionality 4322 | */ 4323 | enum movable { 4324 | 4325 | /** 4326 | * Moves the node 4327 | * OrgChart.movable.node = 'node'; 4328 | * ```typescript 4329 | * let chart = new OrgChart('#tree', { 4330 | * movable: OrgChart.movable.node 4331 | * }); 4332 | * ``` 4333 | */ 4334 | node, 4335 | 4336 | /** 4337 | * Moves the tree 4338 | * OrgChart.movable.tree = 'tree'; 4339 | * ```typescript 4340 | * let chart = new OrgChart('#tree', { 4341 | * movable: OrgChart.movable.tree 4342 | * }); 4343 | * ``` 4344 | */ 4345 | tree, 4346 | 4347 | /** 4348 | * Detaches the tree 4349 | * OrgChart.movable.detachTree = 'detachTree'; 4350 | * ```typescript 4351 | * let chart = new OrgChart('#tree', { 4352 | * movable: OrgChart.movable.detachTree 4353 | * }); 4354 | * ``` 4355 | */ 4356 | detachTree 4357 | } 4358 | 4359 | /** 4360 | * [Example with all actions](https://code.balkan.app/org-chart-js/which-action-triggers-redraw#JS) 4361 | */ 4362 | enum action { 4363 | 4364 | /** 4365 | * OrgChart.action.update = 7; 4366 | * ```typescript 4367 | * let chart = new OrgChart('#tree', { 4368 | * }); 4369 | * chart.onRedraw(() => { 4370 | * if (chart.manager.action == OrgChart.action.update) { 4371 | * alert("chart updated"); 4372 | * } 4373 | * }); 4374 | * chart.load(nodes) 4375 | * ``` 4376 | */ 4377 | update, 4378 | 4379 | /** 4380 | * OrgChart.action.expand = 0; 4381 | * ```typescript 4382 | * let chart = new OrgChart('#tree', { 4383 | * }); 4384 | * chart.onRedraw(() => { 4385 | * if (chart.manager.action == OrgChart.action.expand) { 4386 | * chart.fit(); 4387 | * } 4388 | * }); 4389 | * chart.load(nodes) 4390 | * ``` 4391 | */ 4392 | expand, 4393 | 4394 | /** 4395 | * OrgChart.action.collapse = 1; 4396 | * ```typescript 4397 | * let chart = new OrgChart('#tree', { 4398 | * }); 4399 | * chart.onRedraw(() => { 4400 | * if (chart.manager.action == OrgChart.action.collapse) { 4401 | * chart.fit(); 4402 | * } 4403 | * }); 4404 | * chart.load(nodes) 4405 | * ``` 4406 | */ 4407 | collapse, 4408 | 4409 | /** 4410 | * OrgChart.action.exporting = 14; 4411 | * ```typescript 4412 | * let chart = new OrgChart('#tree', { 4413 | * }); 4414 | * chart.on("field", function (sender, args) { 4415 | * if (sender.manager.action == OrgChart.action.exporting) { 4416 | * args.value = "hidden"; 4417 | * } 4418 | * }); 4419 | * chart.load(nodes) 4420 | * ``` 4421 | */ 4422 | exporting, 4423 | 4424 | /** 4425 | * Reload/Initialize the chart 4426 | * OrgChart.action.init = 6; 4427 | * ```typescript 4428 | * document.getElementById("btn").addEventListener("click", function () { 4429 | * chart.add({ id: 4, pid: 2, name: "Elliot Patel", title: "Sales" }); 4430 | * chart.draw(OrgChart.action.init); 4431 | * }); 4432 | * ``` 4433 | */ 4434 | init, 4435 | 4436 | /** 4437 | * OrgChart.action.centerNode = 9; 4438 | * ```typescript 4439 | * let chart = new OrgChart('#tree', { 4440 | * }); 4441 | * chart.onInit(() => { 4442 | * chart.center(2); 4443 | * console.log(chart.manager.action); 4444 | * }); 4445 | * chart.load(nodes) 4446 | * ``` 4447 | */ 4448 | centerNode, 4449 | 4450 | /** 4451 | * @ignore 4452 | */ 4453 | insert, 4454 | 4455 | /** 4456 | * @ignore 4457 | */ 4458 | maximize, 4459 | 4460 | /** 4461 | * @ignore 4462 | */ 4463 | minimize, 4464 | 4465 | /** 4466 | * Opens edit form on node click 4467 | * OrgChart.action.edit = 1; 4468 | * ```typescript 4469 | * let chart = new OrgChart('#tree', { 4470 | * nodeMouseClick: OrgChart.action.edit 4471 | * }); 4472 | * ``` 4473 | */ 4474 | edit, 4475 | 4476 | /** 4477 | * Opens the details form 4478 | * OrgChart.action.details = 13; 4479 | * ```typescript 4480 | * let chart = new OrgChart('#tree', { 4481 | * nodeMouseClick: OrgChart.action.edit // default value 4482 | * }); 4483 | * chart.onNodeClick(function (args) { 4484 | * if (args.node.templateName == "group") 4485 | * chart.config.nodeMouseClick = OrgChart.action.pan; 4486 | * esle 4487 | * chart.config.nodeMouseClick = OrgChart.action.details; 4488 | * }); 4489 | * ``` 4490 | */ 4491 | details, 4492 | 4493 | /** 4494 | * Expand/Collapse on node click 4495 | * OrgChart.action.expandCollapse = 501; 4496 | * ```typescript 4497 | * let chart = new OrgChart('#tree', { 4498 | * odeMouseClick: OrgChart.action.expandCollapse, 4499 | * }); 4500 | * ``` 4501 | */ 4502 | expandCollapse, 4503 | 4504 | /** 4505 | * Expand/Collapse on node click 4506 | * OrgChart.action.expandCollapse = 501; 4507 | * ```typescript 4508 | * let chart = new OrgChart('#tree', { 4509 | * odeMouseClick: OrgChart.action.expandCollapse, 4510 | * }); 4511 | * ``` 4512 | */ 4513 | pan, 4514 | 4515 | /** 4516 | * Set mouse scroll to zoom 4517 | * OrgChart.action.zoom = 2; 4518 | * ```typescript 4519 | * let chart = new OrgChart('#tree', { 4520 | * mouseScrool: OrgChart.action.zoom, 4521 | * }); 4522 | * ``` 4523 | */ 4524 | zoom, 4525 | 4526 | /** 4527 | * Set Ctrl + mouse scroll to zoom 4528 | * OrgChart.action.ctrlZoom = 22; 4529 | * ```typescript 4530 | * let chart = new OrgChart('#tree', { 4531 | * mouseScrool: OrgChart.action.ctrlZoom, 4532 | * }); 4533 | * ``` 4534 | */ 4535 | ctrlZoom, 4536 | 4537 | /** 4538 | * Set mouse scroll to horizontal scroll 4539 | * OrgChart.action.xScroll = 3; 4540 | * ```typescript 4541 | * let chart = new OrgChart('#tree', { 4542 | * mouseScrool: OrgChart.action.xScroll, 4543 | * }); 4544 | * ``` 4545 | */ 4546 | xScroll, 4547 | 4548 | /** 4549 | * Set mouse scroll to vertical scroll 4550 | * OrgChart.action.yScroll = 4; 4551 | * ```typescript 4552 | * let chart = new OrgChart('#tree', { 4553 | * mouseScrool: OrgChart.action.yScroll, 4554 | * }); 4555 | * ``` 4556 | */ 4557 | yScroll, 4558 | 4559 | /** 4560 | * Navigate with the mouse: 4561 | * Scroll up/down 4562 | * Press Shift key to scroll left/right 4563 | * Press Ctrl key to zoom with mouse scroll button 4564 | * On Apple Magic Mouse or Logitech G502 you can scroll left/right/up/down without pressing the Shift key 4565 | * OrgChart.action.scroll = 41; 4566 | * ```typescript 4567 | * let chart = new OrgChart('#tree', { 4568 | * mouseScrool: OrgChart.action.scroll, 4569 | * }); 4570 | * ``` 4571 | */ 4572 | scroll, 4573 | 4574 | /** 4575 | * Do nothing on mouse scroll 4576 | * OrgChart.action.none = 5; 4577 | * ```typescript 4578 | * let chart = new OrgChart('#tree', { 4579 | * odeMouseClick: OrgChart.action.nonde, 4580 | * }); 4581 | * ``` 4582 | */ 4583 | none 4584 | } 4585 | 4586 | 4587 | 4588 | 4589 | 4590 | 4591 | interface options { 4592 | /** 4593 | * Enables or disables the browser events handlers like click, pan, zoom, pinch, etc. Default value - *true*. 4594 | * ```typescript 4595 | * var chart = new OrgChart('#tree', { 4596 | * interactive: false 4597 | * }); 4598 | * ``` 4599 | */ 4600 | interactive?: boolean, 4601 | 4602 | /** 4603 | * Color mode. Default value - *light*. 4604 | * ```typescript 4605 | * var chart = new OrgChart('#tree', { 4606 | * mode: "dark" 4607 | * }); 4608 | * ``` 4609 | */ 4610 | mode?: "dark" | "light", 4611 | /** 4612 | * 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*. 4613 | * The default value is *auto* 4614 | * ```typescript 4615 | * var chart = new OrgChart('#tree', { 4616 | * lazyLoading: false 4617 | * }); 4618 | * ``` 4619 | */ 4620 | lazyLoading?: boolean | string, 4621 | 4622 | 4623 | 4624 | /** 4625 | * Enables advanced search. Default value is true. 4626 | * ```typescript 4627 | * var chart = new OrgChart('#tree', { 4628 | * enableSearch: false 4629 | * }); 4630 | * ``` 4631 | */ 4632 | enableSearch?: boolean, 4633 | 4634 | 4635 | /** 4636 | * Enables artificial intelligence. Default value is false. 4637 | * ```typescript 4638 | * var chart = new OrgChart('#tree', { 4639 | * enableAI: false 4640 | * }); 4641 | * ``` 4642 | */ 4643 | enableAI?: boolean, 4644 | 4645 | /** 4646 | * You can disable chart pan. Default value - *true*. 4647 | * ```typescript 4648 | * var chart = new OrgChart('#tree', { 4649 | * enablePan: false 4650 | * }); 4651 | * ``` 4652 | */ 4653 | enablePan?: boolean, 4654 | 4655 | /** 4656 | * Enable touch instead of mouse for particular devices with touchscreen/touchpad/trackpad. Default value - *false*. 4657 | * ```typescript 4658 | * var chart = new OrgChart('#tree', { 4659 | * enableTouch: true 4660 | * }); 4661 | * ``` 4662 | */ 4663 | 4664 | enableTouch?: boolean, 4665 | /** 4666 | * Enable keyboard navigation. Use "f" for find, arrows and space to navigate in the chart. Default value - *false*. 4667 | * ```typescript 4668 | * var chart = new OrgChart('#tree', { 4669 | * keyNavigation: true 4670 | * }); 4671 | * var chart = new OrgChart('#tree', { 4672 | * keyNavigation: { focusId: 5 } 4673 | * }); 4674 | * ``` 4675 | * {@link https://balkan.app/OrgChartJS/Docs/KeyNavigation | See doc...} 4676 | */ 4677 | keyNavigation?: boolean | OrgChart.keyNavigation, 4678 | /** 4679 | * Shows mini map over the expanded tree. Default value - *false*. 4680 | * ```typescript 4681 | * var chart = new OrgChart('#tree', { 4682 | * miniMap: true 4683 | * }); 4684 | * ``` 4685 | */ 4686 | miniMap?: boolean, 4687 | /** 4688 | * Enables edit, add, remove and other node operations. Also you can define your own node operation. 4689 | * ```typescript 4690 | * var chart = new OrgChart('#tree', { 4691 | * nodeMenu:{ 4692 | * details: {text:"Details"}, 4693 | * edit: {text:"Edit"}, 4694 | * add: {text:"Add"}, 4695 | * remove: {text:"Remove"}, 4696 | * myMenuItem: {text:"My node menu Item", onClick: function {}} 4697 | * } 4698 | * }); 4699 | * ``` 4700 | * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...} 4701 | */ 4702 | nodeMenu?: OrgChart.menu; 4703 | /** 4704 | * 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. 4705 | * ```typescript 4706 | * var chart = new OrgChart('#tree', { 4707 | * nodeCircleMenu: { 4708 | * editNode: { 4709 | * icon: OrgChart.icon.edit(24, 24, '#aeaeae'), 4710 | * text: "Edit node", 4711 | * color: "white" 4712 | * }, 4713 | * addClink: { 4714 | * icon: OrgChart.icon.link(24, 24, '#aeaeae'), 4715 | * text: "Add C link", 4716 | * color: '#fff', 4717 | * draggable: true 4718 | * } 4719 | * } 4720 | * }); 4721 | * ``` 4722 | * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...} 4723 | */ 4724 | nodeCircleMenu?: OrgChart.circleMenu, 4725 | /** 4726 | * Customizable context menu. Also you can define your own node operation. 4727 | * ```typescript 4728 | * var chart = new OrgChart('#tree', { 4729 | * nodeContextMenu:{ 4730 | * details: {text:"Details"}, 4731 | * edit: {text:"Edit"}, 4732 | * add: {text:"Add"}, 4733 | * remove: {text:"Remove"} 4734 | * myMenuItem: {text:"My node menu Item", onClick: function {}} 4735 | * } 4736 | * }); 4737 | * ``` 4738 | * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...} 4739 | */ 4740 | nodeContextMenu?: OrgChart.menu, 4741 | /** 4742 | * Enables export to csv, export to svg and other OrgChart operations. Also you can define your own OrgChart operation. 4743 | * ```typescript 4744 | * var chart = new OrgChart('#tree', { 4745 | * menu:{ 4746 | * svg: { text: "Export SVG" }, 4747 | * csv: { text: "Export CSV" } 4748 | * myMenuItem: {text:"My node menu Item", onClick: function {}} 4749 | * } 4750 | * }); 4751 | * ``` 4752 | * {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...} 4753 | */ 4754 | menu?: OrgChart.menu, 4755 | 4756 | /** 4757 | * Array of tools called by the AI 4758 | * ```typescript 4759 | * var chart = new OrgChart('#tree', { 4760 | * aiChatTools: [{ 4761 | * functionName: 'fit', 4762 | * functionDescription: 'Fit chart to the screen.', 4763 | * }] 4764 | * }); 4765 | * ``` 4766 | * {@link https://balkan.app/OrgChartJS/Docs/AI | See doc...} 4767 | */ 4768 | aiChatTools?: Array, 4769 | /** 4770 | * Shows a toolbar 4771 | * 4772 | * The toolbar options allow you to change the layout, zoom in/out, expand all nodes, etc. 4773 | * ```typescript 4774 | * var chart = new OrgChart('#tree', { 4775 | * toolbar: { 4776 | * layout: true, 4777 | * zoom: true, 4778 | * fit: true, 4779 | * expandAll: false, 4780 | * fullScreen: true 4781 | * }, 4782 | * }); 4783 | * ``` 4784 | */ 4785 | toolbar?: OrgChart.toolbar, 4786 | /** 4787 | * Stops the chart locking to the top of the screen once you move it. 4788 | * ```typescript 4789 | * var chart = new OrgChart('#tree', { 4790 | * sticky: false 4791 | * }); 4792 | * ``` 4793 | */ 4794 | sticky?: boolean, 4795 | /** 4796 | * nodeMouseClick can accept the following values: 4797 | * - OrgChart.action.edit - will open the edit view for the clicked node on the right hand side 4798 | * - 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. 4799 | * - OrgChart.action.expandCollapse - will expand or collapse the children nodes 4800 | * - OrgChart.action.none - do nothing on node click event 4801 | * - OrgChart.action.pan - allows you to move the chart in any direction 4802 | * 4803 | * Default value - *OrgChart.action.details* 4804 | * ```typescript 4805 | * var chart = new OrgChart('#tree', { 4806 | * nodeMouseClick: OrgChart.action.edit 4807 | * }); 4808 | * ``` 4809 | */ 4810 | nodeMouseClick?: OrgChart.action, 4811 | /** 4812 | * nodeMouseDbClick can accept the following values: 4813 | * - OrgChart.action.edit - will open the edit view for the clicked node on the right hand side 4814 | * - 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 4815 | * - OrgChart.action.expandCollapse - will expand or collapse the children nodes 4816 | * - OrgChart.action.none - do nothing on node click event 4817 | * 4818 | * Default value - *OrgChart.action.none* 4819 | * ```typescript 4820 | * var chart = new OrgChart('#tree', { 4821 | * nodeMouseDbClick: OrgChart.action.edit 4822 | * }); 4823 | * ``` 4824 | */ 4825 | nodeMouseDbClick?: OrgChart.action, 4826 | /** 4827 | * mouseScrool can accept the following values: 4828 | * - OrgChart.action.zoom - will zoom in/out on mouse scroll 4829 | * - OrgChart.action.ctrlZoom - will zoom in/out on mouse scroll and ctrl button is pressed 4830 | * - OrgChart.action.xScroll - left/right move of the chart on mouse scroll 4831 | * - OrgChart.action.yScroll - up/down move of the chart on mouse scroll 4832 | * - OrgChart.action.none - do nothing on mouse scroll 4833 | * 4834 | * Default value - *OrgChart.action.zoom* 4835 | * ```typescript 4836 | * var chart = new OrgChart('#tree', { 4837 | * mouseScrool: OrgChart.action.ctrlZoom 4838 | * }); 4839 | * ``` 4840 | */ 4841 | mouseScrool?: OrgChart.action, 4842 | /** 4843 | * Shows horizontal scrollbar. Default value - *false*. 4844 | * ```typescript 4845 | * var chart = new OrgChart('#tree', { 4846 | * showXScroll: true 4847 | * }); 4848 | * ``` 4849 | */ 4850 | showXScroll?: boolean , 4851 | /** 4852 | * movable node, move the node anywhere on the canvas 4853 | * ```typescript 4854 | * let chart = new OrgChart('#tree', { 4855 | * movable: OrgChart.movable.node, 4856 | * // movable: OrgChart.movable.tree, 4857 | * // movable: OrgChart.movable.detachTree, 4858 | * }); 4859 | * ``` 4860 | */ 4861 | movable?: OrgChart.movable, 4862 | /** 4863 | * Shows vertical scrollbar. Default value - *false*. 4864 | * ```typescript 4865 | * var chart = new OrgChart('#tree', { 4866 | * showYScroll: true 4867 | * }); 4868 | * ``` 4869 | */ 4870 | showYScroll?: boolean, 4871 | /** 4872 | * Set template if you want to change the appearance of the chart. Org Chart JS comes with number of build-in templates: 4873 | * - ana 4874 | * - ula 4875 | * - olivia 4876 | * - belinda 4877 | * - rony 4878 | * - mery 4879 | * - polina 4880 | * - mila 4881 | * - diva 4882 | * - base 4883 | * - isla 4884 | * - deborah 4885 | * 4886 | * Default value - *ana*. 4887 | * ```typescript 4888 | * var chart = new OrgChart('#tree', { 4889 | * template: 'olivia' 4890 | * }); 4891 | * ``` 4892 | * {@link https://balkan.app/OrgChartJS/Docs/PredefinedTemplates | See doc...} 4893 | */ 4894 | template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | string, 4895 | /** 4896 | * With tags option you can: 4897 | * - Set a specific template for tagged node/s {@link https://balkan.app/OrgChartJS/Docs/MultipleTemplates | See doc...} 4898 | * - Set node as assistant {@link https://balkan.app/OrgChartJS/Docs/Assistant | See doc...} 4899 | * - Change node menu, circle menu and context menu items for tagged node/s {@link https://balkan.app/OrgChartJS/Docs/Menus | See doc...} 4900 | * - Set the node level {@link https://balkan.app/OrgChartJS/Demos/SubLevels | See demo...} 4901 | * - Set specific options for sub trees like layout templates etc {@link https://balkan.app/OrgChartJS/Docs/SubTrees | See doc...} 4902 | * * - Set specific options for sub trees like layout templates, etc. {@link https://balkan.app/OrgChartJS/Docs/SubTrees | See doc...} 4903 | * - Set custom CSS, for example node color, field color, etc. {@link https://balkan.app/OrgChartJS/Docs/CSSCustomization | See CSS doc page...} 4904 | * - {@link https://balkan.app/OrgChartJS/Docs/Tags | See Tags doc page...} 4905 | * ```typescript 4906 | * var chart = new OrgChart('#tree', { 4907 | * tags: { 4908 | * myTag: {template: 'olivia'} 4909 | * }, 4910 | * nodes: [{id: 1}, {id: 2, tags: ['myTag']}] 4911 | * }); 4912 | * ``` 4913 | */ 4914 | tags?: { 4915 | [key: string]: { 4916 | template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | string, 4917 | subLevels?: number, 4918 | nodeMenu?: OrgChart.menu, 4919 | nodeCircleMenu?: OrgChart.circleMenu, 4920 | nodeContextMenu?: OrgChart.menu, 4921 | subTreeConfig?: { 4922 | orientation?: OrgChart.orientation, 4923 | levelSeparation?: number, 4924 | mixedHierarchyNodesSeparation?: number, 4925 | subtreeSeparation?: number, 4926 | siblingSeparation?: number, 4927 | layout?: OrgChart.layout | number, 4928 | columns?: number, 4929 | collapse?: { 4930 | level?: number, 4931 | allChildren?: boolean 4932 | } 4933 | } 4934 | }; 4935 | }, 4936 | /** 4937 | * Minimize/Maximize node. The template has to have min defined. Default value - *false*. 4938 | * ```typescript 4939 | * var chart = new OrgChart('#tree', { 4940 | * min: true 4941 | * }); 4942 | * ``` 4943 | * {@link https://balkan.app/OrgChartJS/Docs/MinMax | See doc...} 4944 | */ 4945 | min?: boolean, 4946 | /** 4947 | * Node binding in Org Chart JS maps node data to node template parameters. 4948 | * ```typescript 4949 | * var chart = new OrgChart('#tree', { 4950 | * nodeBinding: { 4951 | * field_0: "name" 4952 | * }, 4953 | * nodes: [ 4954 | * { id: 1, name: "Amber McKenzie" } 4955 | * ] 4956 | * }); 4957 | * ``` 4958 | */ 4959 | nodeBinding?: { [key: string]: string }, 4960 | /** 4961 | * Link binding in Org Chart JS maps node data to link template parameters. 4962 | * ```typescript 4963 | * var chart = new OrgChart('#tree', { 4964 | * linkBinding: { 4965 | * link_field_0: "createdAt" 4966 | * }, 4967 | * nodes: [ 4968 | * { id: "1", name: "Amber McKenzie" }, 4969 | * { id: "2", pid: "1", createdAt: "Since 08/08/2018" }, 4970 | * { id: "3", pid: "1", createdAt: "Since 05/04/2018" } 4971 | * ] 4972 | * }); 4973 | * ``` 4974 | * {@link https://balkan.app/OrgChartJS/Docs/Link | See doc...} 4975 | */ 4976 | linkBinding?: { [key: string]: string }, 4977 | /** 4978 | * Search by the fields defined in searchFields. 4979 | * ```typescript 4980 | * var chart = new OrgChart('#tree', { 4981 | * searchFields: ["name", "title", etc...] 4982 | * }); 4983 | * ``` 4984 | * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...} 4985 | */ 4986 | searchFields?: Array, 4987 | /** 4988 | * Displays a field in the search result. 4989 | * ```typescript 4990 | * var chart = new OrgChart('#tree', { 4991 | * searchDisplayField: "name" 4992 | * }); 4993 | * ``` 4994 | * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...} 4995 | */ 4996 | searchDisplayField?: string, 4997 | /** 4998 | * Search by weight of the fields. 4999 | * ```typescript 5000 | * var chart = new OrgChart('#tree', { 5001 | * searchFieldsWeight: { 5002 | * "Name": 100, //percent 5003 | * "Title": 20 //percent 5004 | * } 5005 | * }); 5006 | * ``` 5007 | * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...} 5008 | */ 5009 | searchFieldsWeight?: { [key: string]: number }, 5010 | /** 5011 | * Search in field with abbreviation. 5012 | * ```typescript 5013 | * var chart = new OrgChart('#tree', { 5014 | * searchFieldsAbbreviation: { 5015 | * "n": "name", 5016 | * "a": "My Address" 5017 | * } 5018 | * }); 5019 | * ``` 5020 | * {@link https://balkan.app/OrgChartJS/Docs/Search | See doc...} 5021 | */ 5022 | searchFieldsAbbreviation?: { [key: string]: string }, 5023 | /** 5024 | * 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. 5025 | * - id - unique identifier, it clould be integer or string 5026 | * - pid - is the parent id 5027 | * - stpid - subtree parent id 5028 | * - ppid - parent partner id 5029 | * - tags - array of strings 5030 | * ```typescript 5031 | * var chart = new OrgChart('#tree', { 5032 | * nodes: [ 5033 | * { id: 1 }, 5034 | * { id: 2, pid: 1, tags: ["Sales"] }, 5035 | * { id: 3, stpid: 2 } 5036 | * ] 5037 | * }); 5038 | * ``` 5039 | */ 5040 | nodes?: Array, 5041 | /** 5042 | * Adds curved link. 5043 | * ```typescript 5044 | * let chart = new OrgChart('#tree', { 5045 | * clinks: [ 5046 | * { from: 4, to: 0, label: 'text'}, 5047 | * { from: 4, to: 5, template: 'blue', label: '4 reports to 3' }, 5048 | * { from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' } 5049 | * ] 5050 | * }); 5051 | * ``` 5052 | */ 5053 | clinks?: Array, 5054 | /** 5055 | * Adds second link. 5056 | * ```typescript 5057 | * let chart = new OrgChart('#tree', { 5058 | * slinks: [ 5059 | * { from: 4, to: 0, label: 'text' }, 5060 | * { from: 4, to: 5, template: 'blue', label: '4 reports to 3' }, 5061 | * { from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' } 5062 | * ] 5063 | * }); 5064 | * ``` 5065 | */ 5066 | slinks?: Array, 5067 | 5068 | /** 5069 | * @ignore 5070 | */ 5071 | backdrops?: Array, 5072 | 5073 | 5074 | /** 5075 | * Adds dotted line. 5076 | * ```typescript 5077 | * var chart = new OrgChart('#tree', { 5078 | * dottedLines: [ 5079 | * {from: 6, to: 1 } 5080 | * ] 5081 | * }); 5082 | * ``` 5083 | */ 5084 | dottedLines?: Array, 5085 | 5086 | /** 5087 | * Adds group dotted line. 5088 | * ```typescript 5089 | * var chart = new OrgChart('#tree', { 5090 | * groupDottedLines: [ 5091 | * {from: 6, to: 1 } 5092 | * ] 5093 | * }); 5094 | * ``` 5095 | */ 5096 | groupDottedLines?: Array, 5097 | 5098 | /** 5099 | * The gap between each level. Default value - *60* 5100 | * ```typescript 5101 | * var chart = new OrgChart('#tree', { 5102 | * levelSeparation: 50 5103 | * }); 5104 | * ``` 5105 | */ 5106 | levelSeparation?: number, 5107 | /** 5108 | * The gap between nodes in a subtree. Default value - *20* 5109 | * ```typescript 5110 | * var chart = new OrgChart('#tree', { 5111 | * siblingSeparation: 50 5112 | * }); 5113 | * ``` 5114 | */ 5115 | siblingSeparation?: number, 5116 | /** 5117 | * The padding between the node and the backdrop. Default value - *15* 5118 | * ```typescript 5119 | * var chart = new OrgChart('#tree', { 5120 | * backdropSeparation: 15 5121 | * }); 5122 | * ``` 5123 | */ 5124 | backdropSeparation?: number, 5125 | /** 5126 | * The gap between subtrees. Default value - *40* 5127 | * ```typescript 5128 | * var chart = new OrgChart('#tree', { 5129 | * subtreeSeparation: 50 5130 | * }); 5131 | * ``` 5132 | */ 5133 | subtreeSeparation?: number, 5134 | /** 5135 | * The gap between nodes in vertical layout. Default value - *20* 5136 | * ```typescript 5137 | * var chart = new OrgChart('#tree', { 5138 | * mixedHierarchyNodesSeparation: 5 5139 | * }); 5140 | * ``` 5141 | */ 5142 | mixedHierarchyNodesSeparation?: number, 5143 | /** 5144 | * Set the assistant separation value. Default value - *100* 5145 | * ```typescript 5146 | * var chart = new OrgChart('#tree', { 5147 | * assistantSeparation: 150 5148 | * }); 5149 | * ``` 5150 | */ 5151 | assistantSeparation?: number, 5152 | /** 5153 | * Minimum gap between partner and node with partners. Default value - *50* 5154 | * ```typescript 5155 | * var chart = new OrgChart('#tree', { 5156 | * minPartnerSeparation: 100 5157 | * }); 5158 | * ``` 5159 | */ 5160 | minPartnerSeparation?: number, 5161 | /** 5162 | * Gap between partner links. Default value - *20* 5163 | * ```typescript 5164 | * var chart = new OrgChart('#tree', { 5165 | * partnerChildrenSplitSeparation: 50 5166 | * }); 5167 | * ``` 5168 | */ 5169 | partnerChildrenSplitSeparation?: number, 5170 | /** 5171 | * Gap between partners. Default value - *15* 5172 | * ```typescript 5173 | * var chart = new OrgChart('#tree', { 5174 | * partnerNodeSeparation: 30 5175 | * }); 5176 | * ``` 5177 | */ 5178 | partnerNodeSeparation?: number, 5179 | /** 5180 | * The number of colums if the chart has multiple root nodes. Default value - *10* 5181 | * ```typescript 5182 | * var chart = new OrgChart('#tree', { 5183 | * columns: 1 5184 | * }); 5185 | * ``` 5186 | */ 5187 | columns?: number, 5188 | /** 5189 | * The padding option sets the padding area on all four sides of the OrgChart. Default value - *30* 5190 | * ```typescript 5191 | * var chart = new OrgChart('#tree', { 5192 | * padding: 20 5193 | * }); 5194 | * ``` 5195 | */ 5196 | padding?: number, 5197 | /** 5198 | * Specifies the orientation of the Org Chart JS. could accept one of the following values: 5199 | * - OrgChart.orientation.top 5200 | * - OrgChart.orientation.bottom 5201 | * - OrgChart.orientation.right 5202 | * - OrgChart.orientation.left 5203 | * - OrgChart.orientation.top_left 5204 | * - OrgChart.orientation.bottom_left 5205 | * - OrgChart.orientation.right_top 5206 | * - OrgChart.orientation.left_top 5207 | * 5208 | * Default value - *OrgChart.orientation.top* 5209 | * ```typescript 5210 | * var chart = new OrgChart('#tree', { 5211 | * orientation: OrgChart.orientation.bottom 5212 | * }); 5213 | * ``` 5214 | */ 5215 | orientation?: OrgChart.orientation, 5216 | /** 5217 | * Sets the layout algoritm: 5218 | * - OrgChart.layout.normal 5219 | * - OrgChart.layout.mixed 5220 | * - OrgChart.layout.tree 5221 | * - OrgChart.layout.treeLeftOffset 5222 | * - OrgChart.layout.treeRightOffset 5223 | * - OrgChart.layout.treeLeft 5224 | * - OrgChart.layout.treeRight 5225 | * - OrgChart.layout.grid 5226 | * 5227 | * Default value - *OrgChart.layout.normal* 5228 | * ```typescript 5229 | * var chart = new OrgChart('#tree', { 5230 | * layout: OrgChart.layout.mixed 5231 | * }); 5232 | * ``` 5233 | */ 5234 | layout?: OrgChart.layout | number, 5235 | /** 5236 | * Sets the maximum number of columns in grid layout, it has to be even nymber or 'dynamic' string 5237 | * The default id 'dynamic', that means that the maximum colomn numbers are dinamicly calculated 5238 | * ```typescript 5239 | * let chart = new OrgChart('#tree', { 5240 | * layoutGridColumns: 10, 5241 | * }); 5242 | * ``` 5243 | */ 5244 | layoutGridColumns?: string | number, 5245 | /** 5246 | * The scale factor determines what fraction of the entire scale is visible at one time. 5247 | * - OrgChart.match.height 5248 | * - OrgChart.match.width 5249 | * - OrgChart.match.boundary 5250 | * - [number] 5251 | * 5252 | * Default value - *1* 5253 | * ```typescript 5254 | * var chart = new OrgChart('#tree', { 5255 | * scaleInitial: OrgChart.match.boundary 5256 | * }); 5257 | * ``` 5258 | * {@link https://balkan.app/OrgChartJS/Docs/Layout | See doc...} 5259 | */ 5260 | scaleInitial?: number | OrgChart.match, 5261 | /** 5262 | * Determines the minimum scale factor. Default value - *0.1* 5263 | * ```typescript 5264 | * var chart = new OrgChart('#tree', { 5265 | * scaleMin: 0.2 5266 | * }); 5267 | * ``` 5268 | */ 5269 | scaleMin?: number, 5270 | /** 5271 | * Determines the naximum scale factor. Default value - *5* 5272 | * ```typescript 5273 | * var chart = new OrgChart('#tree', { 5274 | * scaleMax: 10 5275 | * }); 5276 | * ``` 5277 | */ 5278 | scaleMax?: number, 5279 | /** 5280 | * 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* 5281 | * ```typescript 5282 | * var chart = new OrgChart('#tree', { 5283 | * orderBy: "orderId", 5284 | * nodes: [ 5285 | * { id: 10, pid: 1, orderId: 2 }, 5286 | * { id: 11, pid: 1, orderId: 1 } 5287 | * ] 5288 | * }); 5289 | * ``` 5290 | * ```typescript 5291 | * var chart = new OrgChart('#tree', { 5292 | * orderBy: [{field: "orderId", desc: true}], 5293 | * nodes: [ 5294 | * { id: 10, pid: 1, orderId: 2 }, 5295 | * { id: 11, pid: 1, orderId: 1 } 5296 | * ] 5297 | * }); 5298 | * ``` 5299 | */ 5300 | orderBy?: string | Array | OrgChart.orderBy | Array, 5301 | /** 5302 | * Filter the OrgChart by the specified fields. 5303 | * ```typescript 5304 | * var chart = new OrgChart('#tree', { 5305 | * filterBy: 'all' 5306 | * }); 5307 | * ``` 5308 | * ```typescript 5309 | * var chart = new OrgChart('#tree', { 5310 | * filterBy: ['country', 'title'] 5311 | * }); 5312 | * ``` 5313 | * ```typescript 5314 | * var chart = new OrgChart('#tree', { 5315 | * filterBy: { 5316 | * name: { 'name 2': { checked: false, text: 'My text 2'} }, 5317 | * title: {} 5318 | * } 5319 | * }); 5320 | * ``` 5321 | */ 5322 | filterBy?: string | Array | {[key: string]: { [key: string] : { 5323 | checked: boolean, 5324 | text?: string 5325 | } }}, 5326 | /** 5327 | * ```typescript 5328 | * let chart = new OrgChart('#tree', { 5329 | * editUI: new editForm(), 5330 | * }); 5331 | * ``` 5332 | * [Go to edit doc page for more details](https://balkan.app/OrgChartJS/Docs/Edit#custom) 5333 | */ 5334 | editUI?: OrgChart.editUI, 5335 | /** 5336 | * @ignore 5337 | */ 5338 | aiUI?: OrgChart.aiUI, 5339 | /** 5340 | * @ignore 5341 | */ 5342 | searchUI?: OrgChart.searchUI, 5343 | /** 5344 | * @ignore 5345 | */ 5346 | filterUI?: OrgChart.filterUI, 5347 | /** 5348 | * @ignore 5349 | */ 5350 | xScrollUI?: OrgChart.xScrollUI, 5351 | /** 5352 | * @ignore 5353 | */ 5354 | yScrollUI?: OrgChart.yScrollUI, 5355 | /** 5356 | * @ignore 5357 | */ 5358 | nodeMenuUI?: OrgChart.menuUI, 5359 | /** 5360 | * @ignore 5361 | */ 5362 | powerPointPreviewUI?: OrgChart.powerPointPreviewUI, 5363 | 5364 | /** 5365 | * @ignore 5366 | */ 5367 | pdfPreviewUI?: OrgChart.pdfPreviewUI, 5368 | 5369 | /** 5370 | * @ignore 5371 | */ 5372 | pngPreviewUI?: OrgChart.pngPreviewUI, 5373 | 5374 | /** 5375 | * @ignore 5376 | */ 5377 | nodeCircleMenuUI?: OrgChart.circleMenuUI, 5378 | /** 5379 | * @ignore 5380 | */ 5381 | nodeContextMenuUI?: OrgChart.menuUI, 5382 | /** 5383 | * @ignore 5384 | */ 5385 | toolbarUI?: OrgChart.toolbarUI, 5386 | /** 5387 | * @ignore 5388 | */ 5389 | notifierUI?: any, 5390 | /** 5391 | * @ignore 5392 | */ 5393 | menuUI?: OrgChart.menuUI, 5394 | /** 5395 | * @ignore 5396 | */ 5397 | undoRedoUI?: OrgChart.undoRedoUI, 5398 | /** 5399 | * @ignore 5400 | */ 5401 | UI?: any, 5402 | /** 5403 | * The URL to the export server. Default value - *https://balkan.app/export* 5404 | * ```typescript 5405 | * var chart = new OrgChart('#tree', { 5406 | * exportUrl: "https://balkan.app/export" 5407 | * }); 5408 | * ``` 5409 | */ 5410 | exportUrl?: string, 5411 | 5412 | /** 5413 | * The URL to the export server. Default value - *https://serverjs.balkan.app* 5414 | * ```typescript 5415 | * var chart = new OrgChart('#tree', { 5416 | * serverUrl: "https://myDomain.com" 5417 | * }); 5418 | * ``` 5419 | */ 5420 | serverUrl?: string, 5421 | /** 5422 | * The align option specifies the alignment of the nodes inside Org Chart JS. 5423 | * - OrgChart.align.center - centered 5424 | * - OrgChart.align.orientation - according to the orientation option 5425 | * 5426 | * Default value - *OrgChart.align.center* 5427 | * ```typescript 5428 | * var chart = new OrgChart('#tree', { 5429 | * align: OrgChart.align.orientation 5430 | * }); 5431 | * ``` 5432 | */ 5433 | align?: OrgChart.align | number, 5434 | /** 5435 | * Can be used to control the transition of the nodes on expand/collapse operation. Default value - *func: OrgChart.anim.outPow, duration: 200* 5436 | * ```typescript 5437 | * var chart = new OrgChart('#tree', { 5438 | * anim: {func: OrgChart.anim.outBack, duration: 500} 5439 | * }); 5440 | * ``` 5441 | */ 5442 | anim?: { 5443 | /** 5444 | * defines how long time an animation should take to complete 5445 | */ 5446 | func?: OrgChart.anim, 5447 | /** 5448 | * Easing functions specify the speed at which an animation progresses at different points within the animation. 5449 | */ 5450 | duration?: number 5451 | }, 5452 | /** 5453 | * Can be used to control the zooming sensitivity. Default value - *speed: 120, smooth: 12* 5454 | * ```typescript 5455 | * var chart = new OrgChart('#tree', { 5456 | * zoom: {speed: 130, smooth: 10} 5457 | * }); 5458 | * ``` 5459 | */ 5460 | zoom?: { 5461 | speed?: number, 5462 | smooth?: number 5463 | }, 5464 | /** 5465 | * Define nodes as roots. Default value - *null* 5466 | * ```typescript 5467 | * var chart = new OrgChart('#tree', { 5468 | * roots: [2, 4] 5469 | * }); 5470 | * ``` 5471 | */ 5472 | roots?: Array, 5473 | /** 5474 | * Persist the state (scale, position, expanded/collapsed and min/max nodes) in the url or indexedDB. Default value - *null* 5475 | * ```typescript 5476 | * var chart = new OrgChart('#tree', { 5477 | * state: { 5478 | * name: 'MyStateName', 5479 | * readFromLocalStorage: true, 5480 | * writeToLocalStorage: true, 5481 | * readFromIndexedDB: true, 5482 | * writeToIndexedDB: true, 5483 | * readFromUrlParams: true, 5484 | * writeToUrlParams: true 5485 | * } 5486 | * }); 5487 | * ``` 5488 | */ 5489 | state?: { 5490 | name?: string, 5491 | readFromLocalStorage?: boolean, 5492 | writeToLocalStorage?: boolean, 5493 | readFromIndexedDB?: boolean, 5494 | writeToIndexedDB?: boolean, 5495 | readFromUrlParams?: boolean, 5496 | writeToUrlParams?: boolean 5497 | }, 5498 | /** 5499 | * Set the session storage name to use undo/redo functionallity. 5500 | * ```typescript 5501 | * let chart = new OrgChart('#tree', { 5502 | * undoRedoStorageName: 'myStorageName', 5503 | * }); 5504 | * ``` 5505 | */ 5506 | undoRedoStorageName?: string, 5507 | 5508 | /** 5509 | * Configure the buildin edit form. 5510 | * ```typescript 5511 | * let chart = new OrgChart('#tree', { 5512 | * editForm: { 5513 | * readOnly: 'false', // the drefault value 5514 | * titleBinding: "name", // a property name 5515 | * photoBinding: "img", // the photo property name 5516 | * focusBinding: "name", 5517 | * addMore: "Add am element", 5518 | * addMoreBtn: "Add", 5519 | * addMoreFieldName: "Element name:", 5520 | * saveAndCloseBtn: "Save", 5521 | * cancelBtn: "Close", 5522 | * generateElementsFromFields: false, 5523 | * buttons: { 5524 | * edit: { 5525 | * icon: OrgChart.icon.edit(24,24,'#fff'), 5526 | * text: 'Edit', 5527 | * hideIfEditMode: true, 5528 | * hideIfDetailsMode: false 5529 | * }, 5530 | * share: { 5531 | * icon: OrgChart.icon.share(24,24,'#fff'), 5532 | * text: 'Share' 5533 | * }, 5534 | * pdf: { 5535 | * icon: OrgChart.icon.pdf(24,24,'#fff'), 5536 | * text: 'Save as PDF' 5537 | * }, 5538 | * remove: { 5539 | * icon: OrgChart.icon.remove(24,24,'#fff'), 5540 | * text: 'Remove', 5541 | * hideIfDetailsMode: true 5542 | * } 5543 | * }, 5544 | * elements: [ 5545 | * { type: 'textbox', label: 'Full Name', binding: 'Name' }, 5546 | * { type: 'textbox', label: 'Phone number', binding: 'phone' } 5547 | * ] 5548 | * } 5549 | * }); 5550 | * ``` 5551 | * {@link https://balkan.app/OrgChartJS/Docs/Edit | See doc...} 5552 | */ 5553 | editForm?: { 5554 | readOnly?: boolean, 5555 | titleBinding?: string, 5556 | photoBinding?: string, 5557 | focusBinding?: string, 5558 | addMore?: string, 5559 | addMoreBtn?: string, 5560 | addMoreFieldName?: string, 5561 | saveAndCloseBtn?: string, 5562 | cancelBtn?: string, 5563 | generateElementsFromFields?: boolean, 5564 | buttons?: { 5565 | [key: string]: { 5566 | icon?: string, 5567 | text?: string, 5568 | hideIfEditMode?: boolean, 5569 | hideIfDetailsMode?: boolean 5570 | } | null 5571 | }, 5572 | // elements?: { [key: string]: OrgChart.editFormElement | Array } 5573 | elements?: Array> 5574 | } 5575 | } 5576 | 5577 | /** 5578 | * @ignore 5579 | */ 5580 | var ui: { 5581 | defs(fromrender: string): string; 5582 | lonely(config: Object): string; 5583 | pointer(config: Object, action: OrgChart.action, scale: number): string; 5584 | node(node: OrgChart.node, data: Object, animations: OrgChart.anim, config: Object, x: number | undefined, y: number | undefined, nodeBinding: Object | undefined, action: OrgChart.action, scale: number, sender: Object): string; 5585 | nodeBtns(config: Object, node: OrgChart.node, action: OrgChart.action, t: Object, sender: Object): string; 5586 | expandCollapseBtn(chart: OrgChart, node: OrgChart.node, layoutConfigs: any, action: OrgChart.action, scale: number): string; 5587 | link(node: OrgChart.node, obj: Object, scale: number, bordersByRootIdAndLevel: Object, nodes: Object, action: OrgChart.action): Array; 5588 | svg(width: number, height: number, viewBox: Array, config: Object, content: string, scale: number): string; 5589 | menuButton(config: Object): string; 5590 | 5591 | }; 5592 | 5593 | /** 5594 | * @ignore 5595 | */ 5596 | var t: any; 5597 | }export default OrgChart -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | {"author":{"name":"BALKAN App"},"bugs":{"email":"support@balkan.app","url":"https://github.com/BALKANGraph/OrgChartJS/issues"},"deprecated":false,"description":"Ultimate Organizational Chart JavaScript library, Interactive Diagrams","files":["orgchart.js","orgchart.d.ts","package.json","README.md"],"homepage":"https://balkan.app/","keywords":["diagram","chart","tree","orgchart","graph","svg","hierarchy","family-tree","decision-tree","visualization","tree-layout","hierarchical","javascript","js","html","html5"],"license":"SEE LICENSE IN https://balkan.app","main":"orgchart.js","types":"orgchart.d.ts","name":"@balkangraph/orgchart.js","repository":{"type":"git","url":"https://github.com/BALKANGraph/OrgChartJS"},"dependencies":{},"version":"8.19.03"} --------------------------------------------------------------------------------