Browse Source

failed experiment to use branes Hut with repulsionfields. reverting.

css_transitions
Alex de Mulder 10 years ago
parent
commit
2da8641aaa
4 changed files with 25 additions and 25 deletions
  1. +10
    -10
      dist/vis.js
  2. +6
    -6
      dist/vis.min.js
  3. +1
    -1
      examples/graph/22_les_miserables.html
  4. +8
    -8
      src/graph/Node.js

+ 10
- 10
dist/vis.js View File

@ -4,8 +4,8 @@
* *
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 0.5.0-SNAPSHOT
* @date 2014-02-08
* @version @@version
* @date @@date
* *
* @license * @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com * Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -9150,13 +9150,13 @@ function Node(properties, imagelist, grouplist, constants) {
this.clusterSizeRadiusFactor = constants.clustering.nodeScaling.radius; this.clusterSizeRadiusFactor = constants.clustering.nodeScaling.radius;
// mass, force, velocity // mass, force, velocity
this.mass = 1; // kg (mass is adjusted for the number of connected edges)
this.mass = 1; // kg
this.fx = 0.0; // external force x this.fx = 0.0; // external force x
this.fy = 0.0; // external force y this.fy = 0.0; // external force y
this.vx = 0.0; // velocity x this.vx = 0.0; // velocity x
this.vy = 0.0; // velocity y this.vy = 0.0; // velocity y
this.minForce = constants.minForce; this.minForce = constants.minForce;
this.damping = 0.9; // this is manipulated in the updateDaming function
this.damping = 0.9; // this is manipulated in the updateDamping function
this.graphScaleInv = 1; this.graphScaleInv = 1;
this.canvasTopLeft = {"x": -300, "y": -300}; this.canvasTopLeft = {"x": -300, "y": -300};
@ -9187,7 +9187,7 @@ Node.prototype.attachEdge = function(edge) {
this.dynamicEdges.push(edge); this.dynamicEdges.push(edge);
} }
this.dynamicEdgesLength = this.dynamicEdges.length; this.dynamicEdgesLength = this.dynamicEdges.length;
this._updateMass();
// this._updateMass();
}; };
/** /**
@ -9201,7 +9201,7 @@ Node.prototype.detachEdge = function(edge) {
this.dynamicEdges.splice(index, 1); this.dynamicEdges.splice(index, 1);
} }
this.dynamicEdgesLength = this.dynamicEdges.length; this.dynamicEdgesLength = this.dynamicEdges.length;
this._updateMass();
// this._updateMass();
}; };
/** /**
@ -9209,9 +9209,9 @@ Node.prototype.detachEdge = function(edge) {
* to it (more edges -> heavier node). * to it (more edges -> heavier node).
* @private * @private
*/ */
Node.prototype._updateMass = function() {
this.mass = 1;// + 0.6 * this.edges.length; // kg
};
//Node.prototype._updateMass = function() {
// this.mass = 1;// + 0.6 * this.edges.length; // kg
//};
/** /**
* Set or overwrite properties for the node * Set or overwrite properties for the node
@ -10055,7 +10055,7 @@ Node.prototype.setScale = function(scale) {
* @param {Number} numberOfNodes * @param {Number} numberOfNodes
*/ */
Node.prototype.updateDamping = function(numberOfNodes) { Node.prototype.updateDamping = function(numberOfNodes) {
this.damping = (1 + 0.1*this.clusterSize * (1 + Math.pow(numberOfNodes,-2)));
this.damping = (0.9 + 0.1*this.clusterSize * (1 + Math.pow(numberOfNodes,-2)));
}; };

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


+ 1
- 1
examples/graph/22_les_miserables.html View File

@ -361,7 +361,7 @@
edges: edges edges: edges
}; };
var options = {stabilize: false};
var options = {nodes: {shape:'circle'},stabilize: false};
var graph = new vis.Graph(container, data, options); var graph = new vis.Graph(container, data, options);
} }
</script> </script>

+ 8
- 8
src/graph/Node.js View File

@ -68,13 +68,13 @@ function Node(properties, imagelist, grouplist, constants) {
this.clusterSizeRadiusFactor = constants.clustering.nodeScaling.radius; this.clusterSizeRadiusFactor = constants.clustering.nodeScaling.radius;
// mass, force, velocity // mass, force, velocity
this.mass = 1; // kg (mass is adjusted for the number of connected edges)
this.mass = 1; // kg
this.fx = 0.0; // external force x this.fx = 0.0; // external force x
this.fy = 0.0; // external force y this.fy = 0.0; // external force y
this.vx = 0.0; // velocity x this.vx = 0.0; // velocity x
this.vy = 0.0; // velocity y this.vy = 0.0; // velocity y
this.minForce = constants.minForce; this.minForce = constants.minForce;
this.damping = 0.9; // this is manipulated in the updateDaming function
this.damping = 0.9; // this is manipulated in the updateDamping function
this.graphScaleInv = 1; this.graphScaleInv = 1;
this.canvasTopLeft = {"x": -300, "y": -300}; this.canvasTopLeft = {"x": -300, "y": -300};
@ -105,7 +105,7 @@ Node.prototype.attachEdge = function(edge) {
this.dynamicEdges.push(edge); this.dynamicEdges.push(edge);
} }
this.dynamicEdgesLength = this.dynamicEdges.length; this.dynamicEdgesLength = this.dynamicEdges.length;
this._updateMass();
// this._updateMass();
}; };
/** /**
@ -119,7 +119,7 @@ Node.prototype.detachEdge = function(edge) {
this.dynamicEdges.splice(index, 1); this.dynamicEdges.splice(index, 1);
} }
this.dynamicEdgesLength = this.dynamicEdges.length; this.dynamicEdgesLength = this.dynamicEdges.length;
this._updateMass();
// this._updateMass();
}; };
/** /**
@ -127,9 +127,9 @@ Node.prototype.detachEdge = function(edge) {
* to it (more edges -> heavier node). * to it (more edges -> heavier node).
* @private * @private
*/ */
Node.prototype._updateMass = function() {
this.mass = 1;// + 0.6 * this.edges.length; // kg
};
//Node.prototype._updateMass = function() {
// this.mass = 1;// + 0.6 * this.edges.length; // kg
//};
/** /**
* Set or overwrite properties for the node * Set or overwrite properties for the node
@ -973,7 +973,7 @@ Node.prototype.setScale = function(scale) {
* @param {Number} numberOfNodes * @param {Number} numberOfNodes
*/ */
Node.prototype.updateDamping = function(numberOfNodes) { Node.prototype.updateDamping = function(numberOfNodes) {
this.damping = (1 + 0.1*this.clusterSize * (1 + Math.pow(numberOfNodes,-2)));
this.damping = (0.9 + 0.1*this.clusterSize * (1 + Math.pow(numberOfNodes,-2)));
}; };

Loading…
Cancel
Save