项目作者: syuhei176

项目描述 :
Customizable Diagram Editor
高级语言: JavaScript
项目地址: git://github.com/syuhei176/clooca-diagram-editor.git
创建时间: 2015-11-02T14:29:26Z
项目社区:https://github.com/syuhei176/clooca-diagram-editor

开源协议:

下载


README.md

Customizable Diagram Editor

Demo

https://syuhei176.github.io/clooca-diagram-editor/dist/index.html

Custom Shape

https://syuhei176.github.io/clooca-diagram-editor/dist/custom.html

Example

  1. <script src="diagram-editor.js"></script>
  2. <script>
  3. window.addEventListener('load', function(e) {
  4. var diagramEditor = new CloocaDiagramEditor.DiagramEditor("main");
  5. var toolpallet = diagramEditor.createToolPallet();
  6. toolpallet.addItem('select', 'selectIcon')
  7. toolpallet.addItem('rect', 'rectIcon')
  8. diagramEditor.on('addNode', function() {
  9. })
  10. var node1 = diagramEditor.addNode({
  11. bound:{
  12. x : 100,
  13. y : 100,
  14. w : 100,
  15. h : 50
  16. }});
  17. node1.setPos(120, 120)
  18. var node2 = diagramEditor.addNode({
  19. bound:{
  20. x : 200,
  21. y : 100,
  22. w : 100,
  23. h : 50
  24. }});
  25. diagramEditor.addConnection(node1, node2, {/*options*/})
  26. node1.updateText('Book\n-----\n+ title:string')
  27. node2.updateText('Order\n-----\n+ id:string')
  28. });
  29. </script>
  30. <div id="main"></div>

ScreenShot