Skip to content

ele.numericStyle(name)

eles.numericStyle — Collection > Style. Cytoscape.js signatures, parameters and return contract.

eles.numericStyle — Collection › Style

Preview · Collection › Style

Read in the complete API reference · All API members

// The numeric value of a numeric style prop
ele.numericStyle(name: string): number | undefined

The numeric value of a numeric style prop.

Parameters
NameDescription
name: string

a numeric style property

Returns number | undefined

the number, or undefined when the collection is empty or the prop belongs to the other group

Example

console.log(cy.nodes().first().numericStyle('width')); // 30

Example graph and handle setup

Throws

if the prop resolves to a colour or a keyword rather than a number