Skip to content

Commit 2726d18

Browse files
committed
Add method getIdArrows
1 parent c1c1f6e commit 2726d18

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ For instance:
9595
myArrow.getArrow(2);
9696
```
9797

98+
**getIdArrows ()** Returns the list of Id arrows
99+
100+
For instance:
101+
102+
```javascript
103+
myArrow.getIdArrows();
104+
```
105+
98106
**addArrow ( *arrow object* )** Inserts a new arrow.
99107

100108
For instance:

arrow.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Class to easily draw lines to connect items in the vis Timeline module.
66
*
7-
* @version 4.4.0
7+
* @version 4.5.0
88
* @date 2024-02-3
99
*
1010
* @copyright (c) Javi Domenech (javdome@gmail.com)
@@ -312,6 +312,16 @@ export default class Arrow {
312312
getArrow(id) {
313313
return this._dependency.find(dep => dep.id === id) ?? null;
314314
}
315+
316+
317+
/**
318+
* Get all Id arrows.
319+
*
320+
* @return {(ArrowIdType)[]} list of id arrows
321+
*/
322+
getIdArrows() {
323+
return this._dependency.map(dep => dep.id);
324+
}
315325

316326
/**
317327
* Finds arrow with the given id and removes it.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timeline-arrows",
3-
"version": "4.4.0",
3+
"version": "4.5.0",
44
"description": "Package to easily draw lines to connect items in the vis Timeline module.",
55
"main": "arrow.js",
66
"types": "arrow.d.ts",

0 commit comments

Comments
 (0)