Skip to content

cy.size()

cy.size — Core > Viewport manipulation > Pan, zoom, fit and bounds. Cytoscape.js signatures, parameters and return contract.

cy.size — Core › Viewport manipulation › Pan, zoom, fit and bounds

Preview · Core › Viewport manipulation › Pan, zoom, fit and bounds

Read in the complete API reference · All API members

// Rendered dimensions as { width, height }
cy.size(): { width: number; height: number }

Rendered dimensions as { width, height }.

Returns { width: number; height: number }

Example

console.log(cy.size()); // { width: 800, height: 600 }

Example graph and handle setup