gojs实现流程图绘制拖动效果

代码语言:html

所属分类:图表

代码描述:gojs实现流程图绘制拖动效果

代码标签: 绘制 拖动 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>

    <meta charset="UTF-8">
	
<link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/goDataInspector.css">
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/go-1.89.js"></script>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/goDataInspector.js"></script>
    <script id="code">
        function init() {
            if (window.goSamples) goSamples();
            var $$ = go.GraphObject.make;

            myDiagram =
                $$(go.Diagram, "myDiagramDiv",  // 创建空的背景图
                    {
                        initialContentAlignment: go.Spot.Center,
                        allowCopy: false,
                        allowDrop: true,  // must be true to accept drops from the Palette  必须接受来自调色板的元素
                        "LinkDrawn": showLinkLabel,  // this DiagramEvent listener is defined below
                        "LinkRelinked": showLinkLabel,
                        scrollsPageOnFocus: false,
                        "undoManager.isEnabled": true,  // 启用撤销和恢复
                        allowRelink : false
                    }
                );
            // helper definitions for node templates

            function nodeStyle() {
                return [
                    // The Node.location comes from the "loc" property of the node data,
                    // converted by the Point.parse static method.
                    // If the Node.location is changed, it updates the "loc" property of the node data,
                    // converting back using the Point.stringify static method.
                    new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
                    {
                        // the Node.........完整代码请登录后点击上方下载按钮下载查看

网友评论0