Tools for SVG handle on JSON format.
- Copyright:
- 2010 Alexis Deveria, 2010 Jeff Schiller
- License:
- MIT
- Source:
- Copyright:
- 2010 Alexis Deveria, 2010 Pavol Rusnak, 2010 Jeff Schiller, 2021 OptimistikSAS
- License:
- MIT
- Source:
- Copyright:
- 2010 Alexis Deveria, 2010 Jeff Schiller
- License:
- MIT
- Source:
Classes
Methods
(static) svgRootElement svgRootElement the svg node and its children.(svgdoc, dimensions) → {svgRootElement}
Parameters:
Name | Type | Description |
---|---|---|
svgdoc |
Element | window.document |
dimensions |
ArgumentsArray | dimensions of width and height |
- Source:
Returns:
- Type
- svgRootElement
(inner) ffClone(elem) → {Element}
Hack for Firefox bugs where text element features aren't updated or get messed up. See issue 136 and issue 137. This function clones the element and re-selects it.
Parameters:
Name | Type | Description |
---|---|---|
elem |
Element | The (text) DOM element to clone |
- Source:
- To Do:
-
- Test for this bug on load and add it to "support" object instead of browser sniffing
Returns:
Cloned element
- Type
- Element
(inner) findDuplicateGradient(grad) → {SVGGradientElement}
Check if exact gradient already exists.
Parameters:
Name | Type | Description |
---|---|---|
grad |
SVGGradientElement | The gradient DOM element to compare to others |
- Source:
Returns:
The existing gradient if found, null
if not
- Type
- SVGGradientElement
Type Definitions
ChangedIDs
Type:
- PlainObject.<string, string>
- Source:
ExtensionNameFilter(name) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
- Type
- boolean
ExtensionStatus
Type:
- module:svgcanvas.ExtensionMouseDownStatus | module:svgcanvas.ExtensionMouseUpStatus | module:svgcanvas.ExtensionIDsUpdatedStatus | Array.<module:locale.ExtensionLocaleData> | void
- Source:
- Tutorials:
ExtensionVarBuilder(name) → {module:svgcanvas.SvgCanvas#event:ext_addLangData}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the extension |
- Source:
Returns:
- Type
- module:svgcanvas.SvgCanvas#event:ext_addLangData
ImageEmbeddedCallback(result) → {void}
Function to run when image data is found.
Parameters:
Name | Type | Description |
---|---|---|
result |
string | false | Data URL |
- Source:
Returns:
- Type
- void
ImageExportedResults
Type:
Properties:
Name | Type | Description |
---|---|---|
datauri |
string | Contents as a Data URL |
bloburl |
string | May be the empty string |
svg |
string | The SVG contents as a string |
issues |
Array.<string> | The localization messages of |
issueCodes |
Array.<module:svgcanvas.IssueCode> | CanVG issues found with the SVG |
type |
"PNG" | "JPEG" | "BMP" | "WEBP" | "ICO" | The chosen image type |
mimeType |
"image/png" | "image/jpeg" | "image/bmp" | "image/webp" | The image MIME type |
quality |
Float | A decimal between 0 and 1 (for use with JPEG or WEBP) |
exportWindowName |
string | A convenience for passing along a |
- Source:
IssuesAndCodes
Type:
Properties:
Name | Type | Description |
---|---|---|
issueCodes |
Array.<string> | The locale-independent code names |
issues |
Array.<string> | The localized descriptions |
- Source:
PDFExportedResults
Type:
Properties:
Name | Type | Description |
---|---|---|
svg |
string | The SVG PDF output |
output |
string | ArrayBuffer | Blob | window | The output based on the |
outputType |
external:jsPDF.OutputType | |
issues |
Array.<string> | The human-readable localization messages of corresponding |
issueCodes |
Array.<module:svgcanvas.IssueCode> | |
exportWindowName |
string |
- Source: