提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:黄竹雯|2018-11-14 13:15:01.000|阅读 399 次
概述:小编为大家准备了一套完整的GoJS的示例,将以连载的形式展开,供大家学习和交流讨论。
# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>
相关链接:
GoJS是一款功能强大,快速且轻量级的流程图控件,可帮助你在JavaScript 和 HTML5 Canvas程序中创建流程图,且极大地简化你的JavaScript / Canvas 程序。
小编为大家准备了一套完整的GoJS的示例,将以连载的形式展开,供大家学习和交流讨论。
这不是GoJS的真正最小化演示,因为我们确实指定了自定义Node模板,但它非常简单。如果单击链接,示例的完整来源如下所示。
此示例使用Node模板设置Diagram.nodeTemplate,该模板数据绑定文本字符串和形状的填充颜色。有关构建自己的模板和模型数据的概述,请参阅“入门教程”。
该Diagram.initialContentAlignment设置导致图表内容出现在图的视口的中心。
使用鼠标和常用键盘命令,你可以平移,选择,移动,复制,删除和撤消/重做。在触摸设备上,使用手指作为鼠标,并保持手指静止以显示上下文菜单。默认上下文菜单支持当时为所选对象启用的大多数标准命令。
有关更精细和更有说服力的样本,请参阅基本示例。有关从服务器加载JSON数据的示例,请参阅最小化JSON示例。有关从服务器加载XML数据的示例,请参阅最小化XML示例。
以下为在页面中查看此示例页面的源代码:
function init() { if (window.goSamples) goSamples(); // init for these samples -- you don't need to call this var $ = go.GraphObject.make; // for conciseness in defining templates myDiagram = $(go.Diagram, "myDiagramDiv", // create a Diagram for the DIV HTML element { initialContentAlignment: go.Spot.Center, // center the content "undoManager.isEnabled": true // enable undo & redo }); // define a simple Node template myDiagram.nodeTemplate = $(go.Node, "Auto", // the Shape will go around the TextBlock $(go.Shape, "RoundedRectangle", { strokeWidth: 0, fill: "white" }, // Shape.fill is bound to Node.data.color new go.Binding("fill", "color")), $(go.TextBlock, { margin: 8 }, // some room around the text // TextBlock.text is bound to Node.data.key new go.Binding("text", "key")) ); // but use the default Link template, by not setting Diagram.linkTemplate // create the model data that will be represented by Nodes and Links myDiagram.model = new go.GraphLinksModel( [ { key: "Alpha", color: "lightblue" }, { key: "Beta", color: "orange" }, { key: "Gamma", color: "lightgreen" }, { key: "Delta", color: "pink" } ], [ { from: "Alpha", to: "Beta" }, { from: "Alpha", to: "Gamma" }, { from: "Beta", to: "Beta" }, { from: "Gamma", to: "Delta" }, { from: "Delta", to: "Alpha" } ]); }
<div id="sample" deep="0"> <!-- The DIV for the Diagram needs an explicit size or else we won't see anything. This also adds a border to help see the edges of the viewport. --> <div id="myDiagramDiv" style="border: solid 1px black; width:400px; height:400px"></div> <p> This isn't a truly <i>minimal</i> demonstration of <b>GoJS</b>, because we do specify a custom Node template, but it's pretty simple. The whole source for the sample is shown below if you click on the link. </p> <p> This sample sets the <a>Diagram.nodeTemplate</a>, with a <a>Node</a> template that data binds both the text string and the shape's fill color. For an overview of building your own templates and model data, see the <a href="../learn/index.html">Getting Started tutorial.</a> </p> <p> The <a>Diagram.initialContentAlignment</a> setting causes the diagram's contents to appear in the center of the diagram's viewport. </p> <p> Using the mouse and common keyboard commands, you can pan, select, move, copy, delete, and undo/redo. On touch devices, use your finger to act as the mouse, and hold your finger stationary to bring up a context menu. The default context menu supports most of the standard commands that are enabled at that time for the selected object. </p> <p> For a more elaborate and capable sample, see the <a href="basic.html">Basic</a> sample. For a sample that loads JSON data from the server, see the <a href="minimalJSON.html">Minimal JSON</a> sample. For a sample that loads XML data from the server, see the <a href="minimalXML.html">Minimal XML</a> sample. </p> </div>
以下为在GitHub上查看此示例页面的源代码:
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Minimal GoJS Sample</title> <meta name="description" content="An almost minimal diagram using a very simple node template and the default link template." /> <!-- Copyright 1998-2018 by Northwoods Software Corporation. --> <meta charset="UTF-8"> <script src="../release/go.js"></script> <script src="../assets/js/goSamples.js"></script> <!-- this is only for the GoJS Samples framework --> <script id="code"> function init() { if (window.goSamples) goSamples(); // init for these samples -- you don't need to call this var $ = go.GraphObject.make; // for conciseness in defining templates myDiagram = $(go.Diagram, "myDiagramDiv", // create a Diagram for the DIV HTML element { initialContentAlignment: go.Spot.Center, // center the content "undoManager.isEnabled": true // enable undo & redo }); // define a simple Node template myDiagram.nodeTemplate = $(go.Node, "Auto", // the Shape will go around the TextBlock $(go.Shape, "RoundedRectangle", { strokeWidth: 0, fill: "white" }, // Shape.fill is bound to Node.data.color new go.Binding("fill", "color")), $(go.TextBlock, { margin: 8 }, // some room around the text // TextBlock.text is bound to Node.data.key new go.Binding("text", "key")) ); // but use the default Link template, by not setting Diagram.linkTemplate // create the model data that will be represented by Nodes and Links myDiagram.model = new go.GraphLinksModel( [ { key: "Alpha", color: "lightblue" }, { key: "Beta", color: "orange" }, { key: "Gamma", color: "lightgreen" }, { key: "Delta", color: "pink" } ], [ { from: "Alpha", to: "Beta" }, { from: "Alpha", to: "Gamma" }, { from: "Beta", to: "Beta" }, { from: "Gamma", to: "Delta" }, { from: "Delta", to: "Alpha" } ]); } </script> </head> <body onload="init()"> <div id="sample"> <!-- The DIV for the Diagram needs an explicit size or else we won't see anything. This also adds a border to help see the edges of the viewport. --> <div id="myDiagramDiv" style="border: solid 1px black; width:400px; height:400px"></div> <p> This isn't a truly <i>minimal</i> demonstration of <b>GoJS</b>, because we do specify a custom Node template, but it's pretty simple. The whole source for the sample is shown below if you click on the link. </p> <p> This sample sets the <a>Diagram.nodeTemplate</a>, with a <a>Node</a> template that data binds both the text string and the shape's fill color. For an overview of building your own templates and model data, see the <a href="../learn/index.html">Getting Started tutorial.</a> </p> <p> The <a>Diagram.initialContentAlignment</a> setting causes the diagram's contents to appear in the center of the diagram's viewport. </p> <p> Using the mouse and common keyboard commands, you can pan, select, move, copy, delete, and undo/redo. On touch devices, use your finger to act as the mouse, and hold your finger stationary to bring up a context menu. The default context menu supports most of the standard commands that are enabled at that time for the selected object. </p> <p> For a more elaborate and capable sample, see the <a href="basic.html">Basic</a> sample. For a sample that loads JSON data from the server, see the <a href="minimalJSON.html">Minimal JSON</a> sample. For a sample that loads XML data from the server, see the <a href="minimalXML.html">Minimal XML</a> sample. </p> </div> </body> </html>
想要查看在线操作示例,可以点击此处
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@cahobeh.cn
本文探讨 SQL Server 中 NULL 和空值之间的区别,并讨论如何有效地处理它们。
Unity 是一款功能极其丰富的游戏引擎,允许开发人员将各种媒体集成到他们的项目中。但是,它缺少最令人兴奋的功能之一 - 将 Web 内容(例如 HTML、CSS 和 JavaScript)直接渲染到 3D 场景中的纹理上的能力。在本文中,我们将介绍如何使用 DotNetBrowser 在 Unity3D 中将 Web 内容渲染为纹理。
DevExpress v24.2帮助文档正式发布上线了,请按版本按需下载~
本教程将向您展示如何用MyEclipse构建一个Web项目,欢迎下载最新版IDE体验!
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@cahobeh.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢