// The rendered width in CSS px
cy.width(): numberThe rendered width in CSS px. Headless instances report the configured headlessWidth (default 800), so viewport maths works without a DOM.
Returns
numberthe viewport width in CSS px
cy.width — Core > Viewport manipulation > Pan, zoom, fit and bounds. Cytoscape.js signatures, parameters and return contract.
cy.width — 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
// The rendered width in CSS px
cy.width(): numberThe rendered width in CSS px. Headless instances report the configured headlessWidth (default 800), so viewport maths works without a DOM.
numberthe viewport width in CSS px