Browse Source

updated docs, fixed setsize message

flowchartTest
Alex de Mulder 9 years ago
parent
commit
415a27aa74
5 changed files with 34 additions and 31 deletions
  1. +5
    -2
      dist/vis.js
  2. +17
    -10
      docs/network/configure.html
  3. +6
    -16
      docs/network/manipulation.html
  4. +1
    -1
      docs/network/physics.html
  5. +5
    -2
      lib/network/modules/Canvas.js

+ 5
- 2
dist/vis.js View File

@ -21849,6 +21849,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.body = body;
this.pixelRatio = 1;
this.resizeTimer = undefined;
this.resizeFunction = this._onResize.bind(this);
this.options = {};
this.defaultOptions = {
@ -21901,7 +21902,8 @@ return /******/ (function(modules) { // webpackBootstrap
this.resizeTimer = setInterval(function () {
_this2.setSize();_this2.body.emitter.emit('_requestRedraw');
}, 1000);
util.addEventListener(window, 'resize', this._onResize);
this.resizeFunction = this._onResize.bind(this);
util.addEventListener(window, 'resize', this.resizeFunction);
}
}
}, {
@ -21911,7 +21913,8 @@ return /******/ (function(modules) { // webpackBootstrap
if (this.resizeTimer !== undefined) {
clearInterval(this.resizeTimer);
}
util.removeEventListener(window, 'resize', this._onResize);
util.removeEventListener(window, 'resize', this.resizeFunction);
this.resizeFunction = undefined;
}
}, {
key: '_onResize',

+ 17
- 10
docs/network/configure.html View File

@ -87,23 +87,30 @@
<h3>Options</h3>
<p>The options for the canvas have to be contained in an object titled 'configure'.</p>
<p>Click on the options shown to show how these options are supposed to be used.</p>
<p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
<ul class="nav nav-tabs">
<li role="presentation" class="active" onclick="hideOptions('fullTab','fullOptions');" id="hiddenTab"><a href="#">options hidden</a></li>
<li role="presentation" onclick="toggleTab('fullTab','fullOptions');" id="fullTab"><a href="#">options shown</a></li>
<li role="presentation" class="active" onclick="hideOptions('fullTab','fullOptions','shortTab','shortOptions');" id="hiddenTab"><a href="#">options hidden</a></li>
<li role="presentation" onclick="toggleTab('fullTab','fullOptions','shortTab','shortOptions');" id="fullTab"><a href="#">full options</a></li>
<li role="presentation" onclick="toggleTab('shortTab','shortOptions','fullTab','fullOptions');" id="shortTab"><a href="#">shorthand options</a></li>
</ul>
<br>
<pre class="prettyprint lang-js options hidden" id="fullOptions">
<pre class="prettyprint lang-js options top hidden" id="fullOptions">
// these are all options in full.
var options = {
configure:{
filter: 'nodes, physics', // or ['nodes','physics'] or true
container: document.getElementById("configDiv")
configure: {
enabled: true,
filter: 'nodes,edges',
container: undefined
}
}
// alternative:
network.setOptions(options);
</pre>
<pre class="prettyprint lang-js options top hidden" id="shortOptions">
// only the options that have shorthand notations are shown.
var options = {
configure: 'nodes, physics', // or ['nodes','physics'] or true
configure: 'nodes,edges'
}
network.setOptions(options);
@ -122,7 +129,7 @@ network.setOptions(options);
<td>enabled</td>
<td class="mid">Boolean</td>
<td class="mid"><code>true</code></td>
<td>
<td>Toggle the configuration interface on or off. This is an optional parameter. If left undefined and any of the other properties of this object are defined, this will be set to true.
</td>
</tr>
<tr>

+ 6
- 16
docs/network/manipulation.html View File

@ -88,22 +88,12 @@ var options = {
initiallyActive: false,
locale: 'en',
locales: locales,
functionality: {
addNode: true,
addEdge: true,
editNode: true,
editEdge: true,
deleteNode: true,
deleteEdge: true
},
handlerFunctions: {
addNode: undefined,
addEdge: undefined,
editNode: undefined,
editEdge: undefined,
deleteNode: undefined,
deleteEdge: undefined
},
addNode: true,
addEdge: true,
editNode: undefined,
editEdge: true,
deleteNode: true,
deleteEdge: true,
controlNodeStyle:{
// all node options are valid.
}

+ 1
- 1
docs/network/physics.html View File

@ -70,7 +70,7 @@
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<div class="container full">
<h1>Network - physics</h1>
<p>Handles the HTML part of the canvas.</p>
<p>Handles the physics simulation, moving the nodes and edges to show them clearly.</p>
<h3>Options</h3>
<p>The options for the physics have to be contained in an object titled 'physics'.</p>

+ 5
- 2
lib/network/modules/Canvas.js View File

@ -15,6 +15,7 @@ class Canvas {
this.body = body;
this.pixelRatio = 1;
this.resizeTimer = undefined;
this.resizeFunction = this._onResize.bind(this);
this.options = {};
this.defaultOptions = {
@ -56,7 +57,8 @@ class Canvas {
// automatically adapt to a changing size of the browser.
this._cleanUp();
this.resizeTimer = setInterval(() => {this.setSize(); this.body.emitter.emit("_requestRedraw");}, 1000);
util.addEventListener(window,'resize',this._onResize);
this.resizeFunction = this._onResize.bind(this);
util.addEventListener(window,'resize',this.resizeFunction);
}
}
@ -65,7 +67,8 @@ class Canvas {
if (this.resizeTimer !== undefined) {
clearInterval(this.resizeTimer);
}
util.removeEventListener(window,'resize',this._onResize);
util.removeEventListener(window,'resize',this.resizeFunction);
this.resizeFunction = undefined;
}
_onResize() {

Loading…
Cancel
Save