Add ElementsDefinition to cy.add() (#50126)

According to https://js.cytoscape.org/#cy.add
> If plain element objects are used, then the same format used at initialisation must be followed.

And according to https://js.cytoscape.org/#notation/elements-json
> The elements JSON may alternatively be in the following format, keyed by group

Also, tested and working with cytoscape@3.17.0
This commit is contained in:
Leonidas Arvanitis
2020-12-16 16:58:01 +02:00
committed by GitHub
parent 1ef5e11b8f
commit 260c5bdff4

View File

@@ -398,7 +398,7 @@ declare namespace cytoscape {
/**
* Add elements to the graph and return them.
*/
add(eles: ElementDefinition | ElementDefinition[] | CollectionArgument): CollectionReturnValue;
add(eles: ElementDefinition | ElementDefinition[] | ElementsDefinition | CollectionArgument): CollectionReturnValue;
/**
* Remove elements in collecion or match the selector from the graph and return them.