Custom encoder for mxGraphViews. This class is created and registered dynamically at load time and used implicitly 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.
|codec.encode = function(||enc,|
Encodes the given mxGraphView using encodeCell starting at the model’s root. This returns the top-level graph node of the recursive encoding.
|codec.encodeCell = function(||enc,|
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.