Browse Source

Fixed 1588, destroy now releases the dataset.

codeClimate
Alex de Mulder 8 years ago
parent
commit
18e1d1f2b4
4 changed files with 16 additions and 1 deletions
  1. +1
    -0
      HISTORY.md
  2. +7
    -1
      dist/vis.js
  3. +4
    -0
      lib/network/modules/EdgesHandler.js
  4. +4
    -0
      lib/network/modules/NodesHandler.js

+ 1
- 0
HISTORY.md View File

@ -12,6 +12,7 @@ http://visjs.org
on the manipulation toolbar. on the manipulation toolbar.
- Fixed #1334 (again): Network now ignores scroll when interaction:zoomView is false. - Fixed #1334 (again): Network now ignores scroll when interaction:zoomView is false.
- Added options to customize the hierarchical layout without the use of physics. - Added options to customize the hierarchical layout without the use of physics.
- Fixed #1588: destroy now unsubscribed from the dataset.
### Graph2d ### Graph2d

+ 7
- 1
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 4.12.1-SNAPSHOT * @version 4.12.1-SNAPSHOT
* @date 2016-01-18
* @date 2016-01-19
* *
* @license * @license
* Copyright (C) 2011-2016 Almende B.V, http://almende.com * Copyright (C) 2011-2016 Almende B.V, http://almende.com
@ -28577,6 +28577,9 @@ return /******/ (function(modules) { // webpackBootstrap
this.body.emitter.on('refreshNodes', this.refresh.bind(this)); this.body.emitter.on('refreshNodes', this.refresh.bind(this));
this.body.emitter.on('refresh', this.refresh.bind(this)); this.body.emitter.on('refresh', this.refresh.bind(this));
this.body.emitter.on('destroy', function () { this.body.emitter.on('destroy', function () {
util.forEach(_this2.nodesListeners, function (callback, event) {
if (_this2.body.data.nodes) _this2.body.data.nodes.off(event, callback);
});
delete _this2.body.functions.createNode; delete _this2.body.functions.createNode;
delete _this2.nodesListeners.add; delete _this2.nodesListeners.add;
delete _this2.nodesListeners.update; delete _this2.nodesListeners.update;
@ -31517,6 +31520,9 @@ return /******/ (function(modules) { // webpackBootstrap
this.body.emitter.on("refreshEdges", this.refresh.bind(this)); this.body.emitter.on("refreshEdges", this.refresh.bind(this));
this.body.emitter.on("refresh", this.refresh.bind(this)); this.body.emitter.on("refresh", this.refresh.bind(this));
this.body.emitter.on("destroy", function () { this.body.emitter.on("destroy", function () {
util.forEach(_this2.edgesListeners, function (callback, event) {
if (_this2.body.data.edges) _this2.body.data.edges.off(event, callback);
});
delete _this2.body.functions.createEdge; delete _this2.body.functions.createEdge;
delete _this2.edgesListeners.add; delete _this2.edgesListeners.add;
delete _this2.edgesListeners.update; delete _this2.edgesListeners.update;

+ 4
- 0
lib/network/modules/EdgesHandler.js View File

@ -141,6 +141,10 @@ class EdgesHandler {
this.body.emitter.on("refreshEdges", this.refresh.bind(this)); this.body.emitter.on("refreshEdges", this.refresh.bind(this));
this.body.emitter.on("refresh", this.refresh.bind(this)); this.body.emitter.on("refresh", this.refresh.bind(this));
this.body.emitter.on("destroy", () => { this.body.emitter.on("destroy", () => {
util.forEach(this.edgesListeners, (callback, event) => {
if (this.body.data.edges)
this.body.data.edges.off(event, callback);
});
delete this.body.functions.createEdge; delete this.body.functions.createEdge;
delete this.edgesListeners.add; delete this.edgesListeners.add;
delete this.edgesListeners.update; delete this.edgesListeners.update;

+ 4
- 0
lib/network/modules/NodesHandler.js View File

@ -115,6 +115,10 @@ class NodesHandler {
this.body.emitter.on('refreshNodes', this.refresh.bind(this)); this.body.emitter.on('refreshNodes', this.refresh.bind(this));
this.body.emitter.on('refresh', this.refresh.bind(this)); this.body.emitter.on('refresh', this.refresh.bind(this));
this.body.emitter.on('destroy', () => { this.body.emitter.on('destroy', () => {
util.forEach(this.nodesListeners, (callback, event) => {
if (this.body.data.nodes)
this.body.data.nodes.off(event, callback);
});
delete this.body.functions.createNode; delete this.body.functions.createNode;
delete this.nodesListeners.add; delete this.nodesListeners.add;
delete this.nodesListeners.update; delete this.nodesListeners.update;

Loading…
Cancel
Save