Dynamicloading - Loading graph model data dynamically to limit the number of cells in the model.
动态加载图形
http://localhost/mxgraph/javascript/examples/dynamicloading.html
function main(container)
{
...
// Line: 51
// 添加点击事件监听
graph.addListener(mxEvent.CLICK, function(sender, evt)
{
var cell = evt.getProperty('cell');
if (cell != null)
{
// 加载图形
load(graph, cell);
}
});
...
// Line: 77
// 添加动画效果
graph.getModel().addListener(mxEvent.CHANGE, function(sender, evt)
{
var changes = evt.getProperty('edit').changes;
mxEffects.animateChanges(graph, changes);
});
}
function load(graph, cell)
{
...
// 删除其他所有顶点
for (var key in graph.getModel().cells)
{
var tmp = graph.getModel().getCell(key);
if (tmp != cell && graph.getModel().isVertex(tmp))
{
// 删除顶点后 以该顶点为源或目标的连线也会被删除
graph.removeCells([tmp]);
}
}
// 临时创建model,包含新添加的cells,合并到当前parent
graph.getModel().mergeChildren(model.getRoot().getChildAt(0), parent);
...
// 计算并更新坐标
...
}
分享到:
相关推荐
threejs-example-image-tracking-dynamic-lighting-源码.rar
1、lgb模型转换pmml格式
使用SpringBoot2.x集成Netty4.x创建基于TCP/IP协议的服务端和客户端的Demo代码案例 使用了SpringBoot+swaggerUI方式进行测试,客户端可以给服务端发送消息,服务端也可以给已经连上的客户端发送消息,使用了通道保活...
MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2MiniDao-example1.2...
maven-example-3.0.0-sources.jar
regression-analysis-by-example-5th-edition
qeephp 入门 example-todo-2009-06-18.zip下载 qeephp 入门 example-todo-2009-06-18.zip下载
React使用动态参考用 create-react-library 制作安装npm install --save use-dynamic-refs用法 import React , { useEffect } from 'react' ;import useDynamicRefs from 'use-dynamic-refs' ;const Example = ( ) =...
华为集群客户端程序,编译执行参加csdn博客https://blog.csdn.net/gdeasy/article/details/103306512
openTCS是开源的AGV开发软件,软件是Java开发,可集成同步Unity一起运行
loopback-example-user-management, 环回用户管理示例 loopback-example-user-management$ git clone git@github.com:strongloop/loopback-example-user-management.git$ cd l
example-cpp-project-源码.rar
example-prometheus-nodejs-master.rar
pmml-lightgbm-example-executable-1.4-SNAPSHOT.jar。 lightgbm模型转pmml文件,可用于java程序调用,实现在线打分功能。 看网站上有人定价为付费,于是开出积分版本,赚点积分,谢谢支持 使用方法: 1. 生产模型...
Oracle Plsql By Example 4Th-代码示例-11g.rar
Anirudh-Munnangi-Forex-Forecasting--A-basic-example-using-neural-networks-archive-refs-heads-master.zip
每个工程示例都包括了该工程的项目文件、源文件、报告文件和生成结果等文件,读者可以用Quartus II或相应的软件直接打开。设计源文件根据设计输入类型分为源代码或原理图等。
python-nginx-example-app-源码.rar
pso-example-java-master.zip
maven-jboss-as-control-example-0.1.1-sources.jar