draft-svg
draft-svg is a plugin for draft.js that renders models using SVG.
draft-svg is licensed under the terms of the MIT License.
Installation
Prebuilt distributions can be found on the releases page.
You can also use Bower
or npm
:
# Install via Bower bower install draft-svg # Install via npm npm install draft-svg
Getting Started
Include the plugin after draft.js in your html file:
...
Write a new script and include it after your html content:
// Create a new draft document and add a group to itvar doc = ;var group = doc; // Add some shapes to the groupvar rect = group;var circle = group; // Create a view for the groupvar view = group; // Use the draft-svg plugin to render an imagevar body = document;body;
Acknowledgements
- Wout Fierens, Ulrich-Matthias Schäfer, and all the other contributors to the SVG.js library.