Browse Source

updated build

css_transitions
Alex de Mulder 10 years ago
parent
commit
25ad440a78
2 changed files with 8 additions and 64 deletions
  1. +2
    -58
      dist/vis.js
  2. +6
    -6
      dist/vis.min.js

+ 2
- 58
dist/vis.js View File

@ -14558,13 +14558,7 @@ var physicsMixin = {
// the forces are reset to zero in this loop by using _setForce instead
// of _addForce
if (this.constants.physics.hierarchicalRepulsion.enabled == true) {
this._calculateHierarchicalGravitationalForces();
}
else {
this._calculateGravitationalForces();
}
this._calculateGravitationalForces();
this._calculateNodeForces();
if (this.constants.smoothCurves == true) {
@ -15306,56 +15300,6 @@ var hierarchalRepulsionMixin = {
}
}
}
},
/**
* this function applies the central gravity effect to keep groups from floating off
*
* @private
*/
_calculateHierarchicalGravitationalForces: function () {
var dx, dy, distance, node, i, j, edges;
var nodes = this.calculationNodes;
var gravity = this.constants.physics.centralGravity;
var gravityForce = 0;
for (i = 0; i < this.calculationNodeIndices.length; i++) {
node = nodes[this.calculationNodeIndices[i]];
node.damping = this.constants.physics.damping; // possibly add function to alter damping properties of clusters.
node.fx = 0;
node.fy = 0;
}
for (i = 0; i < this.calculationNodeIndices.length; i++) {
node = nodes[this.calculationNodeIndices[i]];
edges = node.edges;
for (j = 0; j < edges.length; j++) {
if (edges[j].from.id != node.id) {
if (edges[j].to.level > edges[j].from.level) {
dx = edges[j].to.x-edges[j].from.x;
dy = edges[j].to.y-edges[j].from.y;
distance = Math.sqrt(dx * dx + dy * dy);
gravityForce = (distance == 0) ? 0 : (gravity / distance);
edges[j].to.fx -= dx * gravityForce;
edges[j].to.fy -= dy * gravityForce;
}
}
else {
if (edges[j].from.level > edges[j].to.level) {
dx = edges[j].to.x-edges[j].from.x;
dy = edges[j].to.y-edges[j].from.y;
distance = Math.sqrt(dx * dx + dy * dy);
gravityForce = (distance == 0) ? 0 : (gravity / distance);
edges[j].to.fx -= dx * gravityForce;
edges[j].to.fy -= dy * gravityForce;
}
}
}
}
}
};
/**
@ -19631,7 +19575,7 @@ function Graph (container, data, options) {
nodeDistance: 100,
damping: 0.09
},
hierarchicalRepulsion: {
hierarchicalRepulsion: {
enabled: false,
centralGravity: 0.5,
springLength: 150,

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


Loading…
Cancel
Save