An abstraction for creating VML and SVG paths. See mxActor for using this object inside an mxShape for painting cells.
mxPath | An abstraction for creating VML and SVG paths. |
Functions | |
mxPath | Constructs a path for the given format, which is one of svg or vml. |
Variables | |
format | Defines the format for the output of this path. |
translate | mxPoint that specifies the translation of the complete path. |
scale | Number that specifies the translation of the path. |
path | Contains the textual representation of the path as an array. |
Functions | |
isVml | Returns true if format is vml. |
getPath | Returns string that represents the path in format. |
setTranslate | Set the global translation of this path, that is, the origin of the coordinate system. |
moveTo | Moves the cursor to (x, y). |
lineTo | Draws a straight line from the current poin to (x, y). |
quadTo | Draws a quadratic Bézier curve from the current point to (x, y) using (x1, y1) as the control point. |
curveTo | Draws a cubic Bézier curve from the current point to (x, y) using (x1, y1) as the control point at the beginning of the curve and (x2, y2) as the control point at the end of the curve. |
ellipse | Adds the given ellipse. |
addPath | Adds the given path. |
write | Writes directly into the path. |
end | Ends the path. |
close | Closes the path. |
function mxPath( format )
Constructs a path for the given format, which is one of svg or vml.
format | String specifying the format. May be one of vml or svg (default). |
mxPath.prototype.translate
mxPoint that specifies the translation of the complete path.
mxPath.prototype.isVml = function()
Returns true if format is vml.
mxPath.prototype.getPath = function()
Returns string that represents the path in format.
mxPath.prototype.curveTo = function( x1, y1, x2, y2, x, y )
Draws a cubic Bézier curve from the current point to (x, y) using (x1, y1) as the control point at the beginning of the curve and (x2, y2) as the control point at the end of the curve.
x1 | X-coordinate of the first control point. |
y1 | Y-coordinate of the first control point. |
x2 | X-coordinate of the second control point. |
y2 | Y-coordinate of the second control point. |
x | X-coordinate of the endpoint. |
y | Y-coordinate of the endpoint. |
Constructs a path for the given format, which is one of svg or vml.
function mxPath( format )
Defines the format for the output of this path.
mxPath.prototype.format
mxPoint that specifies the translation of the complete path.
mxPath.prototype.translate
Number that specifies the translation of the path.
mxPath.prototype.scale
Contains the textual representation of the path as an array.
mxPath.prototype.path
Returns true if format is vml.
mxPath.prototype.isVml = function()
Returns string that represents the path in format.
mxPath.prototype.getPath = function()
Set the global translation of this path, that is, the origin of the coordinate system.
mxPath.prototype.setTranslate = function( x, y )
Moves the cursor to (x, y).
mxPath.prototype.moveTo = function( x, y )
Draws a straight line from the current poin to (x, y).
mxPath.prototype.lineTo = function( x, y )
Draws a quadratic Bézier curve from the current point to (x, y) using (x1, y1) as the control point.
mxPath.prototype.quadTo = function( x1, y1, x, y )
Draws a cubic Bézier curve from the current point to (x, y) using (x1, y1) as the control point at the beginning of the curve and (x2, y2) as the control point at the end of the curve.
mxPath.prototype.curveTo = function( x1, y1, x2, y2, x, y )
Adds the given ellipse.
mxPath.prototype.ellipse = function( x, y, w, h )
Adds the given path.
mxPath.prototype.addPath = function( path )
Writes directly into the path.
mxPath.prototype.write = function( string )
Ends the path.
mxPath.prototype.end = function()
Closes the path.
mxPath.prototype.close = function()