Skip to content

eles.jsons()

eles.jsons — Collection > Metadata and identity. Cytoscape.js signatures, parameters and return contract.

eles.jsons — Collection › Metadata and identity

Preview · Collection › Metadata and identity

Read in the complete API reference · All API members

// Plain-object form of every element
eles.jsons(): (Record<string, unknown> | undefined)[]

Plain-object form of every element.

Returns (Record<string, unknown> | undefined)[]

one object per element, in collection order — the plural of json(), not a graph-level export

Example

console.log(eles.jsons().map(def => def.data.id)); // ['a', 'b', 'c', 'ab', 'bc']

Example graph and handle setup