Browse Source

fire emit every time the network stabilizes, updated history

v3_develop
Alex de Mulder 10 years ago
parent
commit
043987db15
4 changed files with 3983 additions and 3952 deletions
  1. +6
    -0
      HISTORY.md
  2. +3969
    -3950
      dist/vis.js
  3. +2
    -1
      docs/network.html
  4. +6
    -1
      lib/network/Network.js

+ 6
- 0
HISTORY.md View File

@ -20,6 +20,12 @@ http://visjs.org
- Added multiple types of smoothCurve drawing for greatly improved performance. - Added multiple types of smoothCurve drawing for greatly improved performance.
- Option for inherited edge colors from connected nodes. - Option for inherited edge colors from connected nodes.
- Option to disable the drawing of nodes or edges on drag. - Option to disable the drawing of nodes or edges on drag.
- Fixed support nodes not being cleaned up if edges are removed.
- Improved edge selection detection for long smooth curves.
- Fixed dot radius bug.
- Updated max velocity of nodes to three times it's original value.
- Made "stabilized" event fire every time the network stabilizes.
## 2014-07-07, version 3.0.0 ## 2014-07-07, version 3.0.0

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


+ 2
- 1
docs/network.html View File

@ -2417,7 +2417,8 @@ network.off('select', onSelect);
</tr> </tr>
<tr> <tr>
<td>stabilized</td> <td>stabilized</td>
<td>Fired when the network has been stabilized after initialization. This event can be used to trigger the .storePosition() function after stabilization.</td>
<td>Fired when the network has been stabilized. This event can be used to trigger the .storePosition() function after stabilization. When the network in initialized, the parameter
iterations will be the amount of iterations it took to stabilize. After initialization, this parameter is null.</td>
<td> <td>
<ul> <ul>
<li><code>iterations</code>: number of iterations used to stabilize</li> <li><code>iterations</code>: number of iterations used to stabilize</li>

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

@ -2088,7 +2088,12 @@ Network.prototype._discreteStepNodes = function() {
this.moving = true; this.moving = true;
} }
else { else {
this.moving = this._isMoving(vminCorrected) || this.constants.configurePhysics;
this.moving = this._isMoving(vminCorrected);
if (this.moving == false) {
this.emit("stabilized",{iterations:null});
}
this.moving = this.moving || this.configurePhysics;
} }
} }
}; };

Loading…
Cancel
Save