mxGraphViewCodec

Custom encoder for mxGraphViews.  This class is created and registered dynamically at load time and used implicitely via mxCodec and the mxCodecRegistry.  This codec only writes views into a XML format that can be used to create an image for the graph, that is, it contains absolute coordinates with computed perimeters, edge styles and cell styles.

Summary
mxGraphViewCodecCustom encoder for mxGraphViews.
Functions
encodeEncodes the given mxGraphView using encodeCell starting at the model’s root.
encodeCellRecursively encodes the specifed cell.

Functions

encode

codec.encode = function(enc,
view)

Encodes the given mxGraphView using encodeCell starting at the model’s root.  This returns the top-level graph node of the recursive encoding.

encodeCell

codec.encodeCell = function(enc,
view,
cell)

Recursively encodes the specifed cell.  Uses layer as the default nodename.  If the cell’s parent is null, then graph is used for the nodename.  If mxGraphModel.isEdge returns true for the cell, then edge is used for the nodename, else if mxGraphModel.isVertex returns true for the cell, then vertex is used for the nodename.

mxGraph.getLabel is used to create the label attribute for the cell.  For graph nodes and vertices the bounds are encoded into x, y, width and height.  For edges the points are encoded into a points attribute as a space-separated list of comma-separated coordinate pairs (eg. x0,y0 x1,y1 ... xn,yn).  All values from the cell style are added as attribute values to the node.

Extends mxEventSource to implement a view for a graph.
codec.encode = function(enc,
view)
Encodes the given mxGraphView using encodeCell starting at the model’s root.
codec.encodeCell = function(enc,
view,
cell)
Recursively encodes the specifed cell.
XML codec for JavaScript object graphs.
Singleton class that acts as a global registry for codecs.
mxGraphModel.prototype.isEdge = function(cell)
Returns true if the given cell is an edge.
mxGraphModel.prototype.isVertex = function(cell)
Returns true if the given cell is a vertex.
mxGraph.prototype.getLabel = function(cell)
Returns a string or DOM node that represents the label for the given cell.
Close