A display XML to image converter. This allows to create an image of a graph without having to parse and create the graph model using the XML file created for the mxGraphView object in the thin client.
var enc = new mxCodec(mxUtils.createXMLDocument()); var node = enc.encode(editor.graph.view); var xml = mxUtils.getXML(node);
mxGraphViewImageReader | A display XML to image converter. |
Variables | |
canvas | Holds the canvas. |
scale | Holds the global scale of the graph. |
parser | Holds the SAX parser. |
background | Holds the background color. |
border | Holds the border size. |
Functions | |
mxGraphViewImageReader | Constructs a new image graph view reader. |
createCanvas | Returns the canvas to be used for rendering. |
read | Reads the specified view XML string. |
readFile | Reads the specified view XML file in blocks of 4096 bytes. |
startElement | Invoked by the SAX parser when an element starts. |
parseState | Parses the bounds, absolute points and label information from the style of the state into its respective fields and returns the label of the cell. |
parsePoints | Parses a string that represents a list of points into an array of mxPoints. |
endElement | Invoked by the SAX parser when an element ends. |
destroy | Destroy all allocated resources for this reader. |
convert | Creates the image for the given display XML string. |
convertFile | Creates the image for the given display XML file. |
function parsePoints( $str )
Parses a string that represents a list of points into an array of mxPoints.
Holds the canvas.
var $canvas
Holds the global scale of the graph.
var $scale
Holds the SAX parser.
var $parser
Holds the background color.
var $background
Holds the border size.
var $border
Constructs a new image graph view reader.
function mxGraphViewImageReader( $background = null, $border = 0 )
Returns the canvas to be used for rendering.
function createCanvas( $attrs )
Reads the specified view XML string.
function read( $string )
Reads the specified view XML file in blocks of 4096 bytes.
function readFile( $filename )
Invoked by the SAX parser when an element starts.
function startElement( $parser, $name, $attrs )
Parses the bounds, absolute points and label information from the style of the state into its respective fields and returns the label of the cell.
function parseState( $state, $edge )
Parses a string that represents a list of points into an array of mxPoints.
function parsePoints( $str )
Invoked by the SAX parser when an element ends.
function endElement( $parser, $name )
Destroy all allocated resources for this reader.
function destroy()
Creates the image for the given display XML string.
static function convert( $string, $background = null )
Creates the image for the given display XML file.
static function convertFile( $filename, $background = null )