Skip to content

ele.padding()

eles.padding — Collection > Position and dimensions. Cytoscape.js signatures, parameters and return contract.

eles.padding — Collection › Position and dimensions

Preview · Collection › Position and dimensions

Read in the complete API reference · All API members

// Node padding
ele.padding(): number | undefined

Node padding. Leaves have no padding (no compound-free padding prop); parents answer the resolved auto-bounds padding.

Returns number | undefined

the resolved padding in model px — 0 for leaves and for any graph with no compounds at all, the derived value for a parent; undefined when the collection is empty

Example

console.log(eles.padding()); // 0

Example graph and handle setup