Go to file
Brett Zamir a714c122d3 - Fix (Embedded editor): (Though embedding cross-origin iframes apparently
only working now in Chrome if same origin or if https?--at least not
  localhost of different ports), PDF export has been fixed (we download the
  PDF to workaround data URI limitations in Chrome)
- Fix (Embedded editor): Avoid using same origin shortcut if there is no
  global available to use (e.g., if using the modular editor)
- Fix (Embedded editor): Add events only after load is complete and
  svgCanvas is available; also log blocked error objects
- Enhancement: For PDF export, switch Chrome by default to "save" `outputType`
- Docs (JSdoc): Denote optional arguments
2018-10-23 22:24:09 +08:00
.github/ISSUE_TEMPLATE Add issue templates 2018-09-13 09:25:05 +08:00
build/tools (INCOMPLETE: ES6 Module conversion and linting) 2018-05-22 18:02:57 +08:00
chrome-app (INCOMPLETE: ES6 Module conversion and linting) 2018-05-22 18:02:57 +08:00
clipart Reidentify all elements imported into the drawing. Add tests for it. 2010-02-22 00:56:19 +00:00
demos - Demos: Add svgcanvas demo (Neil Fraser) 2018-05-29 07:17:30 +08:00
dist - Fix (Embedded editor): (Though embedding cross-origin iframes apparently 2018-10-23 22:24:09 +08:00
docs - Docs: CHANGES clarifications 2018-10-23 18:35:49 +08:00
editor - Fix (Embedded editor): (Though embedding cross-origin iframes apparently 2018-10-23 22:24:09 +08:00
examples - Linting (ESLint): Use two spaces for indent 2018-05-18 14:05:52 +08:00
firefox-extension (INCOMPLETE: ES6 Module conversion and linting) 2018-05-22 18:02:57 +08:00
opera-widget (INCOMPLETE: ES6 Module conversion and linting) 2018-05-22 18:02:57 +08:00
screencasts LGTM.com-inspired changes: 2018-09-21 10:56:07 +08:00
test - Refactoring: Avoid redundant use of *AttributeNS methods with 2018-10-23 18:14:27 +08:00
.babelrc - Build: Babel 7 2018-09-26 21:27:52 +08:00
.eslintignore - Update (Imagelib): Remove extra (and more outdated) jQuery copy 2018-09-25 14:21:40 +08:00
.eslintrc - Fix: Avoid errors occurring in Chrome now for `supportsGoodTextCharPos` 2018-09-30 12:13:34 +08:00
.gitignore - .gitignore/.npmignore: Allow for `ignore` folder for notes; add old build-related/remote linting files to npmignore 2018-10-20 22:32:49 +08:00
.htmlhintrc - Linting (Markdown): Fix linting format 2018-10-19 15:19:18 +08:00
.npmignore - Docs: CHANGES clarifications 2018-10-23 18:35:49 +08:00
.remarkrc - Linting (Markdown): Fix linting format 2018-10-19 15:19:18 +08:00
AUTHORS - Linting (HTML): Use double-quotes for attributes, remove redundant `type=text/css`, 2018-05-13 09:58:13 +08:00
CHANGES.md - Fix (Embedded editor): (Though embedding cross-origin iframes apparently 2018-10-23 22:24:09 +08:00
LICENSE-MIT.txt - Linting (HTML): Use double-quotes for attributes, remove redundant `type=text/css`, 2018-05-13 09:58:13 +08:00
README.md - Fix: Revert fix to have extension `mouseup` events run on "zoom" and 2018-10-22 23:43:59 +08:00
build-html.js - Compatibility fix (openclipart): Ensure polyfill present; make separate non-modular build (still not integrated as API incomplete) 2018-09-26 16:06:57 +08:00
composer.json - Linting (HTML): Use double-quotes for attributes, remove redundant `type=text/css`, 2018-05-13 09:58:13 +08:00
grep-jsdoc.js - Fix: Avoid errors occurring in Chrome now for `supportsGoodTextCharPos` 2018-09-30 12:13:34 +08:00
lgtm.yml LGTM.com-inspired changes: 2018-09-21 10:56:07 +08:00
package-lock.json - Fix: Revert fix to have extension `mouseup` events run on "zoom" and 2018-10-22 23:43:59 +08:00
package.json - Fix: Revert fix to have extension `mouseup` events run on "zoom" and 2018-10-22 23:43:59 +08:00
rollup-config.config.js - npm: Update devDeps 2018-09-07 08:19:45 +08:00
rollup.config.js - Build: Babel 7 2018-09-26 21:27:52 +08:00
svgedit-config-es.js - Enhancement: Auto-detect `allowedImageLibOrigins` based on locale rather than requiring user to supply 2018-09-25 02:35:15 +08:00
svgedit-config-iife.js - Fix (Embedded editor): (Though embedding cross-origin iframes apparently 2018-10-23 22:24:09 +08:00

README.md

alt text SVG-edit

Dependencies devDependencies npm License Code Quality: Javascript Total Alerts

SVG-edit is a fast, web-based, JavaScript-driven SVG drawing editor that works in any modern browser.

Demo

Try SVG-edit here

See the latest release (or its ES6-Module version, which requires a modern browser).

You may also try it at https://unpkg.com/svgedit/editor/svg-editor.html (which redirects to a versioned URL).

You may also obtain URLs for specific releases.

For testing the latest version in master, you may use https://raw.githack.com/SVG-Edit/svgedit/master/editor/svg-editor.html.

Installation

Quick install

  1. Clone or copy the repository contents (at least the editor directory).
  2. If you need programmatic customization, see its section below.
  3. Otherwise, just add an iframe to your site, adding any extensions or configuration (see docs/tutorials/ConfigOptions.md ([ConfigOptions]{@tutorial ConfigOptions})) within the URL:
<iframe src="svgedit/editor/svg-editor.html?extensions=" width="100%" height="100%"></iframe>

Integrating SVG-edit into your own npm package

These steps are only needed if you wish to set up your own npm package incorporating SVGEdit.

  1. Create your npm package: npm init (complete the fields).
  2. Install SVG-edit into your package: npm i svgedit.
  3. Look within node_modules/svgedit/, e.g., node_modules/svgedit/editor/svg-editor.html for the files your package needs and use accordingly.
  4. npm publish

Programmatic customization

  1. If you are not concerned about supporting ES6 Modules (see the "ES6 Modules file" section), you can add your config directly to svgedit-config-iife.js within the SVG-Edit project root.
  2. Note: Do not remove the import svgEditor... code which is responsible for importing the SVG edit code. Versions prior to 3.0 did not require this, but the advantage is that your HTML does not need to be polluted with extra script references.
  3. Modify or utilize any options. See docs/tutorials/ConfigOptions.md ([ConfigOptions]{@tutorial ConfigOptions}).

ES6 Modules file

  1. svg-editor-es.html is an HTML file directly using ES6 modules. It is only supported in the latest browsers. It is probably mostly useful for debugging, as it requires more network requests. If you would like to work with this file, you should make configuration changes in svgedit-config-es.js (in the SVG-Edit project root).
  2. If you are working with the ES6 Modules config but also wish to work with the normal svg-editor.html version (so your code can work in older browsers or get the presumable performance benefits of this file which references JavaScript rolled up into a single file), you can follow these steps after any config changes you make, so that your changes can also be automatically made available to both versions.
  3. JavaScript: 1. Run npm install within the node_modules/svgedit directory to install the build tools for SVG-edit. 1. Run npm run build-config within the node_modules/svgedit directory.
    1. This will rebuild svgedit-config-iife.js (applying Babel to allow it to work on older browsers and applying Rollup to build all JavaScript into one file). The file will then contain non-ES6 module JavaScript that can work in older browsers. Note that it bundles all of SVGEdit, so it is to be expected that this file will be much larger in size than the original ES6 config file.
  4. HTML: 1. If you wish to make changes to both HTML files, it is recommended that you work and test on svg-editor-es.html and then run npm run build-html to have the changes properly copied to svg-editor.html.

Recent news

  • 2018-10-22 Published 3.0.1 (Revert fix affecting polygon selection)
  • 2018-10-21 Published 3.0.0 (misc. improvements including centering canvas and key locale fixes since last RC)
  • 2018-09-30 Published 3.0.0-rc.3 with security and other fixes
  • 2018-07-31 Published 3.0.0-rc.2 with misc. fixes
  • 2018-07-19 Published 3.0.0-rc.1 allowing for extensions and locales to be expressed as modules
  • 2018-05-26 Published 3.0.0-alpha.2 with ES6 Modules support
  • 2017-07 Added to Packagist: https://packagist.org/packages/svg-edit/svgedit
  • 2015-12-02 SVG-edit 2.8.1 was released.
  • 2015-11-24 SVG-edit 2.8 was released.
  • 2015-11-24 Code, issue tracking, and docs are being moved to github (previously code.google.com).
  • 2014-04-17 2.7 and stable branches updated to reflect 2.7.1 important bug fixes for the embedded editor.
  • 2014-04-07 SVG-edit 2.7 was released.
  • 2013-01-15 SVG-edit 2.6 was released.

Videos

Supported browsers

The following browsers had been tested for 2.6 or earlier and will probably continue to work with 3.0.

  • Firefox 1.5+
  • Opera 9.50+
  • Safari 4+
  • Chrome 1+
  • IE 9+ and Edge

Further reading and more information