Go to file
cuixiping e2377b12c7 Update .gitignore 2020-01-06 21:09:36 +08:00
.github/ISSUE_TEMPLATE - Disable Github workflows for now 2019-12-24 09:48:49 +08:00
badges - Docs: Update coverage badge 2020-01-06 13:51:25 +08:00
build - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +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
cypress - Refactoring: Avoid redundant creation of text node for strings when passing to `append` 2020-01-04 16:43:03 +08:00
demos - Linting (ESLint): Lint per latest ash-nazg (e.g., named capture) 2019-07-03 17:50:46 +08:00
dist - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +08:00
docs - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +08:00
editor - Build: Update underscore copy 2020-01-06 16:02:03 +08:00
examples - Linting (ESLint): Use two spaces for indent 2018-05-18 14:05:52 +08:00
firefox-extension - Docs (JSDoc): Further on preferring `void` 2019-04-16 08:59:53 +08:00
gh-disabled-workflows - Disable Github workflows for now 2019-12-24 09:48:49 +08:00
opera-widget - Linting (ESLint): Lint per latest ash-nazg (e.g., named capture) 2019-07-03 17:50:46 +08:00
releases Add submodules from 4.0.0 to 5.0.0 2020-01-06 21:09:04 +08:00
screencasts - Linting (ESLint): Replace `innerHTML` with `textContent` from old demo 2019-12-19 08:25:23 +08:00
.babelrc - Build: Babel 7 2018-09-26 21:27:52 +08:00
.editorconfig - Linting: Comment out unused var. 2019-11-12 22:11:46 +08:00
.eslintignore - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +08:00
.eslintrc.js - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +08:00
.gitignore Update .gitignore 2020-01-06 21:09:36 +08:00
.gitmodules Add submodules from 4.0.0 to 5.0.0 2020-01-06 21:09:04 +08:00
.htmlhintrc - Linting (Markdown): Fix linting format 2018-10-19 15:19:18 +08:00
.ncurc.js - Update: Copy of core-js and qr-manipulation 2019-12-27 07:32:39 +08:00
.npmignore - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +08:00
.remarkrc - Linting (Markdown): Fix linting format 2018-10-19 15:19:18 +08:00
.travis.yml - Get errors for Jekyll builds 2020-01-06 18:13:39 +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 - Build: Update underscore copy 2020-01-06 16:02:03 +08:00
FUNDING.yml Add funding template pointing to IssueHunt 2019-06-20 13:16:50 +08:00
Gemfile - Gemfile: Try file format at https://bundler.io/man/gemfile.5.html 2020-01-06 18:32:33 +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 Update README.md 2020-01-06 20:22:45 +08:00
composer.json - Linting (HTML): Use double-quotes for attributes, remove redundant `type=text/css`, 2018-05-13 09:58:13 +08:00
cypress.json - Refactoring: Move `build-html` to `build` directory 2020-01-06 13:42:52 +08:00
jsconfig.json - Testing: Switch to Cypress with code coverage 2019-11-23 21:18:05 +08:00
lgtm.yml - Refactoring: Rename no modules redirect file to begin with "redirect" as with other redirect 2018-10-24 11:03:26 +08:00
mocha-multi-reporters.json - Testing: Remove extra `spec` 2020-01-06 14:45:53 +08:00
package-lock.json - Build: Update underscore copy 2020-01-06 16:02:03 +08:00
package.json - Build: Update underscore copy 2020-01-06 16:02:03 +08:00
rollup-config.config.js - Linting (ESLint): Fix for stricter linting checks 2019-08-19 15:52:47 -07:00
rollup.config.js - Revert `prefer-named-capture-group` due to apparently problematic Babel plugin 2019-11-16 10:08:38 +08:00
svgedit-config-es.js - BREAKING CHANGE: Remove `$.pref` in favor of new `svgEditor.pref` 2020-01-05 08:54:16 +08:00
svgedit-config-iife.js - Linting (ESLint): Fix linting regression 2020-01-05 18:30:21 +08:00

README.md

LOGO SVG-edit

npm Dependencies devDependencies

tests badge coverage badge

Known Vulnerabilities Total Alerts Code Quality: Javascript

License

issuehunt-to-marktext

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

Help wanted

While we have made some recent releases to SVG-edit for bug fixes, refactoring and documentation to make the codebase more maintainable, the core developers responsible for the bulk of the drawing features are no longer active with the project, so we would love others familiar with SVG to join the project.

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>

Note that if you want support for the following browsers, you will at least need some polyfills.

For Android Browser 4.4.3-4.4.4, you will need at least fetch.

For the following, you will need at least URL, Promise, and fetch:

  • IE <= 11
  • IE Mobile
  • Opera Mini
  • Blackberry Browser <= 10

And for still older browsers (e.g., IE 8), you will at minimum need a querySelector polyfill.

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. You will need to have Node.js/npm installed.

  1. Create and enter an empty folder somewhere on your desktop.
  2. Create your npm package: npm init (complete the fields).
  3. Install SVG-edit into your package: npm i --save svgedit.
  4. Look within node_modules/svgedit/, e.g., node_modules/svgedit/editor/svg-editor.html for the files your package needs and use accordingly (from outside of node_modules).
  5. If you want to publish your own work, you can use 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.
    1. JavaScript:
      1. Run npm install within the svgedit directory (node_modules/svgedit if you installed via npm) and the root repository directory if you cloned the Git repository instead. This will install the build tools for SVG-edit.
      2. Run npm run build-by-config within the svgedit directory mentioned in the step above.
        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.
    2. 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

  • 2019-11-16 Published 5.1.0 Misc. fixes and refactoring
  • 2019-05-07 Published 5.0.0 Change from @babel/polyfill
  • 2019-04-03 Published 4.3.0 Fix for double click on gradient picker droplets affecting some browsers and dragging control point of arc. Other misc. fixes. Some accessibility and i18n.
  • 2018-12-13 Published 4.2.0 (Chinese (simplified) and Russian locale updates; retaining lines with grid mode)
  • 2018-11-29 Published 4.1.0 (Fix for hyphenated locales, svgcanvas distributions)
  • 2018-11-16 Published 4.0.0/4.0.1 (Move to Promise-based APIs)
  • 2018-11-01 Published 3.2.0 (Update qunit to resolve security vulnerability of a dependency)
  • 2018-10-25 Published 3.1.1 (Fix for saving SVG on Firefox)
  • 2018-10-24 Published 3.1.0 (Redirect on modular page for non-module-support; versions document (for migrating))
  • 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