提交 8e94f077 编写于 作者: L lang

force 加入 dispose

上级 aa9ce5a9
......@@ -4,6 +4,7 @@ var fs = require("fs");
var nodes = [];
var links = [];
var categories = [];
var nodesIdxMap = {};
......
......@@ -144,8 +144,6 @@ define(function(require) {
}
function _filterData(nodes, links) {
var filteredNodeMap = [];
var cursor = 0;
nodesRawData = _filter(nodes, function(node, idx) {
......@@ -485,6 +483,8 @@ define(function(require) {
temperature *= 0.999;
}
var interval;
function init(newOption, newComponent) {
option = newOption;
component = newComponent;
......@@ -494,7 +494,7 @@ define(function(require) {
self.clear();
_buildShape();
setInterval(function(){
interval = setInterval(function(){
_step();
}, stepTime);
}
......@@ -504,6 +504,10 @@ define(function(require) {
_buildShape();
temperature = 1.0;
}
function dispose(){
clearInterval(interval);
}
/**
* 输出动态视觉引导线
......@@ -566,6 +570,7 @@ define(function(require) {
self.refresh = refresh;
self.ondragstart = ondragstart;
self.ondragend = ondragend;
self.dispose = dispose;
init(option, component);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册