SVG container for the output
Optional boolean that specifies if a style section should be added.
The style section sets the default font-size, font-family and stroke-miterlimit globally.
Default is false
.
Specifies if offsetWidth and offsetHeight should be cached. This is used to speed up repaint of text in updateText.
Holds the operator for closing curves.
Contains the string used for bezier curves.
Reference to the defs section of the SVG document. Only for export.
Specifies the fallback text for unsupported foreignObjects in exported documents.
If this is set to null
then no fallback text is added to the exported document.
Specifies if use of foreignObject for HTML markup is allowed.
Offset to be used for foreignObjects.
Padding to be added for text that is not wrapped to account for differences in font metrics on different platforms in pixels.
Local cache of gradients for quick lookups.
Offset to be used for image elements.
Holds the last x coordinate.
Holds the last y coordinate.
Correction factor for mxConstants.LINE_HEIGHT in HTML output.
Contains the string used for moving in paths.
Specifies if plain text output should match the vertical HTML alignment.
Minimum stroke width for output.
Contains the string used for moving in paths.
Holds the current DOM node.
Holds the current path as an array.
Boolean value that specifies if events should be handled.
Default value for active pointer events.
Contains the string used for quadratic paths.
Local counter for references in SVG export.
Reference to the container for the SVG content.
Switch for rotation of HTML.
Holds the current state.
Stack of states.
Adds transparent paths for strokes.
Stores the value of styleEnabled passed to the constructor.
Specifies if text output should be enabled.
Offset to be used for text elements.
Creates a foreignObject for the given string and adds it to the given root.
Private helper function to create SVG elements
Adds the given operation to the path.
Background color and border
Adds the given arc to the current path. This is a synthetic operation that is broken down into curves.
Extends superclass to create path.
Closes the current path.
Note: the mxGraph JS code declares arguments (x1: number, y1: number, x2: number, y2: number, x3: number, y3: number) which are not used in the abstract implementation. The mxXmlCanvas2D JS implementation overrides this method without arguments. Decision is then taken to remove them here.
Converts the given HTML string to XHTML.
Returns the alternate content for the given foreignObject.
Creates a clip for the given coordinates.
Updates existing DOM nodes for text rendering.
Creates the SVG dash pattern for the given state.
Private helper function to create SVG elements Note: signature changed in mxgraph 4.1.0
Private helper function to create SVG elements
Private helper function to create SVG elements
Creates a shadow for the given node.
Creates the state of the this canvas.
Creates the optional style section.
Creates the given SVG gradient.
Creates a hit detection tolerance shape for the given node.
Create a new mxUrlConverter and returns it.
Adds a bezier curve to the current path.
Private helper function to create SVG elements
Empty implementation for backwards compatibility. This will be removed.
Fills the current path.
Fills and paints the outline of the current path.
Rounds all numbers to 2 decimal points.
Returns the alternate text string for the given foreignObject.
Returns the URL of the page without the hash part. This needs to use href to include any search part with no params (ie question mark alone). This is a workaround for the fact that window.location.search is empty if there is no search string behind the question mark.
Returns the current stroke width (>= 1), ie. max(1, this.format(this.state.strokeWidth * this.state.scale)).
Private helper function to create SVG elements
Private helper function to create SVG elements
Private helper function to create SVG elements
Draws a line to the given coordinates. Uses moveTo with the op argument.
Moves the current path the given coordinates.
Paints the given text. Possible values for format are empty string for plain text and html for HTML markup.
Adds a quadratic curve to the current path.
Private helper function to create SVG elements
Returns any offsets for rendering pixels.
Restores the current state.
Sets the rotation of the canvas. Note that rotation cannot be concatenated.
Rotates the given point and returns the result as an
Private helper function to create SVG elements
Saves the current state.
Scales the current state.
Sets the current alpha.
Sets the current dash pattern.
Enables or disables dashed lines.
specifies whether or not the lines are dashed
specifies whether or not the lines use fix dash
Sets the current solid fill alpha.
Sets the current fill color.
Sets the current font color.
Sets the current font color.
Sets the current font color.
Sets the current font family.
Sets the current font size.
Sets the current font style.
Sets the current gradient.
Sets the current line cap.
Sets the current line join.
Experimental implementation for hyperlinks.
Sets the current miter limit.
Enables or disables and configures the current shadow.
Enables or disables and configures the current shadow.
Enables or disables and configures the current shadow.
Enables or disables and configures the current shadow.
Sets the current stroke alpha.
Sets the current stroke color.
Sets the current stroke width.
Paints the outline of the current path.
Paints the given text. Possible values for format are empty string for plain
text and html for HTML markup. Note that HTML markup is only supported if
foreignObject is supported and
Translates the current state.
Transfers the stroke attributes from
Updates the text properties for the given node. (NOTE: For this to work in IE, the given node must be a text or tspan element.)
Transfers the stroke attributes from mxAbstractCanvas2D.state to node.
Transfers the stroke attributes from mxAbstractCanvas2D.state to node.
Updates existing DOM nodes for text rendering. LATER: Merge common parts with text function below.
Updates existing DOM nodes for text rendering.
Generated using TypeDoc
Extends mxAbstractCanvas2D to implement a canvas for SVG. This canvas writes all calls as SVG output to the given SVG root node.
To disable anti-aliasing in the output, use the following code.
Or set the respective attribute in the SVG element directly.