Holds the child cells.
Specifies whether the cell is collapsed.
Specifies whether the cell is connectable.
Specifies whether the cell is an edge.
Holds the edges.
Holds the Geometry.
Holds the identifier of the Cell.
Reference to the parent cell.
Reference to the source terminal.
Holds the style of the Cell.
Reference to the target terminal.
Holds the user object.
Specifies whether the cell is a vertex.
Specifies whether the cell is visible.
Returns a clone of the cell.
Uses cloneValue to clone the user object.
All fields in mxTransient are ignored during the cloning.
Returns a clone of the cell's user object.
Visits all cells recursively and applies the specified filter function to each cell. If the function returns true then the cell is added to the resulting array. The parent and result paramters are optional. If parent is not specified then the recursion starts at root.
Example: The following example extracts all vertices from a given model:
var filter(cell)
{
return model.isVertex(cell);
}
var vertices = model.filterDescendants(filter);
JavaScript function that takes an Cell as an argument and returns a boolean.
Returns the specified attribute from the user object if it is an XML node.
Name of the attribute whose value should be returned.
Optional
defaultValue: anyOptional default value to use if the attribute has no value.
Returns the children of the given cell that are vertices and/or edges depending on the arguments.
Boolean indicating if child vertices should be returned. Default is false.
Boolean indicating if child edges should be returned. Default is false.
Returns the number of child cells.
Returns the child edges of the given parent.
Returns the child vertices of the given parent.
Use this method to get the style object to later update it and propagate changes to the view.
See GraphDataModel.setStyle for more details.
Returns all edges of the given cell without loops.
Returns all descendants of the given cell and the cell itself in an array.
Returns the number of incoming or outgoing edges, ignoring the given edge.
Boolean that specifies if the number of outgoing or incoming edges should be returned.
that represents an edge to be ignored.
Returns the number of edges in the edge array.
Returns all distinct edges connected to this cell as a new array of Cell. If at least one of incoming or outgoing is true, then loops are ignored, otherwise if both are false, then all edges connected to the given cell are returned including loops.
Optional boolean that specifies if incoming edges should be returned. Default is true.
Optional boolean that specifies if outgoing edges should be returned. Default is true.
Optional boolean that specifies if loops should be returned. Default is true.
Returns the Id of the cell as a string.
Returns the incoming edges of the given cell without loops.
Returns the index of the specified child in the child array.
Child whose index should be returned.
Returns the outgoing edges of the given cell without loops.
Returns the cell's parent.
Returns the root of the model or the topmost parent of the given cell.
Returns a string that describes the style.
IMPORTANT: if you want to get the style object to later update it and propagate changes to the view, use getClonedStyle instead.
Returns the source or target terminal.
Boolean that specifies if the source terminal should be returned.
Returns the user object of the cell. The user
object is stored in
Returns true if the user object is an XML node that contains the given attribute.
Name nameName of the attribute.
Returns true if the given parent is an ancestor of the given child. Note returns true if child == parent.
that specifies the child.
Returns true if the cell is collapsed.
Returns true if the cell is connectable.
Returns true if the cell is an edge.
Returns true if the cell is a vertex.
Returns true if the cell is visibile.
Removes the child at the specified index from the child array and returns the child that was removed. Will remove the parent reference of the child.
Removes the cell from its parent.
Removes the edge from its source or target terminal.
Boolean that specifies if the edge should be removed from its source or target terminal.
Sets the specified attribute on the user object if it is an XML node.
Name of the attribute whose value should be set.
New value of the attribute.
Sets the collapsed state.
Boolean that specifies the new collapsed state.
Sets the connectable state.
Boolean that specifies the new connectable state.
Specifies if the cell is an edge. This should only be assigned at construction of the cell and not be changed during its lifecycle.
Boolean that specifies if the cell is an edge.
Sets the Id of the cell to the given string.
Sets the user object of the cell. The user object
is stored in
Specifies if the cell is a vertex. This should only be assigned at construction of the cell and not be changed during its lifecycle.
Boolean that specifies if the cell is a vertex.
Specifies if the cell is visible.
Boolean that specifies the new visible state.
Changes the user object after an in-place edit and returns the previous value. This implementation replaces the user object with the given value and returns the old user object.
Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph.
Custom attributes
For custom attributes we recommend using an XML node as the value of a cell. The following code can be used to create a cell with an XML node as the value:
For the label to work, graph.convertValueToString and graph.cellLabelChanged should be overridden as follows: