Skip to content

cy.emphasize(eles)

cy.emphasize — Core > Emphasis. Cytoscape.js signatures, parameters and return contract.

cy.emphasize — Core › Emphasis

Preview · Core › Emphasis

Read in the complete API reference · All API members

// Emphasize the given elements and dim the rest of the graph
cy.emphasize(eles: Collection): this

Emphasize the given elements and dim the rest of the graph. Use a node's neighbourhood to highlight a local part of the network.

Emphasized elements match { emphasized: true } in queries and style conditions. The rest are composited using the core's dim-opacity (default 0.15), while emphasized elements appear above them at full opacity. Dimming does not change individual element style values.

Parameters
NameDescription
eles: Collection

the elements to emphasize, from this instance

Returns this

this core, for chaining

Example

cy.emphasize(cy.getElementById('a').closedNeighborhood());
console.log(cy.getElementById('b').emphasized()); // true

Example graph and handle setup

Throws

when eles is not a collection, or is one from another instance