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
- License:
- MIT
- Source:
- Copyright:
- 2010 Alexis Deveria, 2010 Jeff Schiller
- License:
- MIT
- Source:
Classes
Interfaces
Members
(inner) addCommandToHistory :module:path.EditorContext#addCommandToHistory|module:draw.DrawCanvasInit#addCommandToHistory
This should really be an intersection applying to all types rather than a union.
Type:
- Source:
(inner) svgcontent :SVGSVGElement
The actual element that represents the final output SVG element.
Type:
- SVGSVGElement
- Source:
(inner) svgroot :SVGSVGElement
Type:
- SVGSVGElement
- Source:
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) addPtsToSelection(ptsInfo) → {void}
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ptsInfo |
PlainObject |
Properties
|
- Source:
Fires:
Returns:
- Type
- void
(inner) changeSVGContent() → {void}
- Source:
Fires:
Returns:
- Type
- void
(inner) endChanges(changes) → {void}
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
changes |
PlainObject |
Properties
|
- Source:
Fires:
Returns:
- Type
- void
(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
(inner) logMatrix(m) → {void}
Debug tool to easily see the current matrix in the browser's console.
Parameters:
Name | Type | Description |
---|---|---|
m |
SVGMatrix | The matrix |
- Source:
Returns:
- Type
- void
Type Definitions
CanvasInfo
Type:
Properties:
Name | Type | Description |
---|---|---|
x |
Float | The canvas' new x coordinate |
y |
Float | The canvas' new y coordinate |
oldX |
string | The canvas' old x coordinate |
oldY |
string | The canvas' old y coordinate |
d_x |
Float | The x position difference |
d_y |
Float | The y position difference |
- Source:
ChangedIDs
Type:
- PlainObject.<string, string>
- Source:
ElementPositionInCanvas
Type:
Properties:
Name | Type | Description |
---|---|---|
x |
Float | |
y |
Float |
- Source:
EventHandler(win, arg) → {module:svgcanvas.EventHandlerReturn}
Parameters:
Name | Type | Description |
---|---|---|
win |
external:Window | |
arg |
module:svgcanvas.SvgCanvas#event:GenericCanvasEvent |
- Source:
Listens to Events:
Returns:
EventHandlerReturn
The promise return, if present, resolves to undefined
(extension_added
, exported
, saved
).
Type:
- Promise.<void> | void
- Source:
ExtensionArgumentObject
Type:
Properties:
Name | Type | Description |
---|---|---|
svgroot |
SVGSVGElement | |
svgcontent |
SVGSVGElement | |
nonce |
string | Integer | |
selectorManager |
module:select.SelectorManager | |
importLocale |
module:SVGEditor~ImportLocale |
- Source:
ExtensionInitResponsePlusName
Type:
Properties:
Name | Type | Description |
---|---|---|
name |
string | The extension's resolved ID (whether explicit or based on file name) |
- Implements:
- module:svgcanvas.ExtensionInitResponse
- 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:
ImageEmbeddedCallback(result) → {void}
Function to run when image data is found.
Parameters:
Name | Type | Description |
---|---|---|
result |
string | false | Data URL |
- Source:
Returns:
- Type
- void
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:
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:
IssueCode
Type:
- "feGaussianBlur" | "foreignObject" | "[stroke-dasharray]" | "text"
- Source:
IssuesAndCodes
Type:
Properties:
Name | Type | Description |
---|---|---|
issueCodes |
Array.<string> | The locale-independent code names |
issues |
Array.<string> | The localized descriptions |
- Source:
IssuesAndCodes
Type:
Properties:
Name | Type | Description |
---|---|---|
issueCodes |
Array.<string> | The locale-independent code names |
issues |
Array.<string> | The localized descriptions |
- Source:
Message
Type:
Properties:
Name | Type | Description |
---|---|---|
data |
any | The data |
origin |
string | The origin |
- Source:
PaintOptions
Type:
Properties:
Name | Type | Description |
---|---|---|
type |
"solidColor" |
- 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:
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:
SaveOptions
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
apply |
boolean | ||
image |
"embed" |
<optional> |
|
round_digits |
Integer |
- Source:
StyleOptions
Type:
Properties:
Name | Type | Description |
---|---|---|
fill |
string | |
fill_opacity |
Float | |
stroke |
string | |
stroke_width |
Float | |
stroke_dasharray |
string | |
stroke_linejoin |
string | |
stroke_linecap |
string | |
stroke_opacity |
Float | |
opacity |
Float |
- Source:
SVGAsJSON
Type:
Properties:
Name | Type | Description |
---|---|---|
element |
string | |
attr |
PlainObject.<string, string> | |
children |
Array.<module:svgcanvas.SVGAsJSON> |
- Source:
ZoomAndBBox
Type:
Properties:
Name | Type | Description |
---|---|---|
zoom |
Float | |
bbox |
module:utilities.BBoxObject |
- Source:
DimensionsAndZoom
Type:
Properties:
Name | Type | Description |
---|---|---|
w |
Float | Width |
h |
Float | Height |
zoom |
Float | Zoom |
- Source: