Browse Source

Added zoomExtentOnStabilize option to network. fixed ex 17

v3_develop
Alex de Mulder 9 years ago
parent
commit
cad2b17629
5 changed files with 1821 additions and 1801 deletions
  1. +1
    -0
      HISTORY.md
  2. +1802
    -1797
      dist/vis.js
  3. +8
    -0
      docs/network.html
  4. +4
    -3
      examples/network/17_network_info.html
  5. +6
    -1
      lib/network/Network.js

+ 1
- 0
HISTORY.md View File

@ -7,6 +7,7 @@ http://visjs.org
### Network
- Fixed flipping of hierarchical network on update when using RL and DU.
- Added zoomExtentOnStabilize option to network.
### Graph2d

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


+ 8
- 0
docs/network.html View File

@ -790,6 +790,14 @@ var options = {
before showing the result. If your simulation takes too long to stabilize, this number can be reduced. On the other hand, if your network is not stabilized after loading, this number can be increased.</td>
</tr>
<tr>
<td>zoomExtentOnStabilize</td>
<td>Boolean</td>
<td>true</td>
<td>When the internal stabilize function is called because the stabilize option is set to true OR the hierarchical system (re)initializes, a call to zoomExtent is done by default. By setting this to false, you can avoid this call.</td>
</tr>
<tr>
<td>width</td>
<td>String</td>

+ 4
- 3
examples/network/17_network_info.html View File

@ -4,16 +4,17 @@
<title>Network | Images</title>
<style type="text/css">
body {
html, body {
font: 10pt arial;
padding: 0;
margin: 0;
overflow: hidden;
width: 100%;
height: 100%;
}
#mynetwork {
width: 100%;
height: 100%;
box-sizing: border-box;
}
</style>

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

@ -191,6 +191,7 @@ function Network (container, data, options) {
minVelocity: 0.1, // px/s
stabilize: true, // stabilize before displaying the network
stabilizationIterations: 1000, // maximum number of iteration to stabilize
zoomExtentOnStabilize: true,
locale: 'en',
locales: locales,
tooltip: {
@ -1993,7 +1994,11 @@ Network.prototype._stabilize = function() {
this._physicsTick();
count++;
}
this.zoomExtent(undefined,false,true);
if (this.constants.zoomExtentOnStabilize == true) {
this.zoomExtent(undefined, false, true);
}
if (this.constants.freezeForStabilization == true) {
this._restoreFrozenNodes();
}

Loading…
Cancel
Save