Skip to content
  1. API

StyleClass

Represents a visual class that can be applied to nodes and edges.

styleClass.add(elements)

Add the class to the specified node(s)/edge(s). Equivalent to to elements.addClass(myClass.getName()).

Arguments

styleClass.clearEdges([filter])

Remove the class from all edges.

Arguments

  • filter(optional) Filter Filter to apply to edges

styleClass.clearNodes([filter])

Remove the class from all nodes.

Arguments

  • filter(optional) Filter Filter to apply to nodes

styleClass.destroy()

Remove the class from all nodes and edges and delete it.

Returns

  • Promise<void>

styleClass.getDefinition()

Returns the node and edge attributes associated with the class.

Returns

styleClass.getEdges([filter])

Returns the list of edges that have the class. Does not include filtered edges.

Arguments

  • filter(optional) Filter Filter to apply to edges

Returns

styleClass.getIndex()

Returns the index of the class in the internal class array. A higher index class is applied after a lower index class.

Returns

  • number

styleClass.getName()

Returns the name of the class.

Returns

  • string

styleClass.getNodes(Filter)

Returns the list of nodes that have the class. Does not include filtered nodes.

Arguments

  • Filter [filter] filter to apply to nodes

Returns

styleClass.remove(elements)

Remove the class from the specified node(s)/edge(s). Equivalent to to elements.removeClass(myClass.getName()).

Arguments

styleClass.setIndex(index)

Set the index of the class in the internal class array. A higher index class is applied after a lower index class.

Arguments

  • index number

styleClass.update(options)

Updates the attributes assigned to nodes and edges that have that class.

Arguments