Get elements in the graph matching the specified selector. http://js.cytoscape.org/#cy.$
Get an element from its ID in a very performant way. http://js.cytoscape.org/#cy.getElementById
Add elements to the graph and return them.
Optional
selector: stringOptional
data: anyAnimate the viewport. http://js.cytoscape.org/#cy.animate
An object containing the details of the animation.
Optional
options: AnimateOptionsAn object containing animation options.
Get whether the viewport is currently being animated. http://js.cytoscape.org/#cy.animated
Get an animation of the viewport. http://js.cytoscape.org/#cy.animation
Get the entire data object or a particular data field.
Optional
name: stringThe name of the field to get. Get the entire data object
Set a particular data field.
The name of the field to set.
The value to set for the field.
Update multiple data fields at once via an object.
The object containing name-value pairs to update data fields.
Get whether nodes are automatically locked (i.e. if true, nodes are locked despite their individual state). http://js.cytoscape.org/#cy.autolock
Set whether nodes are automatically locked (i.e. if true, nodes are locked despite their individual state). http://js.cytoscape.org/#cy.autolock
Optional
bool: booleanA truthy value enables autolocking; a falsey value disables it.
Get whether nodes are automatically ungrabified (i.e. if true, nodes are ungrabbale despite their individual state). http://js.cytoscape.org/#cy.autoungrabify
Set whether nodes are automatically ungrabified (i.e. if true, nodes are ungrabbale despite their individual state). http://js.cytoscape.org/#cy.autoungrabify
Optional
bool: booleanA truthy value enables autolocking; a falsey value disables it.
Get whether nodes are automatically unselectified (i.e. if true, nodes are unselectable despite their individual state). http://js.cytoscape.org/#cy.autounselectify
Set whether nodes are automatically unselectified (i.e. if true, nodes are unselectable despite their individual state). http://js.cytoscape.org/#cy.autounselectify
Optional
bool: booleanA truthy value enables autolocking; a falsey value disables it.
Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. http://js.cytoscape.org/#cy.batch A callback within which you can make batch updates to elements.
Optional
selector: stringOptional
data: anyGet whether box selection is enabled. If enabled, the user must hold left-click to initiate panning. http://js.cytoscape.org/#cy.boxSelectionEnabled
Set whether box selection is enabled. If enabled, the user must hold left-click to initiate panning. http://js.cytoscape.org/#cy.boxSelectionEnabled
Optional
bool: booleanA truthy value enables box selection; a falsey value disables it.
Pan the graph to the centre of a collection.
Optional
eles: CollectionArgumentThe collection to centre upon.
Pan the graph to the centre of a collection.
Optional
eles: CollectionArgumentThe collection to centre upon.
Remove all queued animations for the viewport. http://js.cytoscape.org/#cy.clearQueue
Get a collection from elements in the graph matching the specified selector or from an array of elements. If no parameter specified, an empty collection will be returned
Optional
eles: string | CollectionArgument[]Get the entire data object or a particular data field.
Optional
name: stringThe name of the field to get.
Set a particular data field.
The name of the field to set.
The value to set for the field.
Update multiple data fields at once via an object.
The object containing name-value pairs to update data fields.
Get a delay animation of the viewport. http://js.cytoscape.org/#cy.delayAnimation
A convenience function to explicitly destroy the Core. http://js.cytoscape.org/#cy.destroy
Get whether the instance of Cytoscape.js has been destroyed or not. https://js.cytoscape.org/#cy.destroyed
Get edges in the graph matching the specified selector.
Optional
selector: stringGet elements in the graph matching the specified selector. http://js.cytoscape.org/#cy.$
Optional
selector: stringAllow for manipulation of elements without triggering multiple style calculations or multiple redraws. http://js.cytoscape.org/#cy.batch
Ends batching manually (useful for asynchronous cases).
Get the extent of the viewport, a bounding box in model coordinates that lets you know what model positions are visible in the viewport. http://js.cytoscape.org/#cy.extent
Get elements in the graph matching the specified selector or filter function.
Pan and zooms the graph to fit to a collection. http://js.cytoscape.org/#cy.fit
Optional
eles: CollectionArgument[optional] The collection to fit to.
Optional
padding: number[optional] An amount of padding (in pixels) to have around the graph
Force the renderer to redraw (i.e. draw a new frame).
This function forces the renderer to draw a new frame. It is useful for very specific edgecases, such as in certain UI plugins, but it should not be needed for most developers. http://js.cytoscape.org/#cy.forceRender
Get an element from its ID in a very performant way. http://js.cytoscape.org/#cy.getElementById
Get the on-screen height of the viewport in pixels. http://js.cytoscape.org/#cy.height
Export the current graph view as a JPG image in Base64 representation.
Optional
options: ExportJpgStringOptionsOptional
options: ExportJpgBlobOptionsOptional
options: ExportJpgBlobPromiseOptionsExport the current graph view as a JPG image in Base64 representation.
Optional
options: ExportJpgStringOptionsOptional
options: ExportJpgBlobOptionsOptional
options: ExportJpgBlobPromiseOptionsRun a layout, which algorithmically positions the nodes in the graph. For layouts included with Cytoscape.js, you can find their options documented in the Layouts section. For external layouts, please refer to their accompanying documentation.
An analogue to run a layout on a subset of the graph exists as eles.layout(). http://js.cytoscape.org/#cy.layout
Optional
selector: stringOptional
data: anyGet a new layout, which can be used to algorithmically position the nodes in the graph.
You must specify options.name with the name of the layout you wish to use.
This function creates and returns a layout object. You may want to keep a reference to the layout for more advanced usecases, such as running multiple layouts simultaneously. Note that you must call layout.run() in order for it to affect the graph. An analogue to make a layout on a subset of the graph exists as eles.makeLayout().
Get the maximum zoom level. http://js.cytoscape.org/#cy.maxZoom
Set the maximum zoom level. http://js.cytoscape.org/#cy.maxZoom
The new maximum zoom level to use.
Get the minimum zoom level. http://js.cytoscape.org/#cy.minZoom
Set the minimum zoom level. http://js.cytoscape.org/#cy.minZoom
The new minimum zoom level to use.
Attaches the instance to the specified container for visualisation. http://js.cytoscape.org/#cy.mount
If the core instance is headless prior to calling cy.mount(), then the instance will no longer be headless and the visualisation will be shown in the specified container. If the core instance is non-headless prior to calling cy.mount(), then the visualisation is swapped from the prior container to the specified container.
Get nodes in the graph matching the specified selector.
Optional
selector: stringRemove event handlers. http://js.cytoscape.org/#cy.off
A space separated list of event names.
Optional
handler: EventHandler[optional] A reference to the handler function to remove.
Optional
handler: EventHandlerOptional
selector: stringBind to events that occur in the graph.
A space separated list of event names.
The handler function that is called when one of the specified events occurs.
Optional
selector: stringOptional
data: anyBind to events that occur in the graph, and trigger the handler only once.
A space separated list of event names.
The handler function that is called when one of the specified events occurs.
Bind to events that occur in the graph, and trigger the handler only once.
A space separated list of event names.
A selector to specify elements for which the handler is triggered.
The handler function that is called when one of the specified events occurs.
Bind to events that occur in the graph, and trigger the handler only once.
A space separated list of event names.
A selector to specify elements for which the handler is triggered.
A plain object which is passed to the handler in the event object argument.
The handler function that is called when one of the specified events occurs.
Bind to events that occur in the graph, and trigger the handler only once.
A map of event names to handler functions.
Optional
selector: stringA selector to specify elements for which the handler is triggered.
Optional
data: anyA plain object which is passed to the handler in the event object argument.
Get the panning position of the graph. http://js.cytoscape.org/#cy.pan
Set the panning position of the graph. http://js.cytoscape.org/#cy.pan
Optional
renderedPosition: PositionThe rendered position to pan the graph to.
Relatively pan the graph by a specified rendered position vector. http://js.cytoscape.org/#cy.panBy
The rendered position vector to pan the graph by.
Get whether panning is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. http://js.cytoscape.org/#cy.panningEnabled
Set whether panning is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. http://js.cytoscape.org/#cy.panningEnabled
Optional
bool: booleanA truthy value enables panning; a falsey value disables it.
Export the current graph view as a PNG image in Base64 representation.
Optional
options: ExportStringOptionsOptional
options: ExportBlobOptionsOptional
options: ExportBlobPromiseOptionsOptional
selector: stringGet a promise that is resolved with the first of any of the specified events triggered on the graph.
A space separated list of event names.
Optional
selector: string[optional] A selector to specify elements for which the handler is triggered.
Run a callback as soon as the graph becomes ready. If the graph is already ready, then the callback is called immediately.
The callback run as soon as the graph is ready, inside which this refers to the core (cy).
Remove elements in collecion or match the selector from the graph and return them.
Remove all event handlers. https://js.cytoscape.org/#cy.removeAllListeners
Remove developer-defined data associated with the elements. https://js.cytoscape.org/#cy.removeData
Optional
names: stringA space-separated list of fields to delete.
Remove developer-defined data associated with the elements. https://js.cytoscape.org/#cy.removeData
Optional
names: stringA space-separated list of fields to delete.
Optional
handler: EventHandlerOptional
handler: EventHandlerOptional
selector: stringRemove scratchpad data. You should remove scratchpad data only at your own namespaces. http://js.cytoscape.org/#cy.removeScratch
A namespace string.
Reset the graph to the default zoom level and panning position. http://js.cytoscape.org/#cy.reset
Force the renderer to recalculate the viewport bounds.
If your code resizes the graph's dimensions or position (i.e. by changing the style of the HTML DOM element that holds the graph), you will want to call cy.resize() to have the graph resize and redraw itself.
Cytoscape.js can not automatically monitor the bounding box of the viewport, as querying the DOM for those dimensions can be expensive. Although cy.resize() is automatically called for you on the window's resize event, there is no resize or style event for arbitrary DOM elements. http://js.cytoscape.org/#cy.resize
Set the scratchpad at a particular namespace, where temporary or non-JSON data can be stored. App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'.
If no parameter provided, the entire scratchpad will be returned. If only namespace provided, the scratchpad with the namespace will be returned.
Optional
namespace: stringA namespace string.
Get the selection type. http://js.cytoscape.org/#cy.selectionType
Set the selection type. http://js.cytoscape.org/#cy.selectionType
The selection type string; one of 'single' (default) or 'additive'.
Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. http://js.cytoscape.org/#cy.batch
Starts batching manually (useful for asynchronous cases).
Stop all viewport animations that are currently running. http://js.cytoscape.org/#cy.stop
Optional
clearQueue: booleanA boolean, indicating whether the queue of animations should be emptied.
Optional
jumpToEnd: booleanA boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway.
Assign a new stylesheet to replace the existing one (if provided) and return the style.
Optional
sheet: string | Stylesheet | Stylesheet[]Optional
handler: EventHandlerOptional
handler: EventHandlerOptional
selector: stringOptional
handler: EventHandlerOptional
handler: EventHandlerOptional
selector: stringRemove the instance from its current container. http://js.cytoscape.org/#cy.unmount
This function sets the instance to be headless after unmounting from the current container.
Get whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. http://js.cytoscape.org/#cy.userPanningEnabled
Set whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. http://js.cytoscape.org/#cy.userPanningEnabled
Optional
bool: booleanA truthy value enables user panning; a falsey value disables it.
Get whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) is enabled. http://js.cytoscape.org/#cy.userZoomingEnabled
Get or set whether zooming by user events get if no parameter provided (e.g. mouse wheel, pinch-to-zoom) is enabled. http://js.cytoscape.org/#cy.userZoomingEnabled
Optional
bool: booleanA truthy value enables user zooming; a falsey value disables it.
Set the viewport state (pan & zoom) in one call. http://js.cytoscape.org/#cy.viewport
Get the on-screen width of the viewport in pixels. http://js.cytoscape.org/#cy.width
Get the zoom level. http://js.cytoscape.org/#cy.zoom
Set the zoom level. http://js.cytoscape.org/#cy.zoom
Optional
level: ZoomOptionsThe zoom level to set.
Set or get whether zooming is enabled. Get if no parameter provided. http://js.cytoscape.org/#cy.zoomingEnabled
Optional
bool: booleanA truthy value enables zooming; a falsey value disables it.
cy --> Cy.Core The core object is your interface to a graph.
It is your entry point to Cytoscape.js: All of the library’s features are accessed through this object. http://js.cytoscape.org/#core