balkan-orgchart-js 9.1.41 → 9.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{orgchart.d.ts → OrgChart.d.ts} +371 -379
- package/README.md +10 -79
- package/orgchart.cjs +455 -0
- package/orgchart.js +9824 -1
- package/package.json +21 -19
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* </html>
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
declare class OrgChart
|
|
36
|
+
declare class OrgChart {
|
|
37
37
|
/**
|
|
38
38
|
* ```typescript
|
|
39
39
|
* let chart = new OrgChart('#tree', {});
|
|
@@ -302,7 +302,137 @@ declare class OrgChart extends OrgChart.eventListeners {
|
|
|
302
302
|
removeListener(type: "init" | "field" | "update" | "add" | "remove" | "renderbuttons" | "label" | "render-link" | "drag" | "drop" | "redraw" | "expcollclick" | "exportstart" | "exportend" | "click" | "dbclick" | "slink-click" | "clink-click" | "up-click" | "searchclick" | "import" | "updated" | "key-down" | "visibility-change" | "renderdefs" | "render" | "prerender" | "screen-reader-text" | "ready" | "ripple" | "node-initialized" | "nodes-initialized" | "node-layout", listener?: () => void): boolean;
|
|
303
303
|
|
|
304
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Occurs when the node data has been updated by updateNode method.
|
|
307
|
+
* ```typescript
|
|
308
|
+
* var chart = new OrgChart('#tree', {});
|
|
309
|
+
* chart.onUpdateNode((args) => {
|
|
310
|
+
* //return false; to cancel the operation
|
|
311
|
+
* });
|
|
312
|
+
* ```
|
|
313
|
+
* @category Event Listeners
|
|
314
|
+
* @param listener
|
|
315
|
+
*/
|
|
316
|
+
onUpdateNode(listener: (args: {
|
|
317
|
+
/**
|
|
318
|
+
* old node data
|
|
319
|
+
*/
|
|
320
|
+
oldData: OrgChart.nodeData,
|
|
321
|
+
/**
|
|
322
|
+
* new node data
|
|
323
|
+
*/
|
|
324
|
+
newData: OrgChart.nodeData
|
|
325
|
+
}) => void): OrgChart;
|
|
305
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Occurs when new nodes are added, removed, updated or imported, also when slink or clink is added or removed and after undo or redo operations.
|
|
329
|
+
* Use this event listener to synch your server side database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
330
|
+
* ```typescript
|
|
331
|
+
* var chart = new OrgChart('#tree', {});
|
|
332
|
+
* chart.onUpdated(() => {
|
|
333
|
+
* //Update your server database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
334
|
+
* });
|
|
335
|
+
* ```
|
|
336
|
+
* @category Event Listeners
|
|
337
|
+
*/
|
|
338
|
+
onUpdated(): OrgChart;
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Occurs when a node has been removed by removeNode method.
|
|
343
|
+
* ```typescript
|
|
344
|
+
* var chart = new OrgChart('#tree', {});
|
|
345
|
+
* chart.onRemoveNode((args) => {
|
|
346
|
+
* //return false; to cancel the operation
|
|
347
|
+
* });
|
|
348
|
+
* ```
|
|
349
|
+
* @category Event Listeners
|
|
350
|
+
* @param listener
|
|
351
|
+
*/
|
|
352
|
+
onRemoveNode(listener: (args: {
|
|
353
|
+
/**
|
|
354
|
+
* node id
|
|
355
|
+
*/
|
|
356
|
+
id: number | string,
|
|
357
|
+
/**
|
|
358
|
+
* parent ids and sub tree parents ids that needs to be updated on the server. For example if you remove a node that has children all chilren nodes will change their pid to the parent node id of the removed node.
|
|
359
|
+
*/
|
|
360
|
+
newPidsAndStpidsForIds: {
|
|
361
|
+
newPidsForIds: { [key in any]: string | number },
|
|
362
|
+
newStpidsForIds: { [key in any]: string | number }
|
|
363
|
+
}
|
|
364
|
+
}) => void): OrgChart;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Occurs when a node has been added by addNode method.
|
|
368
|
+
* ```typescript
|
|
369
|
+
* var chart = new OrgChart('#tree', {});
|
|
370
|
+
* chart.onAddNode((args) => {
|
|
371
|
+
* //return false; to cancel the operation
|
|
372
|
+
* });
|
|
373
|
+
* ```
|
|
374
|
+
* @category Event Listeners
|
|
375
|
+
* @param listener
|
|
376
|
+
*/
|
|
377
|
+
onAddNode(listener: (args: {
|
|
378
|
+
/**
|
|
379
|
+
* new added data node
|
|
380
|
+
*/
|
|
381
|
+
data: OrgChart.nodeData
|
|
382
|
+
}) => void): OrgChart;
|
|
383
|
+
/**
|
|
384
|
+
* The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
|
|
385
|
+
* ```typescript
|
|
386
|
+
* var chart = new OrgChart('#tree', {});
|
|
387
|
+
* chart.onDrag(() => {
|
|
388
|
+
* //return false; to cancel the operation
|
|
389
|
+
* });
|
|
390
|
+
* ```
|
|
391
|
+
* @category Event Listeners
|
|
392
|
+
* @param listener
|
|
393
|
+
*/
|
|
394
|
+
onDrag(listener: (args: {
|
|
395
|
+
/**
|
|
396
|
+
* dragged node id
|
|
397
|
+
*/
|
|
398
|
+
dragId: string | number,
|
|
399
|
+
event: MouseEvent,
|
|
400
|
+
/**
|
|
401
|
+
* array of node ids
|
|
402
|
+
*
|
|
403
|
+
* this property is initialized only if movable option is set
|
|
404
|
+
*/
|
|
405
|
+
nodeIds: Array<string | number>
|
|
406
|
+
}) => void): OrgChart;
|
|
407
|
+
/**
|
|
408
|
+
* The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
|
|
409
|
+
* ```typescript
|
|
410
|
+
* var chart = new OrgChart('#tree', {});
|
|
411
|
+
* chart.onDrop(() => {
|
|
412
|
+
* //return false; to cancel the operation
|
|
413
|
+
* });
|
|
414
|
+
* ```
|
|
415
|
+
* @category Event Listeners
|
|
416
|
+
* @param listener
|
|
417
|
+
*/
|
|
418
|
+
onDrop(listener: (args: {
|
|
419
|
+
/**
|
|
420
|
+
* dragged node id
|
|
421
|
+
*/
|
|
422
|
+
dragId: string | number,
|
|
423
|
+
/**
|
|
424
|
+
* dropped node id
|
|
425
|
+
*/
|
|
426
|
+
dropId: string | number,
|
|
427
|
+
/**
|
|
428
|
+
* draging element
|
|
429
|
+
*/
|
|
430
|
+
dragNodeElement: HTMLElement,
|
|
431
|
+
/**
|
|
432
|
+
* Mouse event
|
|
433
|
+
*/
|
|
434
|
+
event: MouseEvent
|
|
435
|
+
}) => void): OrgChart;
|
|
306
436
|
|
|
307
437
|
/**
|
|
308
438
|
* All chart nodes
|
|
@@ -1106,7 +1236,246 @@ declare class OrgChart extends OrgChart.eventListeners {
|
|
|
1106
1236
|
|
|
1107
1237
|
|
|
1108
1238
|
|
|
1239
|
+
/**
|
|
1240
|
+
* Occurs when the nodes in OrgChart has been created and loaded to the DOM.
|
|
1241
|
+
* ```typescript
|
|
1242
|
+
* let chart = new OrgChart('#tree', {});
|
|
1243
|
+
* chart.onInit(() => {
|
|
1244
|
+
* });
|
|
1245
|
+
* chart.load(nodes);
|
|
1246
|
+
* ```
|
|
1247
|
+
* @category Event Listeners
|
|
1248
|
+
* @param listener
|
|
1249
|
+
*/
|
|
1250
|
+
onInit(listener: (this: OrgChart) => void): OrgChart;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* The onRedraw event occurs when the chart is redrawed.
|
|
1254
|
+
* ```typescript
|
|
1255
|
+
* let chart = new OrgChart('#tree', {});
|
|
1256
|
+
* chart.onRedraw(() => {
|
|
1257
|
+
* });
|
|
1258
|
+
* chart.load(nodes);
|
|
1259
|
+
* ```
|
|
1260
|
+
* @category Event Listeners
|
|
1261
|
+
* @param listener
|
|
1262
|
+
*/
|
|
1263
|
+
onRedraw(listener: (this: OrgChart) => void): OrgChart;
|
|
1109
1264
|
|
|
1265
|
+
/**
|
|
1266
|
+
* The onExpandCollapseButtonClick event occurs when the chart is redrawed.
|
|
1267
|
+
* ```typescript
|
|
1268
|
+
* let chart = new OrgChart('#tree', {});
|
|
1269
|
+
* chart.onExpandCollapseButtonClick(() => {
|
|
1270
|
+
* //return false; to cancel the operation
|
|
1271
|
+
* });
|
|
1272
|
+
* chart.load(nodes);
|
|
1273
|
+
* ```
|
|
1274
|
+
* @category Event Listeners
|
|
1275
|
+
* @param listener
|
|
1276
|
+
*/
|
|
1277
|
+
onExpandCollapseButtonClick(listener: (this: OrgChart, args: {
|
|
1278
|
+
/**
|
|
1279
|
+
* Indicates id the operation is collaps or expand
|
|
1280
|
+
*/
|
|
1281
|
+
collapsing: boolean,
|
|
1282
|
+
/**
|
|
1283
|
+
* the id of the clicked node
|
|
1284
|
+
*/
|
|
1285
|
+
id: number | string,
|
|
1286
|
+
/**
|
|
1287
|
+
* node ids that will be expanded or collapsed
|
|
1288
|
+
*/
|
|
1289
|
+
ids: Array<number | string>
|
|
1290
|
+
}) => void): OrgChart;
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* 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.
|
|
1294
|
+
* ```typescript
|
|
1295
|
+
* let chart = new OrgChart('#tree', {});
|
|
1296
|
+
* chart.onExportStart(() => {
|
|
1297
|
+
* args.styles += '<link href="[link to my styles]" rel="stylesheet">';
|
|
1298
|
+
* //return false; to cancel the operation
|
|
1299
|
+
* });
|
|
1300
|
+
* chart.load(nodes);
|
|
1301
|
+
* ```
|
|
1302
|
+
* @category Event Listeners
|
|
1303
|
+
* @param listener
|
|
1304
|
+
*/
|
|
1305
|
+
onExportStart(listener: (this: OrgChart, args: {
|
|
1306
|
+
options: {
|
|
1307
|
+
childLevels?: number,
|
|
1308
|
+
expandChildren?: boolean,
|
|
1309
|
+
fileName?: string,
|
|
1310
|
+
footer?: string,
|
|
1311
|
+
header?: string,
|
|
1312
|
+
height?: number,
|
|
1313
|
+
width?: number,
|
|
1314
|
+
landscape?: boolean,
|
|
1315
|
+
margin?: Array<number>,
|
|
1316
|
+
min?: boolean,
|
|
1317
|
+
openInNewTab?: boolean,
|
|
1318
|
+
padding?: number,
|
|
1319
|
+
parentLevels?: number,
|
|
1320
|
+
type?: string,
|
|
1321
|
+
pages?: Array<{
|
|
1322
|
+
chartInstance?: OrgChart,
|
|
1323
|
+
childLevels?: number,
|
|
1324
|
+
expandChildren?: boolean,
|
|
1325
|
+
footer?: string,
|
|
1326
|
+
header?: string,
|
|
1327
|
+
margin?: Array<number>,
|
|
1328
|
+
min?: boolean,
|
|
1329
|
+
padding?: number,
|
|
1330
|
+
parentLevels?: number,
|
|
1331
|
+
isProfile?: boolean,
|
|
1332
|
+
nodeId?: number | string,
|
|
1333
|
+
content?: string,
|
|
1334
|
+
height?: number,
|
|
1335
|
+
width?: number,
|
|
1336
|
+
}>
|
|
1337
|
+
},
|
|
1338
|
+
pages?: Array<SVGElement>,
|
|
1339
|
+
styles?: string
|
|
1340
|
+
}) => void): OrgChart;
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* 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.
|
|
1344
|
+
* ```typescript
|
|
1345
|
+
* let chart = new OrgChart('#tree', {});
|
|
1346
|
+
* chart.onExportEnd(() => {
|
|
1347
|
+
* //return false; to cancel the operation for example id you prefer the exported document to not download
|
|
1348
|
+
* });
|
|
1349
|
+
* chart.load(nodes);
|
|
1350
|
+
* ```
|
|
1351
|
+
* @category Event Listeners
|
|
1352
|
+
* @param listener
|
|
1353
|
+
*/
|
|
1354
|
+
onExportEnd(listener: (this: OrgChart, args:
|
|
1355
|
+
/**
|
|
1356
|
+
* for PDF/PNG
|
|
1357
|
+
*/
|
|
1358
|
+
{
|
|
1359
|
+
/**
|
|
1360
|
+
* the array buffer is the exported document, you can save it on a server or send it via email
|
|
1361
|
+
*
|
|
1362
|
+
* this property is initialized only for PDF/PNG exports
|
|
1363
|
+
*/
|
|
1364
|
+
ArrayBuffer: ArrayBuffer
|
|
1365
|
+
/**
|
|
1366
|
+
* extension
|
|
1367
|
+
*
|
|
1368
|
+
* this property is initialized only for CSV/XML exports
|
|
1369
|
+
*/
|
|
1370
|
+
ext: string,
|
|
1371
|
+
/**
|
|
1372
|
+
* filename, you can change the filename here
|
|
1373
|
+
*
|
|
1374
|
+
* this property is initialized only for CSV/XML exports
|
|
1375
|
+
*/
|
|
1376
|
+
filename: string,
|
|
1377
|
+
/**
|
|
1378
|
+
* an array of node objects
|
|
1379
|
+
*
|
|
1380
|
+
* this property is initialized only for CSV/XML exports
|
|
1381
|
+
*/
|
|
1382
|
+
nodes: Array<object>,
|
|
1383
|
+
/**
|
|
1384
|
+
* csv ot xml string
|
|
1385
|
+
*
|
|
1386
|
+
* this property is initialized only for CSV/XML/SVG exports
|
|
1387
|
+
*/
|
|
1388
|
+
content: string,
|
|
1389
|
+
/**
|
|
1390
|
+
* add extra styles
|
|
1391
|
+
*
|
|
1392
|
+
* this property is initialized only for SVG exports
|
|
1393
|
+
*/
|
|
1394
|
+
styles: string,
|
|
1395
|
+
}) => void): OrgChart;
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* On node click event listener.
|
|
1399
|
+
* ```typescript
|
|
1400
|
+
* let chart = new OrgChart('#tree', {});
|
|
1401
|
+
* chart.onNodeClick(() => {
|
|
1402
|
+
* //return false; to cancel the operation
|
|
1403
|
+
* });
|
|
1404
|
+
* chart.load(nodes);
|
|
1405
|
+
* ```
|
|
1406
|
+
* @category Event Listeners
|
|
1407
|
+
* @param listener
|
|
1408
|
+
*/
|
|
1409
|
+
onNodeClick(listener: (this: OrgChart, args: {
|
|
1410
|
+
/**
|
|
1411
|
+
* node JSON object
|
|
1412
|
+
*/
|
|
1413
|
+
node: OrgChart.node,
|
|
1414
|
+
/**
|
|
1415
|
+
* the browser event
|
|
1416
|
+
*/
|
|
1417
|
+
event: any
|
|
1418
|
+
}) => void): OrgChart;
|
|
1419
|
+
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* On canvas SVG click event listener.
|
|
1423
|
+
* ```typescript
|
|
1424
|
+
* let chart = new OrgChart('#tree', {});
|
|
1425
|
+
* chart.onCanvasClick(() => {
|
|
1426
|
+
* });
|
|
1427
|
+
* chart.load(nodes);
|
|
1428
|
+
* ```
|
|
1429
|
+
* @category Event Listeners
|
|
1430
|
+
* @param listener
|
|
1431
|
+
*/
|
|
1432
|
+
onCanvasClick(listener: (this: OrgChart, args: {
|
|
1433
|
+
/**
|
|
1434
|
+
* the browser event
|
|
1435
|
+
*/
|
|
1436
|
+
event: any
|
|
1437
|
+
}) => void): OrgChart;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* In onAIToolCalls we parse the AI responce to our functions
|
|
1441
|
+
* ```typescript
|
|
1442
|
+
* chart.onAIToolCalls(function(args){
|
|
1443
|
+
* for(var toolCall of args.toolCalls){
|
|
1444
|
+
* if (toolCall.FunctionName == 'sendEmail'){
|
|
1445
|
+
* toolCall.FunctionResult = sendEmail(toolCall.FunctionArguments);
|
|
1446
|
+
* }
|
|
1447
|
+
* }
|
|
1448
|
+
* });
|
|
1449
|
+
* ```
|
|
1450
|
+
* [Go to AI doc page for more details](https://balkan.app/OrgChartJS/Docs/AI)
|
|
1451
|
+
* @param listener
|
|
1452
|
+
*/
|
|
1453
|
+
onAIToolCalls(listener: (this: OrgChart, args: {
|
|
1454
|
+
toolCalls: Array<{
|
|
1455
|
+
FunctionName : string,
|
|
1456
|
+
FunctionResult : string,
|
|
1457
|
+
FunctionArguments : { [key: string]: any }
|
|
1458
|
+
}>
|
|
1459
|
+
}) => void): OrgChart;
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* On node double click event listener.
|
|
1463
|
+
* ```typescript
|
|
1464
|
+
* let chart = new OrgChart('#tree', {});
|
|
1465
|
+
* chart.onNodeDoubleClick(() => {
|
|
1466
|
+
* //return false; to cancel the operation
|
|
1467
|
+
* });
|
|
1468
|
+
* chart.load(nodes);
|
|
1469
|
+
* ```
|
|
1470
|
+
* @category Event Listeners
|
|
1471
|
+
* @param listener
|
|
1472
|
+
*/
|
|
1473
|
+
onNodeDoubleClick(listener: (this: OrgChart, args: {
|
|
1474
|
+
/**
|
|
1475
|
+
* clicked node data
|
|
1476
|
+
*/
|
|
1477
|
+
data: object
|
|
1478
|
+
}) => void): OrgChart;
|
|
1110
1479
|
|
|
1111
1480
|
/**
|
|
1112
1481
|
* The tree div element.
|
|
@@ -1502,7 +1871,7 @@ declare class OrgChart extends OrgChart.eventListeners {
|
|
|
1502
1871
|
* @param listener
|
|
1503
1872
|
*/
|
|
1504
1873
|
on(type: "layout", listener: (args: any, args1: any, args2: any) => void): void
|
|
1505
|
-
};
|
|
1874
|
+
};
|
|
1506
1875
|
|
|
1507
1876
|
/**
|
|
1508
1877
|
* @ignore
|
|
@@ -1930,383 +2299,6 @@ declare class OrgChart extends OrgChart.eventListeners {
|
|
|
1930
2299
|
|
|
1931
2300
|
declare namespace OrgChart {
|
|
1932
2301
|
|
|
1933
|
-
interface eventListeners{
|
|
1934
|
-
/**
|
|
1935
|
-
* Occurs when a node has been removed by removeNode method.
|
|
1936
|
-
* ```typescript
|
|
1937
|
-
* var chart = new OrgChart('#tree', {});
|
|
1938
|
-
* chart.onRemoveNode((args) => {
|
|
1939
|
-
* //return false; to cancel the operation
|
|
1940
|
-
* });
|
|
1941
|
-
* ```
|
|
1942
|
-
* @category Event Listeners
|
|
1943
|
-
* @param listener
|
|
1944
|
-
*/
|
|
1945
|
-
onRemoveNode(listener: (args: {
|
|
1946
|
-
/**
|
|
1947
|
-
* node id
|
|
1948
|
-
*/
|
|
1949
|
-
id: number | string,
|
|
1950
|
-
/**
|
|
1951
|
-
* 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.
|
|
1952
|
-
*/
|
|
1953
|
-
newPidsAndStpidsForIds: {
|
|
1954
|
-
newPidsForIds: { [key in any]: string | number },
|
|
1955
|
-
newStpidsForIds: { [key in any]: string | number }
|
|
1956
|
-
}
|
|
1957
|
-
}) => void): OrgChart;
|
|
1958
|
-
|
|
1959
|
-
/**
|
|
1960
|
-
* Occurs when a node has been added by addNode method.
|
|
1961
|
-
* ```typescript
|
|
1962
|
-
* var chart = new OrgChart('#tree', {});
|
|
1963
|
-
* chart.onAddNode((args) => {
|
|
1964
|
-
* //return false; to cancel the operation
|
|
1965
|
-
* });
|
|
1966
|
-
* ```
|
|
1967
|
-
* @category Event Listeners
|
|
1968
|
-
* @param listener
|
|
1969
|
-
*/
|
|
1970
|
-
onAddNode(listener: (args: {
|
|
1971
|
-
/**
|
|
1972
|
-
* new added data node
|
|
1973
|
-
*/
|
|
1974
|
-
data: OrgChart.nodeData
|
|
1975
|
-
}) => void): OrgChart;
|
|
1976
|
-
/**
|
|
1977
|
-
* The onDrag event occurs when a node is dragged. *enableDragDrop* option has to be turned on.
|
|
1978
|
-
* ```typescript
|
|
1979
|
-
* var chart = new OrgChart('#tree', {});
|
|
1980
|
-
* chart.onDrag(() => {
|
|
1981
|
-
* //return false; to cancel the operation
|
|
1982
|
-
* });
|
|
1983
|
-
* ```
|
|
1984
|
-
* @category Event Listeners
|
|
1985
|
-
* @param listener
|
|
1986
|
-
*/
|
|
1987
|
-
onDrag(listener: (args: {
|
|
1988
|
-
/**
|
|
1989
|
-
* dragged node id
|
|
1990
|
-
*/
|
|
1991
|
-
dragId: string | number,
|
|
1992
|
-
event: MouseEvent,
|
|
1993
|
-
/**
|
|
1994
|
-
* array of node ids
|
|
1995
|
-
*
|
|
1996
|
-
* this property is initialized only if movable option is set
|
|
1997
|
-
*/
|
|
1998
|
-
nodeIds: Array<string | number>
|
|
1999
|
-
}) => void): OrgChart;
|
|
2000
|
-
/**
|
|
2001
|
-
* The onDrop event occurs when a node is dropped. *enableDragDrop* option has to be turned on.
|
|
2002
|
-
* ```typescript
|
|
2003
|
-
* var chart = new OrgChart('#tree', {});
|
|
2004
|
-
* chart.onDrop(() => {
|
|
2005
|
-
* //return false; to cancel the operation
|
|
2006
|
-
* });
|
|
2007
|
-
* ```
|
|
2008
|
-
* @category Event Listeners
|
|
2009
|
-
* @param listener
|
|
2010
|
-
*/
|
|
2011
|
-
onDrop(listener: (args: {
|
|
2012
|
-
/**
|
|
2013
|
-
* dragged node id
|
|
2014
|
-
*/
|
|
2015
|
-
dragId: string | number,
|
|
2016
|
-
/**
|
|
2017
|
-
* dropped node id
|
|
2018
|
-
*/
|
|
2019
|
-
dropId: string | number,
|
|
2020
|
-
/**
|
|
2021
|
-
* draging element
|
|
2022
|
-
*/
|
|
2023
|
-
dragNodeElement: HTMLElement,
|
|
2024
|
-
/**
|
|
2025
|
-
* Mouse event
|
|
2026
|
-
*/
|
|
2027
|
-
event: MouseEvent
|
|
2028
|
-
}) => void): OrgChart;
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
/**
|
|
2033
|
-
* 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.
|
|
2034
|
-
* Use this event listener to synch your server side database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
2035
|
-
* ```typescript
|
|
2036
|
-
* var chart = new OrgChart('#tree', {});
|
|
2037
|
-
* chart.onUpdated(() => {
|
|
2038
|
-
* //Update your server database with this.config.nodes, this.config.clinks, this.config.slinks etc.
|
|
2039
|
-
* });
|
|
2040
|
-
* ```
|
|
2041
|
-
* @category Event Listeners
|
|
2042
|
-
*/
|
|
2043
|
-
onUpdated(): OrgChart;
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
/**
|
|
2047
|
-
* Occurs when the node data has been updated by updateNode method.
|
|
2048
|
-
* ```typescript
|
|
2049
|
-
* var chart = new OrgChart('#tree', {});
|
|
2050
|
-
* chart.onUpdateNode((args) => {
|
|
2051
|
-
* //return false; to cancel the operation
|
|
2052
|
-
* });
|
|
2053
|
-
* ```
|
|
2054
|
-
* @category Event Listeners
|
|
2055
|
-
* @param listener
|
|
2056
|
-
*/
|
|
2057
|
-
onUpdateNode(listener: (args: {
|
|
2058
|
-
/**
|
|
2059
|
-
* old node data
|
|
2060
|
-
*/
|
|
2061
|
-
oldData: OrgChart.nodeData,
|
|
2062
|
-
/**
|
|
2063
|
-
* new node data
|
|
2064
|
-
*/
|
|
2065
|
-
newData: OrgChart.nodeData
|
|
2066
|
-
}) => void): OrgChart;
|
|
2067
|
-
|
|
2068
|
-
/**
|
|
2069
|
-
* Occurs when the nodes in OrgChart has been created and loaded to the DOM.
|
|
2070
|
-
* ```typescript
|
|
2071
|
-
* let chart = new OrgChart('#tree', {});
|
|
2072
|
-
* chart.onInit(() => {
|
|
2073
|
-
* });
|
|
2074
|
-
* chart.load(nodes);
|
|
2075
|
-
* ```
|
|
2076
|
-
* @category Event Listeners
|
|
2077
|
-
* @param listener
|
|
2078
|
-
*/
|
|
2079
|
-
onInit(listener: (this: OrgChart) => void): OrgChart;
|
|
2080
|
-
|
|
2081
|
-
/**
|
|
2082
|
-
* The onRedraw event occurs when the chart is redrawed.
|
|
2083
|
-
* ```typescript
|
|
2084
|
-
* let chart = new OrgChart('#tree', {});
|
|
2085
|
-
* chart.onRedraw(() => {
|
|
2086
|
-
* });
|
|
2087
|
-
* chart.load(nodes);
|
|
2088
|
-
* ```
|
|
2089
|
-
* @category Event Listeners
|
|
2090
|
-
* @param listener
|
|
2091
|
-
*/
|
|
2092
|
-
onRedraw(listener: (this: OrgChart) => void): OrgChart;
|
|
2093
|
-
|
|
2094
|
-
/**
|
|
2095
|
-
* The onExpandCollapseButtonClick event occurs when the chart is redrawed.
|
|
2096
|
-
* ```typescript
|
|
2097
|
-
* let chart = new OrgChart('#tree', {});
|
|
2098
|
-
* chart.onExpandCollapseButtonClick(() => {
|
|
2099
|
-
* //return false; to cancel the operation
|
|
2100
|
-
* });
|
|
2101
|
-
* chart.load(nodes);
|
|
2102
|
-
* ```
|
|
2103
|
-
* @category Event Listeners
|
|
2104
|
-
* @param listener
|
|
2105
|
-
*/
|
|
2106
|
-
onExpandCollapseButtonClick(listener: (this: OrgChart, args: {
|
|
2107
|
-
/**
|
|
2108
|
-
* Indicates id the operation is collaps or expand
|
|
2109
|
-
*/
|
|
2110
|
-
collapsing: boolean,
|
|
2111
|
-
/**
|
|
2112
|
-
* the id of the clicked node
|
|
2113
|
-
*/
|
|
2114
|
-
id: number | string,
|
|
2115
|
-
/**
|
|
2116
|
-
* node ids that will be expanded or collapsed
|
|
2117
|
-
*/
|
|
2118
|
-
ids: Array<number | string>
|
|
2119
|
-
}) => void): OrgChart;
|
|
2120
|
-
|
|
2121
|
-
/**
|
|
2122
|
-
* 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.
|
|
2123
|
-
* ```typescript
|
|
2124
|
-
* let chart = new OrgChart('#tree', {});
|
|
2125
|
-
* chart.onExportStart(() => {
|
|
2126
|
-
* args.styles += '<link href="[link to my styles]" rel="stylesheet">';
|
|
2127
|
-
* //return false; to cancel the operation
|
|
2128
|
-
* });
|
|
2129
|
-
* chart.load(nodes);
|
|
2130
|
-
* ```
|
|
2131
|
-
* @category Event Listeners
|
|
2132
|
-
* @param listener
|
|
2133
|
-
*/
|
|
2134
|
-
onExportStart(listener: (this: OrgChart, args: {
|
|
2135
|
-
options: {
|
|
2136
|
-
childLevels?: number,
|
|
2137
|
-
expandChildren?: boolean,
|
|
2138
|
-
fileName?: string,
|
|
2139
|
-
footer?: string,
|
|
2140
|
-
header?: string,
|
|
2141
|
-
height?: number,
|
|
2142
|
-
width?: number,
|
|
2143
|
-
landscape?: boolean,
|
|
2144
|
-
margin?: Array<number>,
|
|
2145
|
-
min?: boolean,
|
|
2146
|
-
openInNewTab?: boolean,
|
|
2147
|
-
padding?: number,
|
|
2148
|
-
parentLevels?: number,
|
|
2149
|
-
type?: string,
|
|
2150
|
-
pages?: Array<{
|
|
2151
|
-
chartInstance?: OrgChart,
|
|
2152
|
-
childLevels?: number,
|
|
2153
|
-
expandChildren?: boolean,
|
|
2154
|
-
footer?: string,
|
|
2155
|
-
header?: string,
|
|
2156
|
-
margin?: Array<number>,
|
|
2157
|
-
min?: boolean,
|
|
2158
|
-
padding?: number,
|
|
2159
|
-
parentLevels?: number,
|
|
2160
|
-
isProfile?: boolean,
|
|
2161
|
-
nodeId?: number | string,
|
|
2162
|
-
content?: string,
|
|
2163
|
-
height?: number,
|
|
2164
|
-
width?: number,
|
|
2165
|
-
}>
|
|
2166
|
-
},
|
|
2167
|
-
pages?: Array<SVGElement>,
|
|
2168
|
-
styles?: string
|
|
2169
|
-
}) => void): OrgChart;
|
|
2170
|
-
|
|
2171
|
-
/**
|
|
2172
|
-
* 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.
|
|
2173
|
-
* ```typescript
|
|
2174
|
-
* let chart = new OrgChart('#tree', {});
|
|
2175
|
-
* chart.onExportEnd(() => {
|
|
2176
|
-
* //return false; to cancel the operation for example id you prefer the exported document to not download
|
|
2177
|
-
* });
|
|
2178
|
-
* chart.load(nodes);
|
|
2179
|
-
* ```
|
|
2180
|
-
* @category Event Listeners
|
|
2181
|
-
* @param listener
|
|
2182
|
-
*/
|
|
2183
|
-
onExportEnd(listener: (this: OrgChart, args:
|
|
2184
|
-
/**
|
|
2185
|
-
* for PDF/PNG
|
|
2186
|
-
*/
|
|
2187
|
-
{
|
|
2188
|
-
/**
|
|
2189
|
-
* the array buffer is the exported document, you can save it on a server or send it via email
|
|
2190
|
-
*
|
|
2191
|
-
* this property is initialized only for PDF/PNG exports
|
|
2192
|
-
*/
|
|
2193
|
-
ArrayBuffer: ArrayBuffer
|
|
2194
|
-
/**
|
|
2195
|
-
* extension
|
|
2196
|
-
*
|
|
2197
|
-
* this property is initialized only for CSV/XML exports
|
|
2198
|
-
*/
|
|
2199
|
-
ext: string,
|
|
2200
|
-
/**
|
|
2201
|
-
* filename, you can change the filename here
|
|
2202
|
-
*
|
|
2203
|
-
* this property is initialized only for CSV/XML exports
|
|
2204
|
-
*/
|
|
2205
|
-
filename: string,
|
|
2206
|
-
/**
|
|
2207
|
-
* an array of node objects
|
|
2208
|
-
*
|
|
2209
|
-
* this property is initialized only for CSV/XML exports
|
|
2210
|
-
*/
|
|
2211
|
-
nodes: Array<object>,
|
|
2212
|
-
/**
|
|
2213
|
-
* csv ot xml string
|
|
2214
|
-
*
|
|
2215
|
-
* this property is initialized only for CSV/XML/SVG exports
|
|
2216
|
-
*/
|
|
2217
|
-
content: string,
|
|
2218
|
-
/**
|
|
2219
|
-
* add extra styles
|
|
2220
|
-
*
|
|
2221
|
-
* this property is initialized only for SVG exports
|
|
2222
|
-
*/
|
|
2223
|
-
styles: string,
|
|
2224
|
-
}) => void): OrgChart;
|
|
2225
|
-
|
|
2226
|
-
/**
|
|
2227
|
-
* On node click event listener.
|
|
2228
|
-
* ```typescript
|
|
2229
|
-
* let chart = new OrgChart('#tree', {});
|
|
2230
|
-
* chart.onNodeClick(() => {
|
|
2231
|
-
* //return false; to cancel the operation
|
|
2232
|
-
* });
|
|
2233
|
-
* chart.load(nodes);
|
|
2234
|
-
* ```
|
|
2235
|
-
* @category Event Listeners
|
|
2236
|
-
* @param listener
|
|
2237
|
-
*/
|
|
2238
|
-
onNodeClick(listener: (this: OrgChart, args: {
|
|
2239
|
-
/**
|
|
2240
|
-
* node JSON object
|
|
2241
|
-
*/
|
|
2242
|
-
node: OrgChart.node,
|
|
2243
|
-
/**
|
|
2244
|
-
* the browser event
|
|
2245
|
-
*/
|
|
2246
|
-
event: any
|
|
2247
|
-
}) => void): OrgChart;
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
/**
|
|
2251
|
-
* On canvas SVG click event listener.
|
|
2252
|
-
* ```typescript
|
|
2253
|
-
* let chart = new OrgChart('#tree', {});
|
|
2254
|
-
* chart.onCanvasClick(() => {
|
|
2255
|
-
* });
|
|
2256
|
-
* chart.load(nodes);
|
|
2257
|
-
* ```
|
|
2258
|
-
* @category Event Listeners
|
|
2259
|
-
* @param listener
|
|
2260
|
-
*/
|
|
2261
|
-
onCanvasClick(listener: (this: OrgChart, args: {
|
|
2262
|
-
/**
|
|
2263
|
-
* the browser event
|
|
2264
|
-
*/
|
|
2265
|
-
event: any
|
|
2266
|
-
}) => void): OrgChart;
|
|
2267
|
-
|
|
2268
|
-
/**
|
|
2269
|
-
* In onAIToolCalls we parse the AI responce to our functions
|
|
2270
|
-
* ```typescript
|
|
2271
|
-
* chart.onAIToolCalls(function(args){
|
|
2272
|
-
* for(var toolCall of args.toolCalls){
|
|
2273
|
-
* if (toolCall.FunctionName == 'sendEmail'){
|
|
2274
|
-
* toolCall.FunctionResult = sendEmail(toolCall.FunctionArguments);
|
|
2275
|
-
* }
|
|
2276
|
-
* }
|
|
2277
|
-
* });
|
|
2278
|
-
* ```
|
|
2279
|
-
* [Go to AI doc page for more details](https://balkan.app/OrgChartJS/Docs/AI)
|
|
2280
|
-
* @param listener
|
|
2281
|
-
*/
|
|
2282
|
-
onAIToolCalls(listener: (this: OrgChart, args: {
|
|
2283
|
-
toolCalls: Array<{
|
|
2284
|
-
FunctionName : string,
|
|
2285
|
-
FunctionResult : string,
|
|
2286
|
-
FunctionArguments : { [key: string]: any }
|
|
2287
|
-
}>
|
|
2288
|
-
}) => void): OrgChart;
|
|
2289
|
-
|
|
2290
|
-
/**
|
|
2291
|
-
* On node double click event listener.
|
|
2292
|
-
* ```typescript
|
|
2293
|
-
* let chart = new OrgChart('#tree', {});
|
|
2294
|
-
* chart.onNodeDoubleClick(() => {
|
|
2295
|
-
* //return false; to cancel the operation
|
|
2296
|
-
* });
|
|
2297
|
-
* chart.load(nodes);
|
|
2298
|
-
* ```
|
|
2299
|
-
* @category Event Listeners
|
|
2300
|
-
* @param listener
|
|
2301
|
-
*/
|
|
2302
|
-
onNodeDoubleClick(listener: (this: OrgChart, args: {
|
|
2303
|
-
/**
|
|
2304
|
-
* clicked node data
|
|
2305
|
-
*/
|
|
2306
|
-
data: object
|
|
2307
|
-
}) => void): OrgChart;
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
2302
|
/**
|
|
2311
2303
|
* The node JSON data
|
|
2312
2304
|
* ```ts
|