@balkangraph/orgchart.js 8.14.80 → 8.14.81

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 CHANGED
@@ -127,24 +127,16 @@ declare class OrgChart {
127
127
  */
128
128
  canUpdateLink(id: string | number, pid: string | number): boolean;
129
129
 
130
- /**
131
- * Removes specified node from nodes collection, redraws the chart and fires remove event.
132
- * ```typescript
133
- * var chart = new OrgChart('#tree', {});
134
- * chart.removeNode(2);
135
- * ```
136
- * @param id identification number of the node
137
- * @param callback called at the end of animation
138
- * @param fireEvent indicates if the remove event will be called or not
139
- */
140
- removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
141
-
142
-
143
-
144
-
145
130
 
146
131
  /**
147
132
  * The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *
133
+ * ```typescript
134
+ * let chart = new OrgChart('#tree', {});
135
+ * chart.on('init', function () {
136
+ * // console.log("initiated")
137
+ * })
138
+ * chart.load(nodes);
139
+ * ```
148
140
  * @category Event Listeners
149
141
  * @param type A case-sensitive string representing the event type to listen for.
150
142
  * @param listener The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
@@ -153,6 +145,15 @@ declare class OrgChart {
153
145
 
154
146
  /**
155
147
  * 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.
148
+ * let chart = new OrgChart('#tree', {});
149
+ * let listener = function(sender, args){
150
+ * console.log(sender.removeListener('update', listener));
151
+ * };
152
+ * chart.on('update', listener);
153
+ * chart.load(nodes)
154
+ };
155
+
156
+ family.on('update', listener);
156
157
  * @param type A string which specifies the type of event for which to remove an event listener
157
158
  * @param listener The event listener function of the event handler to remove from the event target
158
159
  */
@@ -195,8 +196,6 @@ declare class OrgChart {
195
196
  onUpdated(): OrgChart;
196
197
 
197
198
 
198
-
199
-
200
199
  /**
201
200
  * Occurs when a node has been removed by removeNode method.
202
201
  * ```typescript
@@ -293,8 +292,19 @@ declare class OrgChart {
293
292
  event: MouseEvent
294
293
  }) => void): OrgChart;
295
294
 
296
-
295
+ /**
296
+ * All chart nodes
297
+ * ```typescript
298
+ * let chart = new OrgChart('#tree', {});
299
+ * chart.onInit(() => {
300
+ * let nodes = chart.nodes;
301
+ * });
302
+ * chart.load(nodes)
303
+ * ```
304
+ */
297
305
  nodes: { [key in any]: OrgChart.node };
306
+
307
+
298
308
  isVisible: boolean;
299
309
  visibleNodeIds: Array<number | string>;
300
310
 
@@ -344,6 +354,33 @@ declare class OrgChart {
344
354
  * @param data node data
345
355
  */
346
356
  add(data: object): OrgChart;
357
+
358
+ /**
359
+ * Adds new node to the nodes collection, redraws the chart and fires remove event
360
+ * ```typescript
361
+ * let chart = new OrgChart('#tree', {});
362
+ * ...
363
+ * chart.addNode({ id: 1, name: "Denny Curtis", title: "CEO" });
364
+ * ```
365
+ * @param data node data
366
+ * @param callback called at the end of animation
367
+ * @param fireEvent indicates if the add event will be called or not
368
+ */
369
+ addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
370
+
371
+ /**
372
+ * Removes specified node from nodes collection, redraws the chart and fires remove event.
373
+ * ```typescript
374
+ * var chart = new OrgChart('#tree', {});
375
+ * chart.removeNode(2);
376
+ * ```
377
+ * @param id identification number of the node
378
+ * @param callback called at the end of animation
379
+ * @param fireEvent indicates if the remove event will be called or not
380
+ */
381
+ removeNode(id: string | number, callback?: () => void, fireEvent?: boolean): void;
382
+
383
+
347
384
  /**
348
385
  * Gets node data.
349
386
  * ```typescript
@@ -617,18 +654,6 @@ declare class OrgChart {
617
654
  */
618
655
  getNode(nodeId: string | number): OrgChart.node;
619
656
 
620
- /**
621
- * Adds new node to the nodes collection, redraws the chart and fires remove event
622
- * ```typescript
623
- * let chart = new OrgChart('#tree', {});
624
- * ...
625
- * chart.addNode({ id: 1, name: "Denny Curtis", title: "CEO" });
626
- * ```
627
- * @param data node data
628
- * @param callback called at the end of animation
629
- * @param fireEvent indicates if the add event will be called or not
630
- */
631
- addNode(data: object, callback?: () => void, fireEvent?: boolean): void;
632
657
 
633
658
  /**
634
659
  * Sets layout.