Skip to content

@graphty/cytoscape-extensions / index / toSnapshot

Function: toSnapshot() ​

toSnapshot(eles, options?): CytoscapeSnapshot

Defined in: cytoscape-extensions/src/snapshot.ts:165

Builds (or returns the cached) snapshot of a collection. The cache holds one snapshot per option set per core and is dropped when an element is added, removed, moved to other endpoints, or has its data changed.

Parameters ​

eles ​

NodeCollection | EdgeCollection | Collection<SingularElementReturnValue, SingularElementArgument>

the collection to read: its nodes, and its edges whose endpoints are both in it

options? ​

SnapshotOptions = {}

directed flag and weight field

Returns ​

CytoscapeSnapshot

the snapshot and the element arrays its indices refer to