Skip to content

Commit

Permalink
Add method getIdArrows
Browse files Browse the repository at this point in the history
  • Loading branch information
javdome committed Feb 5, 2024
1 parent c1c1f6e commit 2726d18
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ For instance:
myArrow.getArrow(2);
```

**getIdArrows ()** Returns the list of Id arrows

For instance:

```javascript
myArrow.getIdArrows();
```

**addArrow ( *arrow object* )** Inserts a new arrow.

For instance:
Expand Down
12 changes: 11 additions & 1 deletion arrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Class to easily draw lines to connect items in the vis Timeline module.
*
* @version 4.4.0
* @version 4.5.0
* @date 2024-02-3
*
* @copyright (c) Javi Domenech ([email protected])
Expand Down Expand Up @@ -312,6 +312,16 @@ export default class Arrow {
getArrow(id) {
return this._dependency.find(dep => dep.id === id) ?? null;
}


/**
* Get all Id arrows.
*
* @return {(ArrowIdType)[]} list of id arrows
*/
getIdArrows() {
return this._dependency.map(dep => dep.id);
}

/**
* Finds arrow with the given id and removes it.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timeline-arrows",
"version": "4.4.0",
"version": "4.5.0",
"description": "Package to easily draw lines to connect items in the vis Timeline module.",
"main": "arrow.js",
"types": "arrow.d.ts",
Expand Down

0 comments on commit 2726d18

Please sign in to comment.