Browse Source

added bounding box to image node style

v3_develop
Alex de Mulder 10 years ago
parent
commit
5c16cf00f8
13 changed files with 2214 additions and 2083 deletions
  1. +2100
    -2080
      dist/vis.js
  2. +10
    -1
      examples/network/02_random_nodes.html
  3. +9
    -0
      examples/network/06_groups.html
  4. +8
    -0
      examples/network/15_dot_language_playground.html
  5. +9
    -0
      examples/network/18_fully_random_nodes_clustering.html
  6. +9
    -0
      examples/network/19_scale_free_graph_clustering.html
  7. +9
    -0
      examples/network/20_navigation.html
  8. +7
    -1
      examples/network/23_hierarchical_layout.html
  9. +8
    -0
      examples/network/24_hierarchical_layout_userdefined.html
  10. +8
    -0
      examples/network/31_localization.html
  11. +9
    -0
      examples/network/32_hierarchicaLayoutMethods.html
  12. +7
    -0
      examples/network/33_animation.html
  13. +21
    -1
      lib/network/Network.js

+ 2100
- 2080
dist/vis.js
File diff suppressed because it is too large
View File


+ 10
- 1
examples/network/02_random_nodes.html View File

@ -22,7 +22,16 @@
var edges = null; var edges = null;
var network = null; var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
var connectionCount = []; var connectionCount = [];
@ -75,7 +84,7 @@
nodes: nodes, nodes: nodes,
edges: edges edges: edges
}; };
var options = {stabilization:false};
var options = {stabilize:false};
network = new vis.Network(container, data, options); network = new vis.Network(container, data, options);
// add event listeners // add event listeners

+ 9
- 0
examples/network/06_groups.html View File

@ -28,8 +28,17 @@
// Set callback to run when API is loaded // Set callback to run when API is loaded
google.setOnLoadCallback(draw); google.setOnLoadCallback(draw);
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
// Called when the Visualization API is loaded. // Called when the Visualization API is loaded.
function draw() { function draw() {
destroy();
var from, to; var from, to;
nodes = []; nodes = [];

+ 8
- 0
examples/network/15_dot_language_playground.html View File

@ -92,8 +92,16 @@
network.redraw() network.redraw()
}; };
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
// parse and draw the data // parse and draw the data
function draw () { function draw () {
destroy();
try { try {
txtError.innerHTML = ''; txtError.innerHTML = '';

+ 9
- 0
examples/network/18_fully_random_nodes_clustering.html View File

@ -22,7 +22,16 @@
var edges = null; var edges = null;
var network = null; var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
// randomly create some nodes and edges // randomly create some nodes and edges

+ 9
- 0
examples/network/19_scale_free_graph_clustering.html View File

@ -22,7 +22,16 @@
var edges = null; var edges = null;
var network = null; var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
var connectionCount = []; var connectionCount = [];

+ 9
- 0
examples/network/20_navigation.html View File

@ -41,7 +41,16 @@
var edges = null; var edges = null;
var network = null; var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
var connectionCount = []; var connectionCount = [];

+ 7
- 1
examples/network/23_hierarchical_layout.html View File

@ -22,9 +22,15 @@
var edges = null; var edges = null;
var network = null; var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
var connectionCount = []; var connectionCount = [];

+ 8
- 0
examples/network/24_hierarchical_layout_userdefined.html View File

@ -23,7 +23,15 @@
var network = null; var network = null;
var directionInput = document.getElementById("direction"); var directionInput = document.getElementById("direction");
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
var connectionCount = []; var connectionCount = [];

+ 8
- 0
examples/network/31_localization.html View File

@ -60,7 +60,15 @@
var edges = null; var edges = null;
var network = null; var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
nodes = []; nodes = [];
edges = []; edges = [];
var connectionCount = []; var connectionCount = [];

+ 9
- 0
examples/network/32_hierarchicaLayoutMethods.html View File

@ -21,7 +21,16 @@
var network = null; var network = null;
var layoutMethod = "hubsize"; var layoutMethod = "hubsize";
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
var nodes = []; var nodes = [];
var edges = []; var edges = [];
// randomly create some nodes and edges // randomly create some nodes and edges

+ 7
- 0
examples/network/33_animation.html View File

@ -46,8 +46,15 @@
var statusUpdateSpan; var statusUpdateSpan;
var finishMessage = ""; var finishMessage = "";
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
function draw() { function draw() {
destroy();
statusUpdateSpan = document.getElementById("statusUpdate"); statusUpdateSpan = document.getElementById("statusUpdate");
doButton = document.getElementById("btnDo"); doButton = document.getElementById("btnDo");
focusButton = document.getElementById("btnFocus"); focusButton = document.getElementById("btnFocus");

+ 21
- 1
lib/network/Network.js View File

@ -841,6 +841,15 @@ Network.prototype._createKeyBinds = function() {
Network.prototype.destroy = function() { Network.prototype.destroy = function() {
this.start = function () {};
this.redraw = function () {};
this.timer = false;
setTimeout(this._destroy.bind(this), 10);
}
Network.prototype._destroy = function() {
// remove keybindings // remove keybindings
this.keycharm.reset(); this.keycharm.reset();
@ -850,7 +859,15 @@ Network.prototype.destroy = function() {
// clear events // clear events
this.off(); this.off();
// remove all elements from the container element.
while (this.frame.hasChildNodes()) {
this.frame.removeChild(this.frame.firstChild);
}
// remove all elements from the container element.
while (this.containerElement.hasChildNodes()) {
this.containerElement.removeChild(this.containerElement.firstChild);
}
} }
@ -2520,7 +2537,10 @@ Network.prototype.animateView = function (options) {
} }
}; };
/**
* used to animate smoothly by hijacking the redraw function.
* @private
*/
Network.prototype._lockedRedraw = function () { Network.prototype._lockedRedraw = function () {
var nodePosition = {x: this.nodes[this.lockedOnNodeId].x, y: this.nodes[this.lockedOnNodeId].y}; var nodePosition = {x: this.nodes[this.lockedOnNodeId].x, y: this.nodes[this.lockedOnNodeId].y};
var viewCenter = this.DOMtoCanvas({x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight}); var viewCenter = this.DOMtoCanvas({x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight});

Loading…
Cancel
Save