Browse Source

new docs, added fixed parameter to nodes

css_transitions
Alex de Mulder 10 years ago
parent
commit
89b225b066
3 changed files with 23 additions and 6 deletions
  1. +17
    -1
      docs/graph.html
  2. +5
    -5
      examples/graph/17_network_info.html
  3. +1
    -0
      src/graph/Graph.js

+ 17
- 1
docs/graph.html View File

@ -290,6 +290,14 @@ var nodes = [
the same color schema.</td> the same color schema.</td>
</tr> </tr>
<tr>
<td>fixed</td>
<td>Boolean</td>
<td>false</td>
<td>If fixed is true, then the node will not move from its supplied position.
If only an x position has been supplied, it is only fixed in the x-direction.
The same holds for y. If both x and y have been defined, the node will not move.</td>
</tr>
<tr> <tr>
<td>fontColor</td> <td>fontColor</td>
<td>String</td> <td>String</td>
@ -827,6 +835,14 @@ var options = {
<td>"#2B7CE9"</td> <td>"#2B7CE9"</td>
<td>Default border color of the node when selected.</td> <td>Default border color of the node when selected.</td>
</tr> </tr>
<tr>
<td>fixed</td>
<td>Boolean</td>
<td>false</td>
<td>If fixed is true, then the node will not move from its supplied position.
If only an x position has been supplied, it is only fixed in the x-direction.
The same holds for y. If both x and y have been defined, the node will not move.</td>
</tr>
<tr> <tr>
<td>fontColor</td> <td>fontColor</td>
@ -1139,7 +1155,7 @@ var nodes = [
<h3 id="Physics">Physics</h3> <h3 id="Physics">Physics</h3>
<p> <p>
The physics system has been overhauled to increase performance. The original simulation method was based on particel physics with a repulsion field (potential) around each node,
The original simulation method was based on particel physics with a repulsion field (potential) around each node,
and the edges were modelled as springs. The new system employed the <a href="http://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation">Barnes-Hut</a> gravitational simulation model. The edges are still modelled as springs. and the edges were modelled as springs. The new system employed the <a href="http://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation">Barnes-Hut</a> gravitational simulation model. The edges are still modelled as springs.
To unify the physics system, the damping, repulsion distance and edge length have been combined in an physics option. To retain good behaviour, both the old repulsion model and the Barnes-Hut model have their own parameters. To unify the physics system, the damping, repulsion distance and edge length have been combined in an physics option. To retain good behaviour, both the old repulsion model and the Barnes-Hut model have their own parameters.
If no options for the physics system are supplied, the Barnes-Hut method will be used with the default parameters. If no options for the physics system are supplied, the Barnes-Hut method will be used with the default parameters.

+ 5
- 5
examples/graph/17_network_info.html View File

@ -96,11 +96,11 @@
var x = - mygraph.clientWidth / 2 + 50; var x = - mygraph.clientWidth / 2 + 50;
var y = - mygraph.clientHeight / 2 + 50; var y = - mygraph.clientHeight / 2 + 50;
var step = 70; var step = 70;
nodes.push({id: 1000, x: x, y: y, label: 'Internet', group: 'internet', value: 1});
nodes.push({id: 1001, x: x, y: y + step, label: 'Switch', group: 'switch', value: 1});
nodes.push({id: 1002, x: x, y: y + 2 * step, label: 'Server', group: 'server', value: 1});
nodes.push({id: 1003, x: x, y: y + 3 * step, label: 'Computer', group: 'desktop', value: 1});
nodes.push({id: 1004, x: x, y: y + 4 * step, label: 'Smartphone', group: 'mobile', value: 1});
nodes.push({id: 1000, x: x, y: y, label: 'Internet', group: 'internet', value: 1, fixed:true});
nodes.push({id: 1001, x: x, y: y + step, label: 'Switch', group: 'switch', value: 1, fixed:true});
nodes.push({id: 1002, x: x, y: y + 2 * step, label: 'Server', group: 'server', value: 1, fixed:true});
nodes.push({id: 1003, x: x, y: y + 3 * step, label: 'Computer', group: 'desktop', value: 1, fixed:true});
nodes.push({id: 1004, x: x, y: y + 4 * step, label: 'Smartphone', group: 'mobile', value: 1, fixed:true});
// create a graph // create a graph
var container = document.getElementById('mygraph'); var container = document.getElementById('mygraph');

+ 1
- 0
src/graph/Graph.js View File

@ -40,6 +40,7 @@ function Graph (container, data, options) {
image: undefined, image: undefined,
widthMin: 16, // px widthMin: 16, // px
widthMax: 64, // px widthMax: 64, // px
fixed:false,
fontColor: 'black', fontColor: 'black',
fontSize: 14, // px fontSize: 14, // px
fontFace: 'verdana', fontFace: 'verdana',

Loading…
Cancel
Save