UNPKG

svgedit

Version:

Powerful SVG-Editor for your browser

479 lines (417 loc) 29.8 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: svgcanvas/selection.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: svgcanvas/selection.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/** * Tools for selection. * @module selection * @license MIT * @copyright 2011 Jeff Schiller */ import { NS } from './namespaces.js'; import { isNullish, getBBox as utilsGetBBox, getStrokedBBoxDefaultVisible } from './utilities.js'; import { transformPoint, transformListToTransform, rectsIntersect } from './math.js'; import * as hstry from './history.js'; import { getClosest } from '../editor/components/jgraduate/Util.js'; const { BatchCommand } = hstry; let selectionContext_ = null; let svgCanvas = null; let selectedElements; /** * @function module:selection.init * @param {module:selection.selectionContext} selectionContext * @returns {void} */ export const init = function (selectionContext) { selectionContext_ = selectionContext; svgCanvas = selectionContext_.getCanvas(); selectedElements = selectionContext_.getSelectedElements; }; /** * Clears the selection. The 'selected' handler is then optionally called. * This should really be an intersection applying to all types rather than a union. * @name module:selection.SvgCanvas#clearSelection * @type {module:draw.DrawCanvasInit#clearSelection|module:path.EditorContext#clearSelection} * @fires module:selection.SvgCanvas#event:selected */ export const clearSelectionMethod = function (noCall) { selectedElements().forEach((elem) => { if (isNullish(elem)) { return; } svgCanvas.selectorManager.releaseSelector(elem); }); svgCanvas.setEmptySelectedElements(); if (!noCall) { svgCanvas.call('selected', selectedElements()); } }; /** * Adds a list of elements to the selection. The 'selected' handler is then called. * @name module:selection.SvgCanvas#addToSelection * @type {module:path.EditorContext#addToSelection} * @fires module:selection.SvgCanvas#event:selected */ export const addToSelectionMethod = function (elemsToAdd, showGrips) { if (!elemsToAdd.length) { return; } // find the first null in our selectedElements array let j = 0; while (j &lt; selectedElements().length) { if (isNullish(selectedElements()[j])) { break; } ++j; } // now add each element consecutively let i = elemsToAdd.length; while (i--) { let elem = elemsToAdd[i]; if (!elem) { continue; } const bbox = utilsGetBBox(elem); if (!bbox) { continue; } if (elem.tagName === 'a' &amp;&amp; elem.childNodes.length === 1) { // Make "a" element's child be the selected element elem = elem.firstChild; } // if it's not already there, add it if (!selectedElements().includes(elem)) { selectedElements()[j] = elem; // only the first selectedBBoxes element is ever used in the codebase these days // if (j === 0) selectedBBoxes[0] = utilsGetBBox(elem); j++; const sel = svgCanvas.selectorManager.requestSelector(elem, bbox); if (selectedElements().length > 1) { sel.showGrips(false); } } } if (!selectedElements().length) { return; } svgCanvas.call('selected', selectedElements()); if (selectedElements().length === 1) { svgCanvas.selectorManager.requestSelector(selectedElements()[0]).showGrips(showGrips); } // make sure the elements are in the correct order // See: https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition selectedElements().sort(function (a, b) { if (a &amp;&amp; b &amp;&amp; a.compareDocumentPosition) { return 3 - (b.compareDocumentPosition(a) &amp; 6); // eslint-disable-line no-bitwise } if (isNullish(a)) { return 1; } return 0; }); // Make sure first elements are not null while (isNullish(selectedElements())[0]) { selectedElements().shift(0); } }; /** * @name module:svgcanvas.SvgCanvas#getMouseTarget * @type {module:path.EditorContext#getMouseTarget} */ export const getMouseTargetMethod = function (evt) { if (isNullish(evt)) { return null; } let mouseTarget = evt.target; // if it was a &lt;use>, Opera and WebKit return the SVGElementInstance if (mouseTarget.correspondingUseElement) { mouseTarget = mouseTarget.correspondingUseElement; } // for foreign content, go up until we find the foreignObject // WebKit browsers set the mouse target to the svgcanvas div if ([ NS.MATH, NS.HTML ].includes(mouseTarget.namespaceURI) &amp;&amp; mouseTarget.id !== 'svgcanvas' ) { while (mouseTarget.nodeName !== 'foreignObject') { mouseTarget = mouseTarget.parentNode; if (!mouseTarget) { return selectionContext_.getSVGRoot(); } } } // Get the desired mouseTarget with jQuery selector-fu // If it's root-like, select the root const currentLayer = svgCanvas.getCurrentDrawing().getCurrentLayer(); const svgRoot = selectionContext_.getSVGRoot(); const container = selectionContext_.getDOMContainer(); const content = selectionContext_.getSVGContent(); if ([ svgRoot, container, content, currentLayer ].includes(mouseTarget)) { return selectionContext_.getSVGRoot(); } // If it's a selection grip, return the grip parent if (getClosest(mouseTarget.parentNode, '#selectorParentGroup')) { // While we could instead have just returned mouseTarget, // this makes it easier to indentify as being a selector grip return svgCanvas.selectorManager.selectorParentGroup; } while (!mouseTarget?.parentNode?.isSameNode(selectionContext_.getCurrentGroup() || currentLayer)) { mouseTarget = mouseTarget.parentNode; } return mouseTarget; }; /** * @typedef {module:svgcanvas.ExtensionMouseDownStatus|module:svgcanvas.ExtensionMouseUpStatus|module:svgcanvas.ExtensionIDsUpdatedStatus|module:locale.ExtensionLocaleData[]|void} module:svgcanvas.ExtensionStatus * @tutorial ExtensionDocs */ /** * @callback module:svgcanvas.ExtensionVarBuilder * @param {string} name The name of the extension * @returns {module:svgcanvas.SvgCanvas#event:ext_addLangData} */ /** * @callback module:svgcanvas.ExtensionNameFilter * @param {string} name * @returns {boolean} */ /* eslint-disable max-len */ /** * @todo Consider: Should this return an array by default, so extension results aren't overwritten? * @todo Would be easier to document if passing in object with key of action and vars as value; could then define an interface which tied both together * @function module:svgcanvas.SvgCanvas#runExtensions * @param {"mouseDown"|"mouseMove"|"mouseUp"|"zoomChanged"|"IDsUpdated"|"canvasUpdated"|"toolButtonStateUpdate"|"selectedChanged"|"elementTransition"|"elementChanged"|"langReady"|"langChanged"|"addLangData"|"onNewDocument"|"workareaResized"} action * @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars] * @param {boolean} [returnArray] * @param {module:svgcanvas.ExtensionNameFilter} nameFilter * @returns {GenericArray&lt;module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus. */ /* eslint-enable max-len */ export const runExtensionsMethod = function (action, vars, returnArray, nameFilter) { let result = returnArray ? [] : false; for (const [ name, ext ] of Object.entries(selectionContext_.getExtensions())) { if (nameFilter &amp;&amp; !nameFilter(name)) { return; } if (ext &amp;&amp; action in ext) { if (typeof vars === 'function') { vars = vars(name); // ext, action } if (returnArray) { result.push(ext[action](vars)); } else { result = ext[action](vars); } } } return result; }; /** * Get all elements that have a BBox (excludes `&lt;defs>`, `&lt;title>`, etc). * Note that 0-opacity, off-screen etc elements are still considered "visible" * for this function. * @function module:svgcanvas.SvgCanvas#getVisibleElementsAndBBoxes * @param {Element} parent - The parent DOM element to search within * @returns {ElementAndBBox[]} An array with objects that include: */ export const getVisibleElementsAndBBoxes = function (parent) { if (!parent) { const svgcontent = selectionContext_.getSVGContent(); parent = svgcontent.children; // Prevent layers from being included } const contentElems = []; const elements = parent.children; Array.prototype.forEach.call(elements, function (elem) { if (elem.getBBox) { contentElems.push({ elem, bbox: getStrokedBBoxDefaultVisible([ elem ]) }); } }); return contentElems.reverse(); }; /** * This method sends back an array or a NodeList full of elements that * intersect the multi-select rubber-band-box on the currentLayer only. * * We brute-force `getIntersectionList` for browsers that do not support it (Firefox). * * Reference: * Firefox does not implement `getIntersectionList()`, see {@link https://bugzilla.mozilla.org/show_bug.cgi?id=501421}. * @function module:svgcanvas.SvgCanvas#getIntersectionList * @param {SVGRect} rect * @returns {Element[]|NodeList} Bbox elements */ export const getIntersectionListMethod = function (rect) { const currentZoom = selectionContext_.getCurrentZoom(); if (isNullish(selectionContext_.getRubberBox())) { return null; } const parent = selectionContext_.getCurrentGroup() || svgCanvas.getCurrentDrawing().getCurrentLayer(); let rubberBBox; if (!rect) { rubberBBox = selectionContext_.getRubberBox().getBBox(); const bb = selectionContext_.getSVGContent().createSVGRect(); [ 'x', 'y', 'width', 'height', 'top', 'right', 'bottom', 'left' ].forEach((o) => { bb[o] = rubberBBox[o] / currentZoom; }); rubberBBox = bb; } else { rubberBBox = selectionContext_.getSVGContent().createSVGRect(); rubberBBox.x = rect.x; rubberBBox.y = rect.y; rubberBBox.width = rect.width; rubberBBox.height = rect.height; } let resultList = null; if (isNullish(resultList) || typeof resultList.item !== 'function') { resultList = []; if (!selectionContext_.getCurBBoxes().length) { // Cache all bboxes selectionContext_.setCurBBoxes(getVisibleElementsAndBBoxes(parent)); } let i = selectionContext_.getCurBBoxes().length; while (i--) { const curBBoxes = selectionContext_.getCurBBoxes(); if (!rubberBBox.width) { continue; } if (rectsIntersect(rubberBBox, curBBoxes[i].bbox)) { resultList.push(curBBoxes[i].elem); } } } // addToSelection expects an array, but it's ok to pass a NodeList // because using square-bracket notation is allowed: // https://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html return resultList; }; /** * @typedef {PlainObject} ElementAndBBox * @property {Element} elem - The element * @property {module:utilities.BBoxObject} bbox - The element's BBox as retrieved from `getStrokedBBoxDefaultVisible` */ /** * Wrap an SVG element into a group element, mark the group as 'gsvg'. * @function module:svgcanvas.SvgCanvas#groupSvgElem * @param {Element} elem - SVG element to wrap * @returns {void} */ export const groupSvgElem = function (elem) { const dataStorage = selectionContext_.getDataStorage(); const g = document.createElementNS(NS.SVG, 'g'); elem.replaceWith(g); g.appendChild(elem); dataStorage.put(g, 'gsvg', elem); g.id = svgCanvas.getNextId(); }; /** * Runs the SVG Document through the sanitizer and then updates its paths. * @function module:svgcanvas.SvgCanvas#prepareSvg * @param {XMLDocument} newDoc - The SVG DOM document * @returns {void} */ export const prepareSvg = function (newDoc) { svgCanvas.sanitizeSvg(newDoc.documentElement); // convert paths into absolute commands const paths = [ ...newDoc.getElementsByTagNameNS(NS.SVG, 'path') ]; paths.forEach((path) => { const convertedPath = svgCanvas.pathActions.convertPath(path); path.setAttribute('d', convertedPath); svgCanvas.pathActions.fixEnd(path); }); }; /** * Removes any old rotations if present, prepends a new rotation at the * transformed center. * @function module:svgcanvas.SvgCanvas#setRotationAngle * @param {string|Float} val - The new rotation angle in degrees * @param {boolean} preventUndo - Indicates whether the action should be undoable or not * @fires module:svgcanvas.SvgCanvas#event:changed * @returns {void} */ export const setRotationAngle = function (val, preventUndo) { // ensure val is the proper type val = Number.parseFloat(val); const elem = selectedElements()[0]; const oldTransform = elem.getAttribute('transform'); const bbox = utilsGetBBox(elem); const cx = bbox.x + bbox.width / 2; const cy = bbox.y + bbox.height / 2; const tlist = elem.transform.baseVal; // only remove the real rotational transform if present (i.e. at index=0) if (tlist.numberOfItems > 0) { const xform = tlist.getItem(0); if (xform.type === 4) { tlist.removeItem(0); } } // find Rnc and insert it if (val !== 0) { const center = transformPoint(cx, cy, transformListToTransform(tlist).matrix); const Rnc = selectionContext_.getSVGRoot().createSVGTransform(); Rnc.setRotate(val, center.x, center.y); if (tlist.numberOfItems) { tlist.insertItemBefore(Rnc, 0); } else { tlist.appendItem(Rnc); } } else if (tlist.numberOfItems === 0) { elem.removeAttribute('transform'); } if (!preventUndo) { // we need to undo it, then redo it so it can be undo-able! :) // TODO: figure out how to make changes to transform list undo-able cross-browser? const newTransform = elem.getAttribute('transform'); if (oldTransform) { elem.setAttribute('transform', oldTransform); } else { elem.removeAttribute('transform'); } svgCanvas.changeSelectedAttribute('transform', newTransform, selectedElements()); svgCanvas.call('changed', selectedElements()); } // const pointGripContainer = getElem('pathpointgrip_container'); // if (elem.nodeName === 'path' &amp;&amp; pointGripContainer) { // pathActions.setPointContainerTransform(elem.getAttribute('transform')); // } const selector = svgCanvas.selectorManager.requestSelector(selectedElements()[0]); selector.resize(); selectionContext_.getSelector().updateGripCursors(val); }; /** * Runs `recalculateDimensions` on the selected elements, * adding the changes to a single batch command. * @function module:svgcanvas.SvgCanvas#recalculateAllSelectedDimensions * @fires module:svgcanvas.SvgCanvas#event:changed * @returns {void} */ export const recalculateAllSelectedDimensions = function () { const text = (selectionContext_.getCurrentResizeMode() === 'none' ? 'position' : 'size'); const batchCmd = new BatchCommand(text); let i = selectedElements().length; while (i--) { const elem = selectedElements()[i]; const cmd = svgCanvas.recalculateDimensions(elem); if (cmd) { batchCmd.addSubCommand(cmd); } } if (!batchCmd.isEmpty()) { selectionContext_.addCommandToHistory(batchCmd); svgCanvas.call('changed', selectedElements()); } }; </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-blur.html">blur</a></li><li><a href="module-browser.html">browser</a></li><li><a href="module-clear.html">clear</a></li><li><a href="module-contextmenu.html">contextmenu</a></li><li><a href="module-coords.html">coords</a></li><li><a href="module-draw.html">draw</a></li><li><a href="module-elem-get-set%2520get%2520and%2520set%2520methods..html">elem-get-set get and set methods.</a></li><li><a href="module-event.html">event</a></li><li><a href="module-history.html">history</a></li><li><a href="module-jGraduate.html">jGraduate</a></li><li><a href="module-jPicker.html">jPicker</a></li><li><a href="module-jQueryAttr.html">jQueryAttr</a></li><li><a href="module-layer.html">layer</a></li><li><a href="module-locale.html">locale</a></li><li><a href="module-math.html">math</a></li><li><a href="module-namespaces.html">namespaces</a></li><li><a href="module-path.html">path</a></li><li><a href="module-recalculate.html">recalculate</a></li><li><a href="module-sanitize.html">sanitize</a></li><li><a href="module-select.html">select</a></li><li><a href="module-selected-elem.html">selected-elem</a></li><li><a href="module-selection.html">selection</a></li><li><a href="module-svg.html">svg</a></li><li><a href="module-svgcanvas.html">svgcanvas</a></li><li><a href="module-SVGEditor.html">SVGEditor</a></li><li><a href="module-text-actions%2520Tools%2520for%2520Text%2520edit%2520functions.html">text-actions Tools for Text edit functions</a></li><li><a href="module-undo.html">undo</a></li><li><a href="module-units.html">units</a></li><li><a href="module-utilities.html">utilities</a></li></ul><h3>Externals</h3><ul><li><a href="external-JamilihArray.html">JamilihArray</a></li><li><a href="external-jQuery.html">jQuery</a></li><li><a href="external-Math.html">Math</a></li><li><a href="external-MouseEvent.html">MouseEvent</a></li><li><a href="external-Window.html">Window</a></li></ul><h3>Namespaces</h3><ul><li><a href="external-jQuery.fn.html">fn</a></li><li><a href="external-jQuery.fn.$.fn.jPicker.defaults.html">defaults</a></li><li><a href="external-jQuery.fn.exports.jPickerMethod.html">exports.jPickerMethod</a></li><li><a href="external-jQuery.fn.jGraduateDefaults.html">jGraduateDefaults</a></li><li><a href="external-jQuery.fn.jGraduateDefaults.images.html">images</a></li><li><a href="external-jQuery.fn.jGraduateDefaults.window.html">window</a></li><li><a href="external-jQuery.jGraduate.html">jGraduate</a></li><li><a href="external-jQuery.jPicker.html">jPicker</a></li><li><a href="external-jQuery.jPicker.ColorMethods.html">ColorMethods</a></li><li><a href="module-path.html#.pathActions">pathActions</a></li><li><a href="module-svgcanvas.SvgCanvas_pathActions.html">pathActions</a></li><li><a href="module-svgcanvas.SvgCanvas_textActions.html">textActions</a></li></ul><h3>Classes</h3><ul><li><a href="BottomPanel.html">BottomPanel</a></li><li><a href="configObj.html">configObj</a></li><li><a href="Dropdown.html">Dropdown</a></li><li><a href="EditorStartup.html">EditorStartup</a></li><li><a href="ElixMenuButton.html">ElixMenuButton</a></li><li><a href="ElixNumberSpinBox.html">ElixNumberSpinBox</a></li><li><a href="ExplorerButton.html">ExplorerButton</a></li><li><a href="external-jQuery.jGraduate.Paint.html">Paint</a></li><li><a href="external-jQuery.jPicker.Color.html">Color</a></li><li><a href="FlyingButton.html">FlyingButton</a></li><li><a href="LayersPanel.html">LayersPanel</a></li><li><a href="LeftPanel.html">LeftPanel</a></li><li><a href="MainMenu.html">MainMenu</a></li><li><a href="module.exports.html">exports</a></li><li><a href="module.exports_module.exports.html">exports</a></li><li><a href="module-draw.Drawing.html">Drawing</a></li><li><a href="module-draw.Layer.html">Layer</a></li><li><a href="module-history.BatchCommand.html">BatchCommand</a></li><li><a href="module-history.ChangeElementCommand.html">ChangeElementCommand</a></li><li><a href="module-history.Command.html">Command</a></li><li><a href="module-history.HistoryRecordingService.html">HistoryRecordingService</a></li><li><a href="module-history.InsertElementCommand.html">InsertElementCommand</a></li><li><a href="module-history.MoveElementCommand.html">MoveElementCommand</a></li><li><a href="module-history.RemoveElementCommand.html">RemoveElementCommand</a></li><li><a href="module-history.UndoManager.html">UndoManager</a></li><li><a href="module-jPicker.module.exports.html">module.exports</a></li><li><a href="module-layer.Layer.html">Layer</a></li><li><a href="module-path.Path.html">Path</a></li><li><a href="module-path.Segment.html">Segment</a></li><li><a href="module-select.Selector.html">Selector</a></li><li><a href="module-select.SelectorManager.html">SelectorManager</a></li><li><a href="module-svgcanvas.SvgCanvas.html">SvgCanvas</a></li><li><a href="module-SVGEditor-Editor.html">Editor</a></li><li><a href="NumberSpinBox.html">NumberSpinBox</a></li><li><a href="PaintBox.html">PaintBox</a></li><li><a href="PlainNumberSpinBox.html">PlainNumberSpinBox</a></li><li><a href="Rulers.html">Rulers</a></li><li><a href="SeCMenuDialog.html">SeCMenuDialog</a></li><li><a href="SeCMenuLayerDialog.html">SeCMenuLayerDialog</a></li><li><a href="SeColorPicker.html">SeColorPicker</a></li><li><a href="SeEditPrefsDialog.html">SeEditPrefsDialog</a></li><li><a href="SeExportDialog.html">SeExportDialog</a></li><li><a href="SeImgPropDialog.html">SeImgPropDialog</a></li><li><a href="SEInput.html">SEInput</a></li><li><a href="SeList.html">SeList</a></li><li><a href="SeMenu.html">SeMenu</a></li><li><a href="SeMenuItem.html">SeMenuItem</a></li><li><a href="SEPalette.html">SEPalette</a></li><li><a href="SePlainAlertDialog.html">SePlainAlertDialog</a></li><li><a href="SePlainBorderButton.html">SePlainBorderButton</a></li><li><a href="SePromptDialog.html">SePromptDialog</a></li><li><a href="SESpinInput.html">SESpinInput</a></li><li><a href="SeStorageDialog.html">SeStorageDialog</a></li><li><a href="SeSvgSourceEditorDialog.html">SeSvgSourceEditorDialog</a></li><li><a href="SeText.html">SeText</a></li><li><a href="ToolButton.html">ToolButton</a></li><li><a href="TopPanel.html">TopPanel</a></li></ul><h3>Interfaces</h3><ul><li><a href="module-coords.EditorContext.html">EditorContext</a></li><li><a href="module-draw.DrawCanvasInit.html">DrawCanvasInit</a></li><li><a href="module-history.HistoryCommand.html">HistoryCommand</a></li><li><a href="module-history.HistoryEventHandler.html">HistoryEventHandler</a></li><li><a href="module-locale.LocaleEditorInit.html">LocaleEditorInit</a></li><li><a href="module-path.EditorContext.html">EditorContext</a></li><li><a href="module-recalculate.EditorContext.html">EditorContext</a></li><li><a href="module-select.SVGFactory.html">SVGFactory</a></li><li><a href="module-svgcanvas.PrivateMethods.html">PrivateMethods</a></li><li><a href="module-SVGEditor.Config.html">Config</a></li><li><a href="module-SVGEditor.Prefs.html">Prefs</a></li><li><a href="module-SVGthis.CustomHandler.html">CustomHandler</a></li><li><a href="module-units.ElementContainer.html">ElementContainer</a></li><li><a href="module-utilities.EditorContext.html">EditorContext</a></li></ul><h3>Events</h3><ul><li><a href="module-history-Command.html#event:event:history">history</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:changed">changed</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:cleared">cleared</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:contextset">contextset</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:exported">exported</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:exportedPDF">exportedPDF</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_addLangData">ext_addLangData</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_callback">ext_callback</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_canvasUpdated">ext_canvasUpdated</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_elementChanged">ext_elementChanged</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_elementTransition">ext_elementTransition</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_IDsUpdated">ext_IDsUpdated</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_langChanged">ext_langChanged</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_langReady">ext_langReady</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_mouseDown">ext_mouseDown</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_mouseMove">ext_mouseMove</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_mouseUp">ext_mouseUp</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_onNewDocument">ext_onNewDocument</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_selectedChanged">ext_selectedChanged</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_toolButtonStateUpdate">ext_toolButtonStateUpdate</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_workareaResized">ext_workareaResized</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:ext_zoomChanged">ext_zoomChanged</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:extension_added">extension_added</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:extensions_added">extensions_added</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:GenericCanvasEvent">GenericCanvasEvent</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:message">message</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:pointsAdded">pointsAdded</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:saved">saved</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:selected">selected</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:setnonce">setnonce</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:transition">transition</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:unsetnonce">unsetnonce</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:updateCanvas">updateCanvas</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:zoomDone">zoomDone</a></li><li><a href="module-svgcanvas.SvgCanvas.html#event:event:zoomed">zoomed</a></li><li><a href="module-SVGEditor.html#event:event:svgEditorReadyEvent">svgEditorReadyEvent</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-CanvasAPI.html">CanvasAPI</a></li><li><a href="tutorial-Editor.html">Editor</a></li><li><a href="tutorial-EditorAPI.html">EditorAPI</a></li><li><a href="tutorial-Events.html">Events</a></li><li><a href="tutorial-FrequentlyAskedQuestions.html">Frequently Asked Questions (FAQ)</a></li></ul><h3>Global</h3><ul><li><a href="global.html#attributeChangedCallback">attributeChangedCallback</a></li><li><a href="global.html#connectedCallback">connectedCallback</a></li><li><a href="global.html#constructor">constructor</a></li><li><a href="global.html#expireCookie">expireCookie</a></li><li><a href="global.html#findPos">findPos</a></li><li><a href="global.html#formatValueFormatthenumericvalueasastring.Thisisusedafterincrementing/decrementingthevaluetoreformatthevalueasastring.">formatValue Format the numeric value as a string. This is used after incrementing/decrementing the value to reformat the value as a string.</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#getClosest">getClosest</a></li><li><a href="global.html#getParents">getParents</a></li><li><a href="global.html#init">init</a></li><li><a href="global.html#inputsize">inputsize</a></li><li><a href="global.html#isNullish">isNullish</a></li><li><a href="global.html#loadloadConfig">load load Config</a></li><li><a href="global.html#loadFromURLLoadconfig/datafromURLifgiven">loadFromURL Load config/data from URL if given</a></li><li><a href="global.html#name">name</a></li><li><a href="global.html#observedAttributes">observedAttributes</a></li><li><a href="global.html#parseValue">parseValue</a></li><li><a href="global.html#pref">pref</a></li><li><a href="global.html#processResults">processResults</a></li><li><a href="global.html#readySignal">readySignal</a></li><li><a href="global.html#regexEscape">regexEscape</a></li><li><a href="global.html#removeStoragePrefCookie">removeStoragePrefCookie</a></li><li><a href="global.html#replaceStoragePrompt">replaceStoragePrompt</a></li><li><a href="global.html#set">set</a></li><li><a href="global.html#setupCurConfig">setupCurConfig</a></li><li><a href="global.html#setupCurPrefs">setupCurPrefs</a></li><li><a href="global.html#src">src</a></li><li><a href="global.html#stateEffects">stateEffects</a></li><li><a href="global.html#stepDown">stepDown</a></li><li><a href="global.html#stepUp">stepUp</a></li><li><a href="global.html#touchHandler">touchHandler</a></li><li><a href="global.html#updateLib">updateLib</a></li><li><a href="global.html#value">value</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Mon Nov 08 2021 09:47:00 GMT+0100 (Central European Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>