SVGToImage

SVGToImage

new SVGToImage(element)

Constructor takes in the element for later use
Parameters:
Name Type Description
element object The SVG element to convert to an image
Source:

Methods

_inlineImages(callback)

Inlines all images
Parameters:
Name Type Description
callback function The callback to run after images have been loaded and inlined
Source:

_isExternal(url) → {boolean}

Verifies if the supplied URL is external or local
Parameters:
Name Type Description
url string The URL to check
Source:
Returns:
True if the supplied URL is external
Type
boolean

_isValidElement(element) → {boolean}

Validates the provided element is an HTMLElement Source: http://stackoverflow.com/a/384380/3886818
Parameters:
Name Type Description
element mixed The element to validate
Source:
Returns:
True if the provided element is valid
Type
boolean

_toDataURI(options, callback)

Converts the element to a data URI
Parameters:
Name Type Description
options object Configuration options
callback function The callback to run after the element has been converted
Source:

download(name, options)

Downloads the SVG as an image
Parameters:
Name Type Description
name string The name to download the image with
options object The configurable options
Source:

SVGToImage

Used for downloading an SVG DOM element in your browser

Constructor

new SVGToImage()

Source:

Methods

_inlineImages(callback)

Inlines all images
Parameters:
Name Type Description
callback function The callback to run after images have been loaded and inlined
Source:

_isExternal(url) → {boolean}

Verifies if the supplied URL is external or local
Parameters:
Name Type Description
url string The URL to check
Source:
Returns:
True if the supplied URL is external
Type
boolean

_isValidElement(element) → {boolean}

Validates the provided element is an HTMLElement Source: http://stackoverflow.com/a/384380/3886818
Parameters:
Name Type Description
element mixed The element to validate
Source:
Returns:
True if the provided element is valid
Type
boolean

_toDataURI(options, callback)

Converts the element to a data URI
Parameters:
Name Type Description
options object Configuration options
callback function The callback to run after the element has been converted
Source:

download(name, options)

Downloads the SVG as an image
Parameters:
Name Type Description
name string The name to download the image with
options object The configurable options
Source: