inspired by SVG.js
draft.js is a lightweight library for parametric design.
draft.js is licensed under the terms of the MIT License.
Prebuilt distributions can be found on the releases page.
# Install via Bowerbower install draft.js# Install via npmnpm install draft.js
Include the library at the top of 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;
- Indent with two spaces
- Use semicolons at the ends of lines