diagramflow实现一个可拖拽流程图效果代码
代码语言:html
所属分类:图表
代码描述:diagramflow实现一个可拖拽流程图效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>HTML5流程图拖拽定义JS插件</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/diagramflow.js"></script> </head> <body> <div style="position:relative;width:800px;height:500px"> <canvas id="myCanvas" width="100" height="100" tabindex="1"></canvas> </div> <div id="divSelectedNode"></div> <script> var Figures = { Rectangle: function (ctx, node) { ctx.beginPath(); ctx.fillStyle = node.fillStyle; ctx.strokeStyle = "blue"; ctx.fillRect(node.x, node.y, node.w, node.h); ctx.fillStyle = "black"; ctx.font = "10px Verdana"; ctx.textBaseline = "top"; node.textfill(ctx); }, Circle: function (ctx, node) { ctx.beginPath(); ctx.fillStyle = node.fillStyle; ctx.ellipse(node.x + node.w / 2, node.y + node.h / 2, node.w / 2, node.h / 2, 0, 0, 2 * Math.PI); ctx.fill(); node.textfill(ctx); }, Diamond: function (ctx, node) { ctx.beginPath(); ctx.fillStyle = node.f.........完整代码请登录后点击上方下载按钮下载查看
网友评论0