File svg/svg.js


file svg/svg.js

Class Summary
This class provides a point-of-access for manipulating an SVG canvas as created by mathnetics.svg.attach.

Variable Summary
public static String errorClass
The class name to give to elements when SVG not supported; defaults to "svg_error"
public String markerClass
The class name to give to SVG-containing elements; defaults to "SVGDoc"
public static String notSupportedText
The text to display when a browser does not support SVG; defaults to "Sorry, your browser does not support SVG."
public static String svgNS
The SVG namespace you wish to use; defaults to standard "http://www.w3.org/2000/svg"

Function Summary
public static void addExtension (String name, Function extClass)
Adds an extension to all Mathnetics SVG canvases; see Plot.js for usage example.
public static void attach (DOMElement container, [Object settings])
Attaches an SVG canvas to a given DIV element.
public static mathnetics.svg.SVGWrapper get (String id)
Returns the mathnetics.svg.SVGWrapper attached to a given element.

Variable Details

variable public static String errorClass

The class name to give to elements when SVG not supported; defaults to "svg_error"

variable public String markerClass

The class name to give to SVG-containing elements; defaults to "SVGDoc"

variable public static String notSupportedText

The text to display when a browser does not support SVG; defaults to "Sorry, your browser does not support SVG."

variable public static String svgNS

The SVG namespace you wish to use; defaults to standard "http://www.w3.org/2000/svg"

Function Details

function addExtension

public static void addExtension(String name, Function extClass)
Adds an extension to all Mathnetics SVG canvases; see Plot.js for usage example.
Parameters:
name
extClass

function attach

public static void attach(DOMElement container, [Object settings])
Attaches an SVG canvas to a given DIV element. Access the attached canvas with mathnetics.svg.get.
Parameters:
container - the element in which to place the SVG canvas
[settings] - object literal; onLoad provides a function to perform once canvas loaded, initPath for IE to blank.svg

function get

public static mathnetics.svg.SVGWrapper get(String id)
Returns the mathnetics.svg.SVGWrapper attached to a given element.
Parameters:
id - the "id" attribute of the element to which the canvas is attached
Returns:
the associated SVGWrapper; null if none exists