-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added method removeArrowsBetweenItems
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
* | ||
* Class to easily draw lines to connect items in the vis Timeline module. | ||
* | ||
* @version 4.3.2 | ||
* @date 2024-01-17 | ||
* @version 4.4.0 | ||
* @date 2024-02-3 | ||
* | ||
* @copyright (c) Javi Domenech ([email protected]) | ||
* | ||
|
@@ -352,6 +352,23 @@ export default class Arrow { | |
return listOfRemovedArrows; | ||
} | ||
|
||
/** | ||
* Removes the arrows between item 1 and item 2. | ||
* @param {VisIdType} itemId1 item id | ||
* @param {VisIdType} itemId2 item id | ||
* @returns {(ArrowIdType)[]} id of the removed arrow | ||
*/ | ||
removeArrowsBetweenItems(itemId1, itemId2) { | ||
let listOfRemovedArrows = []; | ||
let ArrowsToDelete = this._dependency.filter(dep => (dep.id_item_1 == itemId1 && dep.id_item_2 == itemId2) ) | ||
ArrowsToDelete.forEach(dep => { | ||
listOfRemovedArrows.push(dep.id); | ||
this.removeArrow(dep.id) | ||
}) | ||
return listOfRemovedArrows | ||
} | ||
|
||
|
||
/** | ||
* For backward compatibility | ||
* @deprecated use the removeItemArrows method instead. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters