0.0.1-build.6 • Published 8 years ago
umljs v0.0.1-build.6
The project is based on Fabric for creating objects on canvas and elkjs for generating layouts.
Quick start
Install dependencies
yarn installStart developing
gulpBuild the project
Build distribution and minified distribution files 'build/uml.js', 'build/uml.min.js'
gulp buildGetting started
Preparation
Create an HTML element with an id attribute. Something like:
<canvas id="uml"></canvas>Create an UML document
Next, use the UML() function to create an UML document within the wrapper element:
window.UML = new UML('uml');The first argument should be an id of the element. The second optional argument is options for fabric.Canvas.
Draw diagram
Pass JSON object to UML.draw() (Promise function):
const json = JSON.stringify({
"title": "Some diagram",
"type": "usecase-diagram",
"definitions": {
"Actor01": {
"title": "John Doe",
"type": "actor"
}
}
});
window.UML.draw(json).then(
() => console.log('Diagram was successfully created!'),
(error) => alert(error)
);Result:

If error:

0.0.1-build.6
8 years ago
0.0.1-build.4
8 years ago
0.0.1-build.3
8 years ago
0.0.1-build.2
8 years ago
0.0.1-build.1
8 years ago
0.0.4-build
8 years ago
0.0.2-build
8 years ago
0.0.1-build
8 years ago