@balkangraph/orgchart.js 8.14.81 → 8.14.83
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 +178 -17
- package/orgchart.js +1 -1
- package/package.json +1 -1
package/orgchart.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
declare class OrgChart {
|
|
4
|
+
/**
|
|
5
|
+
* ```typescript
|
|
6
|
+
* let chart = new OrgChart('#tree', {});
|
|
7
|
+
* ```
|
|
8
|
+
* @param element HTML element or string selector for example '#tree'
|
|
9
|
+
* @param options configuration options
|
|
10
|
+
*/
|
|
11
|
+
constructor(element: HTMLElement | string, options?: OrgChart.options);
|
|
12
|
+
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* SVG icons
|
|
6
16
|
* @param w - width
|
|
@@ -304,19 +314,29 @@ declare class OrgChart {
|
|
|
304
314
|
*/
|
|
305
315
|
nodes: { [key in any]: OrgChart.node };
|
|
306
316
|
|
|
307
|
-
|
|
308
|
-
isVisible: boolean;
|
|
309
|
-
visibleNodeIds: Array<number | string>;
|
|
310
|
-
|
|
311
317
|
/**
|
|
312
|
-
*
|
|
318
|
+
* Returns true if chart is visible
|
|
319
|
+
* ```typescript
|
|
313
320
|
* let chart = new OrgChart('#tree', {});
|
|
321
|
+
* chart.onInit(() => {
|
|
322
|
+
* console.log(chart.isVisible);
|
|
323
|
+
* });
|
|
324
|
+
* chart.load(nodes)
|
|
314
325
|
* ```
|
|
315
|
-
* @param element HTML element or string selector for example '#tree'
|
|
316
|
-
* @param options configuration options
|
|
317
326
|
*/
|
|
318
|
-
|
|
327
|
+
isVisible: boolean;
|
|
319
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Returns the visible nodes ids
|
|
331
|
+
* ```typescript
|
|
332
|
+
* let chart = new OrgChart('#tree', {});
|
|
333
|
+
* chart.onInit(() => {
|
|
334
|
+
* console.log(chart.visibleNodeIds);
|
|
335
|
+
* });
|
|
336
|
+
* chart.load(nodes)
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
visibleNodeIds: Array<number | string>;
|
|
320
340
|
|
|
321
341
|
/**
|
|
322
342
|
* Updates the node data
|
|
@@ -1464,11 +1484,44 @@ declare class OrgChart {
|
|
|
1464
1484
|
* chart.load(nodes)
|
|
1465
1485
|
* ```
|
|
1466
1486
|
*/
|
|
1467
|
-
|
|
1468
1487
|
roots: Array<OrgChart.node>;
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Opens file upload dialog
|
|
1491
|
+
* ```typescript
|
|
1492
|
+
* let chart = new OrgChart('#tree', {});
|
|
1493
|
+
*
|
|
1494
|
+
* chart.editUI.on('element-btn-click', function (sender, args) {
|
|
1495
|
+
* OrgChart.fileUploadDialog(function (file) {
|
|
1496
|
+
* var formData = new FormData();
|
|
1497
|
+
* formData.append('file', file);
|
|
1498
|
+
* alert('upload the file');
|
|
1499
|
+
* })
|
|
1500
|
+
* });
|
|
1501
|
+
*
|
|
1502
|
+
* chart.load(nodes)
|
|
1503
|
+
* ```
|
|
1504
|
+
*/
|
|
1469
1505
|
|
|
1470
1506
|
static fileUploadDialog(callback: (file: any) => void): void;
|
|
1471
1507
|
|
|
1508
|
+
/**
|
|
1509
|
+
* Exports multiple charts or a chart by teams.
|
|
1510
|
+
* ```typescript
|
|
1511
|
+
* let chart1 = new OrgChart('#tree', {});
|
|
1512
|
+
* let chart2 = new OrgChart('#tree', {});
|
|
1513
|
+
* let chart3 = new OrgChart('#tree', {});
|
|
1514
|
+
* let chart4 = new OrgChart('#tree', {});
|
|
1515
|
+
* document.getElementById('btn_export').addEventListener('click', function(){
|
|
1516
|
+
* OrgChart.exportPDFFromCharts([
|
|
1517
|
+
* {chartInstance: chart1, scale: 'fit', format: 'A4', header: 'OrgChart 1' },
|
|
1518
|
+
* {chartInstance: chart2, scale: 'fit', format: 'A4', header: 'OrgChart 2' },
|
|
1519
|
+
* {chartInstance: chart3, scale: 'fit', format: 'A4', header: 'OrgChart 3' },
|
|
1520
|
+
* {chartInstance: chart4, scale: 'fit', format: 'A4', header: 'OrgChart 4' },
|
|
1521
|
+
* ], "test.pdf");
|
|
1522
|
+
* });
|
|
1523
|
+
* ```
|
|
1524
|
+
*/
|
|
1472
1525
|
static exportPDFFromCharts(optionList: Array<{
|
|
1473
1526
|
chartInstance: OrgChart,
|
|
1474
1527
|
margin?: Array<number>,
|
|
@@ -1484,40 +1537,148 @@ declare class OrgChart {
|
|
|
1484
1537
|
nodeId? : number | string
|
|
1485
1538
|
}>, filename?: string, openInNewTab?: boolean, callback?: (arrayBuffer: ArrayBuffer) => void): void;
|
|
1486
1539
|
|
|
1540
|
+
/**
|
|
1541
|
+
* Checks if the screen is mobile
|
|
1542
|
+
* ```typescript
|
|
1543
|
+
* console.log(OrgChart.isMobile());
|
|
1544
|
+
* ```
|
|
1545
|
+
*/
|
|
1487
1546
|
static isMobile(): boolean;
|
|
1488
1547
|
/**
|
|
1489
|
-
* Checks if the used
|
|
1548
|
+
* Checks if the used library is licnsed or not
|
|
1549
|
+
* ```typescript
|
|
1550
|
+
* console.log(OrgChart.isTrial());
|
|
1551
|
+
* ```
|
|
1490
1552
|
*/
|
|
1491
1553
|
static isTrial(): boolean;
|
|
1492
1554
|
/**
|
|
1493
1555
|
* Count all children nodes of the specified id.
|
|
1556
|
+
* ```typescript
|
|
1557
|
+
* let chart = new OrgChart('#tree', {});
|
|
1558
|
+
* chart.onInit(() => {
|
|
1559
|
+
* console.log(OrgChart.childrenCount(chart, chart.getNode(2)))
|
|
1560
|
+
* });
|
|
1561
|
+
* chart.load(nodes)
|
|
1562
|
+
* ```
|
|
1494
1563
|
* @param chart OrgChart instance
|
|
1495
1564
|
* @param node
|
|
1496
1565
|
* @param count
|
|
1497
1566
|
*/
|
|
1498
1567
|
static childrenCount(chart: OrgChart, node: OrgChart.node): number;
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* Count the total (to the leafs) children nodes of the specified id.
|
|
1571
|
+
* ```typescript
|
|
1572
|
+
* let chart = new OrgChart('#tree', {});
|
|
1573
|
+
* chart.onInit(() => {
|
|
1574
|
+
* console.log(OrgChart.childrenTotalCount(chart, chart.getNode(2)))
|
|
1575
|
+
* });
|
|
1576
|
+
* chart.load(nodes)
|
|
1577
|
+
* ```
|
|
1578
|
+
* @param chart OrgChart instance
|
|
1579
|
+
* @param node
|
|
1580
|
+
* @param count
|
|
1581
|
+
*/
|
|
1499
1582
|
static childrenTotalCount(chart: OrgChart, node: OrgChart.node): number;
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* Count the collapsed children nodes of the specified id.
|
|
1586
|
+
* ```typescript
|
|
1587
|
+
* let chart = new OrgChart('#tree', {});
|
|
1588
|
+
* chart.onInit(() => {
|
|
1589
|
+
* console.log(OrgChart.collapsedChildrenCount(chart, chart.getNode(2)))
|
|
1590
|
+
* });
|
|
1591
|
+
* chart.load(nodes)
|
|
1592
|
+
* ```
|
|
1593
|
+
* @param chart OrgChart instance
|
|
1594
|
+
* @param node
|
|
1595
|
+
* @param count
|
|
1596
|
+
*/
|
|
1500
1597
|
static collapsedChildrenCount(chart: OrgChart, node: OrgChart.node): number;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Count the total (to the leafs) collapsed children nodes of the specified id.
|
|
1601
|
+
* ```typescript
|
|
1602
|
+
* let chart = new OrgChart('#tree', {});
|
|
1603
|
+
* chart.onInit(() => {
|
|
1604
|
+
* console.log(OrgChart.collapsedChildrenCount(chart, chart.getNode(2)))
|
|
1605
|
+
* });
|
|
1606
|
+
* chart.load(nodes)
|
|
1607
|
+
* ```
|
|
1608
|
+
* @param chart OrgChart instance
|
|
1609
|
+
* @param node
|
|
1610
|
+
* @param count
|
|
1611
|
+
*/
|
|
1501
1612
|
static collapsedChildrenTotalCount(chart: OrgChart, node: OrgChart.node): number;
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* Get the root node of the specified id.
|
|
1616
|
+
* ```typescript
|
|
1617
|
+
* let chart = new OrgChart('#tree', {});
|
|
1618
|
+
* chart.onInit(() => {
|
|
1619
|
+
* let root = OrgChart.getRootOf(chart.getNode(4));
|
|
1620
|
+
* });
|
|
1621
|
+
* chart.load(nodes)
|
|
1622
|
+
* ```
|
|
1623
|
+
* @param node
|
|
1624
|
+
*/
|
|
1502
1625
|
static getRootOf(node: OrgChart.node): OrgChart.node;
|
|
1503
1626
|
|
|
1504
1627
|
/**
|
|
1505
1628
|
* is null, empty or undefined
|
|
1629
|
+
* ```typescript
|
|
1630
|
+
* console.log(OrgChart.isNEU(any_prmeter))
|
|
1631
|
+
* ```
|
|
1506
1632
|
* @param val
|
|
1507
1633
|
*/
|
|
1508
1634
|
static isNEU(val: any): boolean;
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* Defines gradient circle form array of colors
|
|
1638
|
+
* ```typescript
|
|
1639
|
+
* OrgChart.templates.myTemplate.defs = OrgChart.gradientCircleForDefs('circle', ['#FF0000', '#FFD800'], 60, 10);
|
|
1640
|
+
* ```
|
|
1641
|
+
* @param id - id of the element
|
|
1642
|
+
* @param colors - array of colors
|
|
1643
|
+
* @param r - radius
|
|
1644
|
+
* @param strokeWidth - stroke width
|
|
1645
|
+
*/
|
|
1509
1646
|
static gradientCircleForDefs(id: string | number, colors: Array<string> | string, r: number, strokeWidth: number): string;
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* Convert CSV to nodes
|
|
1650
|
+
* ```typescript
|
|
1651
|
+
* let chart = new OrgChart('#tree', {});
|
|
1652
|
+
* fetch('https://balkan.app/content/data.csv')
|
|
1653
|
+
* .then(response => response.text())
|
|
1654
|
+
* .then(text => {
|
|
1655
|
+
* var nodes = OrgChart.convertCsvToNodes(text);
|
|
1656
|
+
* chart.load(nodes);
|
|
1657
|
+
* });
|
|
1658
|
+
* ```
|
|
1659
|
+
* @param text
|
|
1660
|
+
*/
|
|
1510
1661
|
static convertCsvToNodes(text: string) : Array<Object>;
|
|
1662
|
+
|
|
1511
1663
|
/**
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
* @param commands The SVG input path or commands array
|
|
1515
|
-
* @param radius
|
|
1516
|
-
* @param useFractionalRadius The amount to round the corners, either a value in the SVG coordinate space, or, if useFractionalRadius is true, a value from 0 to 1.
|
|
1517
|
-
* @returns A new SVG path string with the rounding
|
|
1518
|
-
*/
|
|
1664
|
+
* @ignore
|
|
1665
|
+
*/
|
|
1519
1666
|
static roundPathCorners(commands: string | Array<Array<any>>, radius: number, useFractionalRadius: boolean) : string;
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* @ignore
|
|
1670
|
+
*/
|
|
1520
1671
|
static convertNodesToCsv(nodes: Array<Object>) : string;
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* Replace a text in a field
|
|
1675
|
+
* let chart = new OrgChart('#tree', {});
|
|
1676
|
+
* chart.onField(function (args) {
|
|
1677
|
+
* var val = OrgChart.wrapText(args.value, OrgChart.templates.ana.field_1)
|
|
1678
|
+
* args.value = val;
|
|
1679
|
+
* });
|
|
1680
|
+
* chart.load(nodes);
|
|
1681
|
+
*/
|
|
1521
1682
|
static wrapText(text: string, field: Object): string;
|
|
1522
1683
|
|
|
1523
1684
|
static filterUI: {
|