Browse Source

refactor: graph --> network

css_transitions
Alex de Mulder 10 years ago
parent
commit
d65fbafcd7
140 changed files with 544 additions and 547 deletions
  1. +22
    -22
      Jakefile.js
  2. +0
    -0
      dist/img/network/acceptDeleteIcon.png
  3. +0
    -0
      dist/img/network/addNodeIcon.png
  4. +0
    -0
      dist/img/network/backIcon.png
  5. +0
    -0
      dist/img/network/connectIcon.png
  6. +0
    -0
      dist/img/network/cross.png
  7. +0
    -0
      dist/img/network/cross2.png
  8. +0
    -0
      dist/img/network/deleteIcon.png
  9. +0
    -0
      dist/img/network/downArrow.png
  10. +0
    -0
      dist/img/network/editIcon.png
  11. +0
    -0
      dist/img/network/leftArrow.png
  12. +0
    -0
      dist/img/network/minus.png
  13. +0
    -0
      dist/img/network/plus.png
  14. +0
    -0
      dist/img/network/rightArrow.png
  15. +0
    -0
      dist/img/network/upArrow.png
  16. +0
    -0
      dist/img/network/zoomExtends.png
  17. +13
    -13
      dist/vis.css
  18. +97
    -98
      dist/vis.js
  19. +1
    -1
      dist/vis.min.css
  20. +7
    -7
      dist/vis.min.js
  21. +2
    -2
      docs/index.html
  22. +60
    -60
      docs/network.html
  23. +6
    -6
      examples/Network/01_basic_usage.html
  24. +9
    -9
      examples/Network/02_random_nodes.html
  25. +8
    -8
      examples/Network/03_images.html
  26. +7
    -7
      examples/Network/04_shapes.html
  27. +7
    -7
      examples/Network/05_social_network.html
  28. +8
    -8
      examples/Network/06_groups.html
  29. +8
    -8
      examples/Network/07_selections.html
  30. +8
    -8
      examples/Network/08_mobile_friendly.html
  31. +7
    -7
      examples/Network/09_sizing.html
  32. +6
    -6
      examples/Network/10_multiline_text.html
  33. +7
    -7
      examples/Network/11_custom_style.html
  34. +7
    -7
      examples/Network/12_scalable_images.html
  35. +6
    -6
      examples/Network/13_dashed_lines.html
  36. +18
    -0
      examples/Network/14_dot_language.html
  37. +12
    -12
      examples/Network/15_dot_language_playground.html
  38. +8
    -8
      examples/Network/16_dynamic_data.html
  39. +11
    -11
      examples/Network/17_network_info.html
  40. +9
    -9
      examples/Network/18_fully_random_nodes_clustering.html
  41. +11
    -11
      examples/Network/19_scale_free_graph_clustering.html
  42. +16
    -16
      examples/Network/20_navigation.html
  43. +16
    -16
      examples/Network/21_data_manipulation.html
  44. +6
    -6
      examples/Network/22_les_miserables.html
  45. +11
    -11
      examples/Network/23_hierarchical_layout.html
  46. +8
    -8
      examples/Network/24_hierarchical_layout_userdefined.html
  47. +11
    -11
      examples/Network/25_physics_configuration.html
  48. +0
    -0
      examples/Network/graphviz/data/fsm.gv.txt
  49. +0
    -0
      examples/Network/graphviz/data/hello.gv.txt
  50. +0
    -0
      examples/Network/graphviz/data/process.gv.txt
  51. +0
    -0
      examples/Network/graphviz/data/siblings.gv.txt
  52. +0
    -0
      examples/Network/graphviz/data/softmaint.gv.txt
  53. +0
    -0
      examples/Network/graphviz/data/traffic_lights.gv.txt
  54. +0
    -0
      examples/Network/graphviz/data/transparency.gv.txt
  55. +0
    -0
      examples/Network/graphviz/data/twopi2.gv.txt
  56. +0
    -0
      examples/Network/graphviz/data/unix.gv.txt
  57. +0
    -0
      examples/Network/graphviz/data/world.gv.txt
  58. +1
    -1
      examples/Network/graphviz/graphviz_gallery.html
  59. +0
    -0
      examples/Network/graphviz/screenshots/fsm.png
  60. +0
    -0
      examples/Network/graphviz/screenshots/hello.png
  61. +0
    -0
      examples/Network/graphviz/screenshots/softmaint.png
  62. +0
    -0
      examples/Network/graphviz/screenshots/traffic_lights.png
  63. +0
    -0
      examples/Network/img/refresh-cl/Hardware-Fax-icon.png
  64. +0
    -0
      examples/Network/img/refresh-cl/Hardware-Laptop-1-icon.png
  65. +0
    -0
      examples/Network/img/refresh-cl/Hardware-Mobile-Phone-icon.png
  66. +0
    -0
      examples/Network/img/refresh-cl/Hardware-My-Computer-3-icon.png
  67. +0
    -0
      examples/Network/img/refresh-cl/Hardware-My-PDA-02-icon.png
  68. +0
    -0
      examples/Network/img/refresh-cl/Hardware-My-PDA-04-icon.png
  69. +0
    -0
      examples/Network/img/refresh-cl/Hardware-My-PDA-05-icon.png
  70. +0
    -0
      examples/Network/img/refresh-cl/Hardware-My-Phone-Picture-icon.png
  71. +0
    -0
      examples/Network/img/refresh-cl/Hardware-Printer-Blue-icon.png
  72. +0
    -0
      examples/Network/img/refresh-cl/Misc-Scanner-default-icon.png
  73. +0
    -0
      examples/Network/img/refresh-cl/Network-Drive-icon.png
  74. +0
    -0
      examples/Network/img/refresh-cl/Network-Internet-Connection-icon.png
  75. +0
    -0
      examples/Network/img/refresh-cl/Network-Pipe-icon.png
  76. +0
    -0
      examples/Network/img/refresh-cl/System-Firewall-2-icon.png
  77. +0
    -0
      examples/Network/img/refresh-cl/System-Globe-icon.png
  78. +0
    -0
      examples/Network/img/refresh-cl/license.txt
  79. +0
    -0
      examples/Network/img/soft-scraps-icons/Document-icon24.png
  80. +0
    -0
      examples/Network/img/soft-scraps-icons/Document-icon32.png
  81. +0
    -0
      examples/Network/img/soft-scraps-icons/Document-icon48.png
  82. +0
    -0
      examples/Network/img/soft-scraps-icons/Email-icon24.png
  83. +0
    -0
      examples/Network/img/soft-scraps-icons/Email-icon32.png
  84. +0
    -0
      examples/Network/img/soft-scraps-icons/Email-icon48.png
  85. +0
    -0
      examples/Network/img/soft-scraps-icons/Folder-icon24.png
  86. +0
    -0
      examples/Network/img/soft-scraps-icons/Folder-icon32.png
  87. +0
    -0
      examples/Network/img/soft-scraps-icons/Folder-icon48.png
  88. +0
    -0
      examples/Network/img/soft-scraps-icons/Folder-icon64.png
  89. +0
    -0
      examples/Network/img/soft-scraps-icons/Smiley-Angry-icon.png
  90. +0
    -0
      examples/Network/img/soft-scraps-icons/Smiley-Grin-icon.png
  91. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Administrator-Blue-icon.png
  92. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Administrator-Green-icon.png
  93. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Coat-Blue-icon.png
  94. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Coat-Green-icon.png
  95. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Coat-Red-icon.png
  96. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Executive-Green-icon.png
  97. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Preppy-Blue-icon.png
  98. +0
    -0
      examples/Network/img/soft-scraps-icons/User-Preppy-Red-icon.png
  99. +0
    -0
      examples/Network/img/soft-scraps-icons/license.txt
  100. +2
    -2
      examples/Network/index.html

+ 22
- 22
Jakefile.js View File

@ -49,8 +49,8 @@ task('build', {async: true}, function () {
'./src/timeline/component/css/dataaxis.css',
'./src/timeline/component/css/pathStyles.css',
'./src/graph/css/graph-manipulation.css',
'./src/graph/css/graph-navigation.css'
'./src/network/css/network-manipulation.css',
'./src/network/css/network-navigation.css'
],
dest: VIS_CSS,
separator: '\n'
@ -88,25 +88,25 @@ task('build', {async: true}, function () {
'./src/timeline/Timeline.js',
'./src/timeline/Graph2d.js',
'./src/graph/dotparser.js',
'./src/graph/shapes.js',
'./src/graph/Node.js',
'./src/graph/Edge.js',
'./src/graph/Popup.js',
'./src/graph/Groups.js',
'./src/graph/Images.js',
'./src/graph/graphMixins/physics/PhysicsMixin.js',
'./src/graph/graphMixins/physics/HierarchialRepulsion.js',
'./src/graph/graphMixins/physics/BarnesHut.js',
'./src/graph/graphMixins/physics/Repulsion.js',
'./src/graph/graphMixins/HierarchicalLayoutMixin.js',
'./src/graph/graphMixins/ManipulationMixin.js',
'./src/graph/graphMixins/SectorsMixin.js',
'./src/graph/graphMixins/ClusterMixin.js',
'./src/graph/graphMixins/SelectionMixin.js',
'./src/graph/graphMixins/NavigationMixin.js',
'./src/graph/graphMixins/MixinLoader.js',
'./src/graph/Graph.js',
'./src/network/dotparser.js',
'./src/network/shapes.js',
'./src/network/Node.js',
'./src/network/Edge.js',
'./src/network/Popup.js',
'./src/network/Groups.js',
'./src/network/Images.js',
'./src/network/networkMixins/physics/PhysicsMixin.js',
'./src/network/networkMixins/physics/HierarchialRepulsion.js',
'./src/network/networkMixins/physics/BarnesHut.js',
'./src/network/networkMixins/physics/Repulsion.js',
'./src/network/networkMixins/HierarchicalLayoutMixin.js',
'./src/network/networkMixins/ManipulationMixin.js',
'./src/network/networkMixins/SectorsMixin.js',
'./src/network/networkMixins/ClusterMixin.js',
'./src/network/networkMixins/SelectionMixin.js',
'./src/network/networkMixins/NavigationMixin.js',
'./src/network/networkMixins/MixinLoader.js',
'./src/network/Network.js',
'./src/graph3d/Graph3d.js',
@ -117,7 +117,7 @@ task('build', {async: true}, function () {
});
// copy images
wrench.copyDirSyncRecursive('./src/graph/img', DIST + '/img/graph', {
wrench.copyDirSyncRecursive('./src/network/img', DIST + '/img/network', {
forceDelete: true
});
wrench.copyDirSyncRecursive('./src/timeline/img', DIST + '/img/timeline', {

dist/img/graph/acceptDeleteIcon.png → dist/img/network/acceptDeleteIcon.png View File


dist/img/graph/addNodeIcon.png → dist/img/network/addNodeIcon.png View File


dist/img/graph/backIcon.png → dist/img/network/backIcon.png View File


dist/img/graph/connectIcon.png → dist/img/network/connectIcon.png View File


dist/img/graph/cross.png → dist/img/network/cross.png View File


dist/img/graph/cross2.png → dist/img/network/cross2.png View File


dist/img/graph/deleteIcon.png → dist/img/network/deleteIcon.png View File


dist/img/graph/downArrow.png → dist/img/network/downArrow.png View File


dist/img/graph/editIcon.png → dist/img/network/editIcon.png View File


dist/img/graph/leftArrow.png → dist/img/network/leftArrow.png View File


dist/img/graph/minus.png → dist/img/network/minus.png View File


dist/img/graph/plus.png → dist/img/network/plus.png View File


dist/img/graph/rightArrow.png → dist/img/network/rightArrow.png View File


dist/img/graph/upArrow.png → dist/img/network/upArrow.png View File


dist/img/graph/zoomExtends.png → dist/img/network/zoomExtends.png View File


+ 13
- 13
dist/vis.css View File

@ -546,7 +546,7 @@ div.graph-manipulation-closeDiv {
margin-left:590px;
background-position: 0px 0px;
background-repeat:no-repeat;
background-image: url("img/graph/cross.png");
background-image: url("img/network/cross.png");
cursor: pointer;
-webkit-touch-callout: none;
-webkit-user-select: none;
@ -586,7 +586,7 @@ span.graph-manipulationUI:active {
}
span.graph-manipulationUI.back {
background-image: url("img/graph/backIcon.png");
background-image: url("img/network/backIcon.png");
}
span.graph-manipulationUI.none:hover {
@ -605,11 +605,11 @@ span.graph-manipulationUI.notification{
}
span.graph-manipulationUI.add {
background-image: url("img/graph/addNodeIcon.png");
background-image: url("img/network/addNodeIcon.png");
}
span.graph-manipulationUI.edit {
background-image: url("img/graph/editIcon.png");
background-image: url("img/network/editIcon.png");
}
span.graph-manipulationUI.edit.editmode {
@ -620,11 +620,11 @@ span.graph-manipulationUI.edit.editmode {
}
span.graph-manipulationUI.connect {
background-image: url("img/graph/connectIcon.png");
background-image: url("img/network/connectIcon.png");
}
span.graph-manipulationUI.delete {
background-image: url("img/graph/deleteIcon.png");
background-image: url("img/network/deleteIcon.png");
}
/* top right bottom left */
span.graph-manipulationLabel {
@ -670,37 +670,37 @@ div.graph-navigation.active {
}
div.graph-navigation.up {
background-image: url("img/graph/upArrow.png");
background-image: url("img/network/upArrow.png");
bottom:50px;
left:55px;
}
div.graph-navigation.down {
background-image: url("img/graph/downArrow.png");
background-image: url("img/network/downArrow.png");
bottom:10px;
left:55px;
}
div.graph-navigation.left {
background-image: url("img/graph/leftArrow.png");
background-image: url("img/network/leftArrow.png");
bottom:10px;
left:15px;
}
div.graph-navigation.right {
background-image: url("img/graph/rightArrow.png");
background-image: url("img/network/rightArrow.png");
bottom:10px;
left:95px;
}
div.graph-navigation.zoomIn {
background-image: url("img/graph/plus.png");
background-image: url("img/network/plus.png");
bottom:10px;
right:15px;
}
div.graph-navigation.zoomOut {
background-image: url("img/graph/minus.png");
background-image: url("img/network/minus.png");
bottom:10px;
right:55px;
}
div.graph-navigation.zoomExtends {
background-image: url("img/graph/zoomExtends.png");
background-image: url("img/network/zoomExtends.png");
bottom:50px;
right:15px;
}

+ 97
- 98
dist/vis.js View File

@ -4,8 +4,8 @@
*
* A dynamic, browser-based visualization library.
*
* @version 2.0.1-SNAPSHOT
* @date 2014-07-01
* @version @@version
* @date @@date
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -12292,9 +12292,9 @@ if (typeof CanvasRenderingContext2D !== 'undefined') {
* {string} image An image url
* {string} title An title text, can be HTML
* {anytype} group A group name or number
* @param {Graph.Images} imagelist A list with images. Only needed
* @param {Network.Images} imagelist A list with images. Only needed
* when the node has an image
* @param {Graph.Groups} grouplist A list with groups. Needed for
* @param {Network.Groups} grouplist A list with groups. Needed for
* retrieving group properties
* @param {Object} constants An object with default values for
* example for the color
@ -13252,7 +13252,7 @@ Node.prototype.updateVelocity = function(massBeforeClustering) {
* to (number), label (string, color (string),
* width (number), style (string),
* length (number), title (string)
* @param {Graph} graph A graph object, used to find and edge to
* @param {Network} graph A graph object, used to find and edge to
* nodes.
* @param {Object} constants An object with default values for
* example for the color
@ -13372,6 +13372,7 @@ Edge.prototype.setProperties = function(properties, constants) {
else {
if (properties.color.color !== undefined) {this.color.color = properties.color.color;}
if (properties.color.highlight !== undefined) {this.color.highlight = properties.color.highlight;}
if (properties.color.hover !== undefined) {this.color.hover = properties.color.hover;}
}
}
@ -14232,7 +14233,7 @@ function Popup(container, x, y, text, style) {
style = text;
text = undefined;
} else {
// for backwards compatibility, in case clients other than Graph are creating Popup directly
// for backwards compatibility, in case clients other than Network are creating Popup directly
style = {
fontColor: 'black',
fontSize: 14, // px
@ -16666,7 +16667,7 @@ var manipulationMixin = {
var SectorMixin = {
/**
* This function is only called by the setData function of the Graph object.
* This function is only called by the setData function of the Network object.
* This loads the global references into the active sector. This initializes the sector.
*
* @private
@ -17018,7 +17019,7 @@ var SectorMixin = {
*
* @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
* | we dont pass the function itself because then the "this" is the window object
* | instead of the Graph object
* | instead of the Network object
* @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
@ -17057,7 +17058,7 @@ var SectorMixin = {
*
* @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
* | we dont pass the function itself because then the "this" is the window object
* | instead of the Graph object
* | instead of the Network object
* @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
@ -17086,7 +17087,7 @@ var SectorMixin = {
*
* @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
* | we don't pass the function itself because then the "this" is the window object
* | instead of the Graph object
* | instead of the Network object
* @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
@ -17124,7 +17125,7 @@ var SectorMixin = {
*
* @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
* | we don't pass the function itself because then the "this" is the window object
* | instead of the Graph object
* | instead of the Network object
* @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
@ -19280,7 +19281,7 @@ var graphMixinLoaders = {
_loadMixin: function (sourceVariable) {
for (var mixinFunction in sourceVariable) {
if (sourceVariable.hasOwnProperty(mixinFunction)) {
Graph.prototype[mixinFunction] = sourceVariable[mixinFunction];
Network.prototype[mixinFunction] = sourceVariable[mixinFunction];
}
}
},
@ -19295,7 +19296,7 @@ var graphMixinLoaders = {
_clearMixin: function (sourceVariable) {
for (var mixinFunction in sourceVariable) {
if (sourceVariable.hasOwnProperty(mixinFunction)) {
Graph.prototype[mixinFunction] = undefined;
Network.prototype[mixinFunction] = undefined;
}
}
},
@ -19465,18 +19466,18 @@ var graphMixinLoaders = {
};
/**
* @constructor Graph
* @constructor Network
* Create a graph visualization, displaying nodes and edges.
*
* @param {Element} container The DOM element in which the Graph will
* @param {Element} container The DOM element in which the Network will
* be created. Normally a div element.
* @param {Object} data An object containing parameters
* {Array} nodes
* {Array} edges
* @param {Object} options Options
*/
function Graph (container, data, options) {
if (!(this instanceof Graph)) {
function Network (container, data, options) {
if (!(this instanceof Network)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
@ -19685,13 +19686,13 @@ function Graph (container, data, options) {
this._loadPhysicsSystem();
// create a frame and canvas
this._create();
// load the sector system. (mandatory, fully integrated with Graph)
// load the sector system. (mandatory, fully integrated with Network)
this._loadSectorSystem();
// load the cluster system. (mandatory, even when not using the cluster system, there are function calls to it)
this._loadClusterSystem();
// load the selection system. (mandatory, required by Graph)
// load the selection system. (mandatory, required by Network)
this._loadSelectionSystem();
// load the selection system. (mandatory, required by Graph)
// load the selection system. (mandatory, required by Network)
this._loadHierarchySystem();
// apply options
@ -19777,8 +19778,8 @@ function Graph (container, data, options) {
}
}
// Extend Graph with an Emitter mixin
Emitter(Graph.prototype);
// Extend Network with an Emitter mixin
Emitter(Network.prototype);
/**
* Get the script path where the vis.js library is located
@ -19787,7 +19788,7 @@ Emitter(Graph.prototype);
* end with a slash.
* @private
*/
Graph.prototype._getScriptPath = function() {
Network.prototype._getScriptPath = function() {
var scripts = document.getElementsByTagName( 'script' );
// find script named vis.js or vis.min.js
@ -19808,7 +19809,7 @@ Graph.prototype._getScriptPath = function() {
* Find the center position of the graph
* @private
*/
Graph.prototype._getRange = function() {
Network.prototype._getRange = function() {
var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;
for (var nodeId in this.nodes) {
if (this.nodes.hasOwnProperty(nodeId)) {
@ -19831,7 +19832,7 @@ Graph.prototype._getRange = function() {
* @returns {{x: number, y: number}}
* @private
*/
Graph.prototype._findCenter = function(range) {
Network.prototype._findCenter = function(range) {
return {x: (0.5 * (range.maxX + range.minX)),
y: (0.5 * (range.maxY + range.minY))};
};
@ -19842,7 +19843,7 @@ Graph.prototype._findCenter = function(range) {
*
* @param {object} range = {minX: minX, maxX: maxX, minY: minY, maxY: maxY};
*/
Graph.prototype._centerGraph = function(range) {
Network.prototype._centerGraph = function(range) {
var center = this._findCenter(range);
center.x *= this.scale;
@ -19860,7 +19861,7 @@ Graph.prototype._centerGraph = function(range) {
* @param {Boolean} [initialZoom] | zoom based on fitted formula or range, true = fitted, default = false;
* @param {Boolean} [disableStart] | If true, start is not called.
*/
Graph.prototype.zoomExtent = function(initialZoom, disableStart) {
Network.prototype.zoomExtent = function(initialZoom, disableStart) {
if (initialZoom === undefined) {
initialZoom = false;
}
@ -19924,7 +19925,7 @@ Graph.prototype.zoomExtent = function(initialZoom, disableStart) {
* Update the this.nodeIndices with the most recent node index list
* @private
*/
Graph.prototype._updateNodeIndexList = function() {
Network.prototype._updateNodeIndexList = function() {
this._clearNodeIndexList();
for (var idx in this.nodes) {
if (this.nodes.hasOwnProperty(idx)) {
@ -19944,7 +19945,7 @@ Graph.prototype._updateNodeIndexList = function() {
* {Options} [options] Object with options
* @param {Boolean} [disableStart] | optional: disable the calling of the start function.
*/
Graph.prototype.setData = function(data, disableStart) {
Network.prototype.setData = function(data, disableStart) {
if (disableStart === undefined) {
disableStart = false;
}
@ -19990,7 +19991,7 @@ Graph.prototype.setData = function(data, disableStart) {
* @param {Object} options
* @param {Boolean} [initializeView] | set zoom and translation to default.
*/
Graph.prototype.setOptions = function (options) {
Network.prototype.setOptions = function (options) {
if (options) {
var prop;
// retrieve parameter values
@ -20233,13 +20234,13 @@ Graph.prototype.setOptions = function (options) {
};
/**
* Create the main frame for the Graph.
* This function is executed once when a Graph object is created. The frame
* Create the main frame for the Network.
* This function is executed once when a Network object is created. The frame
* contains a canvas, and this canvas contains all objects like the axis and
* nodes.
* @private
*/
Graph.prototype._create = function () {
Network.prototype._create = function () {
// remove all elements from the container element.
while (this.containerElement.hasChildNodes()) {
this.containerElement.removeChild(this.containerElement.firstChild);
@ -20292,7 +20293,7 @@ Graph.prototype._create = function () {
* Binding the keys for keyboard navigation. These functions are defined in the NavigationMixin
* @private
*/
Graph.prototype._createKeyBinds = function() {
Network.prototype._createKeyBinds = function() {
var me = this;
this.mousetrap = mousetrap;
@ -20333,7 +20334,7 @@ Graph.prototype._createKeyBinds = function() {
* @return {{x: Number, y: Number}} pointer
* @private
*/
Graph.prototype._getPointer = function (touch) {
Network.prototype._getPointer = function (touch) {
return {
x: touch.pageX - vis.util.getAbsoluteLeft(this.frame.canvas),
y: touch.pageY - vis.util.getAbsoluteTop(this.frame.canvas)
@ -20345,7 +20346,7 @@ Graph.prototype._getPointer = function (touch) {
* @param event
* @private
*/
Graph.prototype._onTouch = function (event) {
Network.prototype._onTouch = function (event) {
this.drag.pointer = this._getPointer(event.gesture.center);
this.drag.pinched = false;
this.pinch.scale = this._getScale();
@ -20357,7 +20358,7 @@ Graph.prototype._onTouch = function (event) {
* handle drag start event
* @private
*/
Graph.prototype._onDragStart = function () {
Network.prototype._onDragStart = function () {
this._handleDragStart();
};
@ -20368,7 +20369,7 @@ Graph.prototype._onDragStart = function () {
*
* @private
*/
Graph.prototype._handleDragStart = function() {
Network.prototype._handleDragStart = function() {
var drag = this.drag;
var node = this._getNodeAt(drag.pointer);
// note: drag.pointer is set in _onTouch to get the initial touch location
@ -20414,7 +20415,7 @@ Graph.prototype._handleDragStart = function() {
* handle drag event
* @private
*/
Graph.prototype._onDrag = function (event) {
Network.prototype._onDrag = function (event) {
this._handleOnDrag(event)
};
@ -20425,7 +20426,7 @@ Graph.prototype._onDrag = function (event) {
*
* @private
*/
Graph.prototype._handleOnDrag = function(event) {
Network.prototype._handleOnDrag = function(event) {
if (this.drag.pinched) {
return;
}
@ -20479,7 +20480,7 @@ Graph.prototype._handleOnDrag = function(event) {
* handle drag start event
* @private
*/
Graph.prototype._onDragEnd = function () {
Network.prototype._onDragEnd = function () {
this.drag.dragging = false;
var selection = this.drag.selection;
if (selection) {
@ -20495,7 +20496,7 @@ Graph.prototype._onDragEnd = function () {
* handle tap/click event: select/unselect a node
* @private
*/
Graph.prototype._onTap = function (event) {
Network.prototype._onTap = function (event) {
var pointer = this._getPointer(event.gesture.center);
this.pointerPosition = pointer;
this._handleTap(pointer);
@ -20507,7 +20508,7 @@ Graph.prototype._onTap = function (event) {
* handle doubletap event
* @private
*/
Graph.prototype._onDoubleTap = function (event) {
Network.prototype._onDoubleTap = function (event) {
var pointer = this._getPointer(event.gesture.center);
this._handleDoubleTap(pointer);
};
@ -20517,7 +20518,7 @@ Graph.prototype._onDoubleTap = function (event) {
* handle long tap event: multi select nodes
* @private
*/
Graph.prototype._onHold = function (event) {
Network.prototype._onHold = function (event) {
var pointer = this._getPointer(event.gesture.center);
this.pointerPosition = pointer;
this._handleOnHold(pointer);
@ -20528,7 +20529,7 @@ Graph.prototype._onHold = function (event) {
*
* @private
*/
Graph.prototype._onRelease = function (event) {
Network.prototype._onRelease = function (event) {
var pointer = this._getPointer(event.gesture.center);
this._handleOnRelease(pointer);
};
@ -20538,7 +20539,7 @@ Graph.prototype._onRelease = function (event) {
* @param event
* @private
*/
Graph.prototype._onPinch = function (event) {
Network.prototype._onPinch = function (event) {
var pointer = this._getPointer(event.gesture.center);
this.drag.pinched = true;
@ -20558,7 +20559,7 @@ Graph.prototype._onPinch = function (event) {
* @return {Number} appliedScale scale is limited within the boundaries
* @private
*/
Graph.prototype._zoom = function(scale, pointer) {
Network.prototype._zoom = function(scale, pointer) {
if (this.constants.zoomable == true) {
var scaleOld = this._getScale();
if (scale < 0.00001) {
@ -20601,7 +20602,7 @@ Graph.prototype._zoom = function(scale, pointer) {
* @param {MouseEvent} event
* @private
*/
Graph.prototype._onMouseWheel = function(event) {
Network.prototype._onMouseWheel = function(event) {
// retrieve delta
var delta = 0;
if (event.wheelDelta) { /* IE/Opera. */
@ -20643,7 +20644,7 @@ Graph.prototype._onMouseWheel = function(event) {
* @param {Event} event
* @private
*/
Graph.prototype._onMouseMoveTitle = function (event) {
Network.prototype._onMouseMoveTitle = function (event) {
var gesture = util.fakeGesture(this, event);
var pointer = this._getPointer(gesture.center);
@ -20708,7 +20709,7 @@ Graph.prototype._onMouseMoveTitle = function (event) {
* @param {{x:Number, y:Number}} pointer
* @private
*/
Graph.prototype._checkShowPopup = function (pointer) {
Network.prototype._checkShowPopup = function (pointer) {
var obj = {
left: this._XconvertDOMtoCanvas(pointer.x),
top: this._YconvertDOMtoCanvas(pointer.y),
@ -20778,7 +20779,7 @@ Graph.prototype._checkShowPopup = function (pointer) {
* @param {{x:Number, y:Number}} pointer
* @private
*/
Graph.prototype._checkHidePopup = function (pointer) {
Network.prototype._checkHidePopup = function (pointer) {
if (!this.popupObj || !this._getNodeAt(pointer) ) {
this.popupObj = undefined;
if (this.popup) {
@ -20795,7 +20796,7 @@ Graph.prototype._checkHidePopup = function (pointer) {
* @param {string} height Height in pixels or percentage (for example '400px'
* or '30%')
*/
Graph.prototype.setSize = function(width, height) {
Network.prototype.setSize = function(width, height) {
this.frame.style.width = width;
this.frame.style.height = height;
@ -20823,7 +20824,7 @@ Graph.prototype.setSize = function(width, height) {
* @param {Array | DataSet | DataView} nodes The data containing the nodes.
* @private
*/
Graph.prototype._setNodes = function(nodes) {
Network.prototype._setNodes = function(nodes) {
var oldNodesData = this.nodesData;
if (nodes instanceof DataSet || nodes instanceof DataView) {
@ -20869,7 +20870,7 @@ Graph.prototype._setNodes = function(nodes) {
* @param {Number[] | String[]} ids
* @private
*/
Graph.prototype._addNodes = function(ids) {
Network.prototype._addNodes = function(ids) {
var id;
for (var i = 0, len = ids.length; i < len; i++) {
id = ids[i];
@ -20901,7 +20902,7 @@ Graph.prototype._addNodes = function(ids) {
* @param {Number[] | String[]} ids
* @private
*/
Graph.prototype._updateNodes = function(ids) {
Network.prototype._updateNodes = function(ids) {
var nodes = this.nodes,
nodesData = this.nodesData;
for (var i = 0, len = ids.length; i < len; i++) {
@ -20933,7 +20934,7 @@ Graph.prototype._updateNodes = function(ids) {
* @param {Number[] | String[]} ids
* @private
*/
Graph.prototype._removeNodes = function(ids) {
Network.prototype._removeNodes = function(ids) {
var nodes = this.nodes;
for (var i = 0, len = ids.length; i < len; i++) {
var id = ids[i];
@ -20956,7 +20957,7 @@ Graph.prototype._removeNodes = function(ids) {
* @private
* @private
*/
Graph.prototype._setEdges = function(edges) {
Network.prototype._setEdges = function(edges) {
var oldEdgesData = this.edgesData;
if (edges instanceof DataSet || edges instanceof DataView) {
@ -21003,7 +21004,7 @@ Graph.prototype._setEdges = function(edges) {
* @param {Number[] | String[]} ids
* @private
*/
Graph.prototype._addEdges = function (ids) {
Network.prototype._addEdges = function (ids) {
var edges = this.edges,
edgesData = this.edgesData;
@ -21034,7 +21035,7 @@ Graph.prototype._addEdges = function (ids) {
* @param {Number[] | String[]} ids
* @private
*/
Graph.prototype._updateEdges = function (ids) {
Network.prototype._updateEdges = function (ids) {
var edges = this.edges,
edgesData = this.edgesData;
for (var i = 0, len = ids.length; i < len; i++) {
@ -21069,7 +21070,7 @@ Graph.prototype._updateEdges = function (ids) {
* @param {Number[] | String[]} ids
* @private
*/
Graph.prototype._removeEdges = function (ids) {
Network.prototype._removeEdges = function (ids) {
var edges = this.edges;
for (var i = 0, len = ids.length; i < len; i++) {
var id = ids[i];
@ -21096,7 +21097,7 @@ Graph.prototype._removeEdges = function (ids) {
* Reconnect all edges
* @private
*/
Graph.prototype._reconnectEdges = function() {
Network.prototype._reconnectEdges = function() {
var id,
nodes = this.nodes,
edges = this.edges;
@ -21124,7 +21125,7 @@ Graph.prototype._reconnectEdges = function() {
* setValueRange(min, max).
* @private
*/
Graph.prototype._updateValueRange = function(obj) {
Network.prototype._updateValueRange = function(obj) {
var id;
// determine the range of the objects
@ -21154,7 +21155,7 @@ Graph.prototype._updateValueRange = function(obj) {
* Redraw the graph with the current data
* chart will be resized too.
*/
Graph.prototype.redraw = function() {
Network.prototype.redraw = function() {
this.setSize(this.width, this.height);
this._redraw();
};
@ -21163,7 +21164,7 @@ Graph.prototype.redraw = function() {
* Redraw the graph with the current data
* @private
*/
Graph.prototype._redraw = function() {
Network.prototype._redraw = function() {
var ctx = this.frame.canvas.getContext('2d');
// clear the canvas
var w = this.frame.canvas.width;
@ -21202,7 +21203,7 @@ Graph.prototype._redraw = function() {
* @param {Number} offsetY Vertical offset
* @private
*/
Graph.prototype._setTranslation = function(offsetX, offsetY) {
Network.prototype._setTranslation = function(offsetX, offsetY) {
if (this.translation === undefined) {
this.translation = {
x: 0,
@ -21225,7 +21226,7 @@ Graph.prototype._setTranslation = function(offsetX, offsetY) {
* @return {Object} translation An object with parameters x and y, both a number
* @private
*/
Graph.prototype._getTranslation = function() {
Network.prototype._getTranslation = function() {
return {
x: this.translation.x,
y: this.translation.y
@ -21237,7 +21238,7 @@ Graph.prototype._getTranslation = function() {
* @param {Number} scale Scaling factor 1.0 is unscaled
* @private
*/
Graph.prototype._setScale = function(scale) {
Network.prototype._setScale = function(scale) {
this.scale = scale;
};
@ -21246,7 +21247,7 @@ Graph.prototype._setScale = function(scale) {
* @return {Number} scale Scaling factor 1.0 is unscaled
* @private
*/
Graph.prototype._getScale = function() {
Network.prototype._getScale = function() {
return this.scale;
};
@ -21257,7 +21258,7 @@ Graph.prototype._getScale = function() {
* @returns {number}
* @private
*/
Graph.prototype._XconvertDOMtoCanvas = function(x) {
Network.prototype._XconvertDOMtoCanvas = function(x) {
return (x - this.translation.x) / this.scale;
};
@ -21268,7 +21269,7 @@ Graph.prototype._XconvertDOMtoCanvas = function(x) {
* @returns {number}
* @private
*/
Graph.prototype._XconvertCanvasToDOM = function(x) {
Network.prototype._XconvertCanvasToDOM = function(x) {
return x * this.scale + this.translation.x;
};
@ -21279,7 +21280,7 @@ Graph.prototype._XconvertCanvasToDOM = function(x) {
* @returns {number}
* @private
*/
Graph.prototype._YconvertDOMtoCanvas = function(y) {
Network.prototype._YconvertDOMtoCanvas = function(y) {
return (y - this.translation.y) / this.scale;
};
@ -21290,7 +21291,7 @@ Graph.prototype._YconvertDOMtoCanvas = function(y) {
* @returns {number}
* @private
*/
Graph.prototype._YconvertCanvasToDOM = function(y) {
Network.prototype._YconvertCanvasToDOM = function(y) {
return y * this.scale + this.translation.y ;
};
@ -21301,7 +21302,7 @@ Graph.prototype._YconvertCanvasToDOM = function(y) {
* @returns {{x: number, y: number}}
* @constructor
*/
Graph.prototype.canvasToDOM = function(pos) {
Network.prototype.canvasToDOM = function(pos) {
return {x:this._XconvertCanvasToDOM(pos.x),y:this._YconvertCanvasToDOM(pos.y)};
}
@ -21311,7 +21312,7 @@ Graph.prototype.canvasToDOM = function(pos) {
* @returns {{x: number, y: number}}
* @constructor
*/
Graph.prototype.DOMtoCanvas = function(pos) {
Network.prototype.DOMtoCanvas = function(pos) {
return {x:this._XconvertDOMtoCanvas(pos.x),y:this._YconvertDOMtoCanvas(pos.y)};
}
@ -21322,7 +21323,7 @@ Graph.prototype.DOMtoCanvas = function(pos) {
* @param {Boolean} [alwaysShow]
* @private
*/
Graph.prototype._drawNodes = function(ctx,alwaysShow) {
Network.prototype._drawNodes = function(ctx,alwaysShow) {
if (alwaysShow === undefined) {
alwaysShow = false;
}
@ -21359,7 +21360,7 @@ Graph.prototype._drawNodes = function(ctx,alwaysShow) {
* @param {CanvasRenderingContext2D} ctx
* @private
*/
Graph.prototype._drawEdges = function(ctx) {
Network.prototype._drawEdges = function(ctx) {
var edges = this.edges;
for (var id in edges) {
if (edges.hasOwnProperty(id)) {
@ -21378,7 +21379,7 @@ Graph.prototype._drawEdges = function(ctx) {
* @param {CanvasRenderingContext2D} ctx
* @private
*/
Graph.prototype._drawControlNodes = function(ctx) {
Network.prototype._drawControlNodes = function(ctx) {
var edges = this.edges;
for (var id in edges) {
if (edges.hasOwnProperty(id)) {
@ -21391,7 +21392,7 @@ Graph.prototype._drawControlNodes = function(ctx) {
* Find a stable position for all nodes
* @private
*/
Graph.prototype._stabilize = function() {
Network.prototype._stabilize = function() {
if (this.constants.freezeForStabilization == true) {
this._freezeDefinedNodes();
}
@ -21415,7 +21416,7 @@ Graph.prototype._stabilize = function() {
*
* @private
*/
Graph.prototype._freezeDefinedNodes = function() {
Network.prototype._freezeDefinedNodes = function() {
var nodes = this.nodes;
for (var id in nodes) {
if (nodes.hasOwnProperty(id)) {
@ -21434,7 +21435,7 @@ Graph.prototype._freezeDefinedNodes = function() {
*
* @private
*/
Graph.prototype._restoreFrozenNodes = function() {
Network.prototype._restoreFrozenNodes = function() {
var nodes = this.nodes;
for (var id in nodes) {
if (nodes.hasOwnProperty(id)) {
@ -21453,7 +21454,7 @@ Graph.prototype._restoreFrozenNodes = function() {
* @return {boolean} true if moving, false if non of the nodes is moving
* @private
*/
Graph.prototype._isMoving = function(vmin) {
Network.prototype._isMoving = function(vmin) {
var nodes = this.nodes;
for (var id in nodes) {
if (nodes.hasOwnProperty(id) && nodes[id].isMoving(vmin)) {
@ -21470,7 +21471,7 @@ Graph.prototype._isMoving = function(vmin) {
*
* @private
*/
Graph.prototype._discreteStepNodes = function() {
Network.prototype._discreteStepNodes = function() {
var interval = this.physicsDiscreteStepsize;
var nodes = this.nodes;
var nodeId;
@ -21509,7 +21510,7 @@ Graph.prototype._discreteStepNodes = function() {
*
* @private
*/
Graph.prototype._physicsTick = function() {
Network.prototype._physicsTick = function() {
if (!this.freezeSimulation) {
if (this.moving) {
this._doInAllActiveSectors("_initializeForceCalculation");
@ -21529,7 +21530,7 @@ Graph.prototype._physicsTick = function() {
*
* @private
*/
Graph.prototype._animationStep = function() {
Network.prototype._animationStep = function() {
// reset the timer so a new scheduled animation step can be set
this.timer = undefined;
// handle the keyboad movement
@ -21543,13 +21544,11 @@ Graph.prototype._animationStep = function() {
var maxSteps = 1;
this._physicsTick();
var timeRequired = Date.now() - calculationTime;
while (timeRequired < (this.renderTimestep - this.renderTime) && maxSteps < this.maxPhysicsTicksPerRender) {
while (timeRequired < 0.9*(this.renderTimestep - this.renderTime) && maxSteps < this.maxPhysicsTicksPerRender) {
this._physicsTick();
timeRequired = Date.now() - calculationTime;
maxSteps++;
}
// start the rendering process
var renderTime = Date.now();
this._redraw();
@ -21564,7 +21563,7 @@ if (typeof window !== 'undefined') {
/**
* Schedule a animation step with the refreshrate interval.
*/
Graph.prototype.start = function() {
Network.prototype.start = function() {
if (this.moving || this.xIncrement != 0 || this.yIncrement != 0 || this.zoomIncrement != 0) {
if (!this.timer) {
var ua = navigator.userAgent.toLowerCase();
@ -21598,7 +21597,7 @@ Graph.prototype.start = function() {
*
* @private
*/
Graph.prototype._handleNavigation = function() {
Network.prototype._handleNavigation = function() {
if (this.xIncrement != 0 || this.yIncrement != 0) {
var translation = this._getTranslation();
this._setTranslation(translation.x+this.xIncrement, translation.y+this.yIncrement);
@ -21616,7 +21615,7 @@ Graph.prototype._handleNavigation = function() {
/**
* Freeze the _animationStep
*/
Graph.prototype.toggleFreeze = function() {
Network.prototype.toggleFreeze = function() {
if (this.freezeSimulation == false) {
this.freezeSimulation = true;
}
@ -21633,7 +21632,7 @@ Graph.prototype.toggleFreeze = function() {
* @param {boolean} [disableStart]
* @private
*/
Graph.prototype._configureSmoothCurves = function(disableStart) {
Network.prototype._configureSmoothCurves = function(disableStart) {
if (disableStart === undefined) {
disableStart = true;
}
@ -21665,7 +21664,7 @@ Graph.prototype._configureSmoothCurves = function(disableStart) {
*
* @private
*/
Graph.prototype._createBezierNodes = function() {
Network.prototype._createBezierNodes = function() {
if (this.constants.smoothCurves == true) {
for (var edgeId in this.edges) {
if (this.edges.hasOwnProperty(edgeId)) {
@ -21694,10 +21693,10 @@ Graph.prototype._createBezierNodes = function() {
*
* @private
*/
Graph.prototype._initializeMixinLoaders = function () {
Network.prototype._initializeMixinLoaders = function () {
for (var mixinFunction in graphMixinLoaders) {
if (graphMixinLoaders.hasOwnProperty(mixinFunction)) {
Graph.prototype[mixinFunction] = graphMixinLoaders[mixinFunction];
Network.prototype[mixinFunction] = graphMixinLoaders[mixinFunction];
}
}
};
@ -21705,7 +21704,7 @@ Graph.prototype._initializeMixinLoaders = function () {
/**
* Load the XY positions of the nodes into the dataset.
*/
Graph.prototype.storePosition = function() {
Network.prototype.storePosition = function() {
var dataArray = [];
for (var nodeId in this.nodes) {
if (this.nodes.hasOwnProperty(nodeId)) {
@ -21727,7 +21726,7 @@ Graph.prototype.storePosition = function() {
* @param {Number} nodeId
* @param {Number} [zoomLevel]
*/
Graph.prototype.focusOnNode = function (nodeId, zoomLevel) {
Network.prototype.focusOnNode = function (nodeId, zoomLevel) {
if (this.nodes.hasOwnProperty(nodeId)) {
if (zoomLevel === undefined) {
zoomLevel = this._getScale();
@ -24318,7 +24317,7 @@ Point2d = function (x, y) {
*
* @param {DataSet} data The google data table
* @param {Number} column The index of the column to be filtered
* @param {Graph} graph The graph
* @param {Network} graph The graph
*/
function Filter (data, column, graph) {
this.data = data;
@ -25107,7 +25106,7 @@ var vis = {
},
Timeline: Timeline,
Graph: Graph,
Network: Network,
Graph3d: Graph3d,
Graph2d: Graph2d
};

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


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


+ 2
- 2
docs/index.html View File

@ -53,8 +53,8 @@
A filtered and/or formatted view on a DataSet.
</li>
<li>
<a href="graph.html"><b>Graph</b></a>.
Display a graph or network with nodes and edges.
<a href="network.html"><b>Network</b></a>.
Display a network (force directed graph) with nodes and edges (previously called Graph).
</li>
<li>
<a href="graph2d.html"><b>Graph2d</b></a>.

docs/graph.html → docs/network.html View File

@ -2,7 +2,7 @@
<html>
<head>
<title>vis.js | graph documentation</title>
<title>vis.js | network documentation</title>
<link href="css/prettify.css" type="text/css" rel="stylesheet" />
<link href='css/style.css' type='text/css' rel='stylesheet'>
@ -17,21 +17,21 @@
<h2 id="Overview">Overview</h2>
<p>
Graph is a visualization to display graphs and networks consisting of nodes
Graph is a visualization to display networks and networks consisting of nodes
and edges. The visualization is easy to use and supports custom shapes,
styles, colors, sizes, images, and more.
</p>
<p>
The graph visualization works smooth on any modern browser for up to a
The network visualization works smooth on any modern browser for up to a
few thousand nodes and edges. To handle a larger amount of nodes, Graph
has <a href="#Clustering">clustering</a> support.
</p>
<p>
Every dataset is different. Nodes can have different sizes based on content, interconnectivity can be high or low etc. Because of this, graph has a special option
Every dataset is different. Nodes can have different sizes based on content, interconnectivity can be high or low etc. Because of this, network has a special option
that the user can use to explore which settings may be good for you. Use configurePhysics as described in the <u><a href="#PhysicsConfiguration">Physics</a></u> section or by
<u><a href="../examples/graph/25_physics_configuration.html">example 25</a></u>.
<u><a href="../examples/Network/25_physics_configuration.html">example 25</a></u>.
</p>
<p>
@ -77,7 +77,7 @@
<h2 id="Example">Example</h2>
<p>
Here a basic graph example. Note that unlike the
Here a basic network example. Note that unlike the
<a href="timeline.html">Timeline</a>, the Graph does not need the vis.css
file.
</p>
@ -97,7 +97,7 @@
&lt;body&gt;
&lt;div id="mygraph"&gt;&lt;/div&gt;
&lt;div id="mynetwork"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
// create an array with nodes
@ -117,8 +117,8 @@
{from: 2, to: 5}
];
// create a graph
var container = document.getElementById('mygraph');
// create a network
var container = document.getElementById('mynetwork');
var data= {
nodes: nodes,
edges: edges,
@ -127,7 +127,7 @@
width: '400px',
height: '400px'
};
var graph = new vis.Graph(container, data, options);
var network = new vis.Graph(container, data, options);
&lt;/script&gt;
&lt;/body&gt;
@ -147,12 +147,12 @@
The constructor of the Graph is <code>vis.Graph</code>.
<pre class="prettyprint lang-js">var graph = new vis.Graph(container, data, options);</pre>
<pre class="prettyprint lang-js">var network = new vis.Graph(container, data, options);</pre>
The constructor accepts three parameters:
<ul>
<li>
<code>container</code> is the DOM element in which to create the graph.
<code>container</code> is the DOM element in which to create the network.
</li>
<li>
<code>data</code> is an Object containing properties <code>nodes</code> and
@ -207,7 +207,7 @@ var data = {
<li>
<span style="font-weight: bold;">A property <code>options</code></span>,
containing an object with global options.
Options can be provided as third parameter in the graph constructor
Options can be provided as third parameter in the network constructor
as well. Section <a href="#Configuration_Options">Configuration Options</a>
describes the available options.
@ -246,7 +246,7 @@ nodes.add([
// ... more nodes
]);
</pre>
When using a DataSet, the graph is automatically updating to changes in the DataSet.
When using a DataSet, the network is automatically updating to changes in the DataSet.
<p>
Nodes support the following properties:
@ -514,7 +514,7 @@ edges.add([
// ... more edges
]);
</pre>
When using a DataSet, the graph is automatically updating to changes in the DataSet.
When using a DataSet, the network is automatically updating to changes in the DataSet.
<p>
Edges support the following properties:
@ -727,11 +727,11 @@ When using a DataSet, the graph is automatically updating to changes in the Data
<pre class="prettyprint lang-js">
// provide data in the DOT language
var data = {
dot: 'digraph {1 -> 1 -> 2; 2 -> 3; 2 -- 4; 2 -> 1 }'
dot: 'dinetwork {1 -> 1 -> 2; 2 -> 3; 2 -- 4; 2 -> 1 }'
};
// create a graph
var graph = new vis.Graph(container, data);
// create a network
var network = new vis.Graph(container, data);
</pre>
@ -739,7 +739,7 @@ var graph = new vis.Graph(container, data);
<h2 id="Configuration_options">Configuration options</h2>
<p>
Options can be used to customize the graph. Options are defined as a JSON object.
Options can be used to customize the network. Options are defined as a JSON object.
All options are optional.
</p>
@ -780,7 +780,7 @@ var options = {
<td>Boolean</td>
<td>false</td>
<td>
Enabling this setting will create a physics configuration div above the graph. You can use this to fine tune the physics system to suit your needs.
Enabling this setting will create a physics configuration div above the network. You can use this to fine tune the physics system to suit your needs.
Because of the many possible configurations, there is not a one-size-fits-all setting. By using this tool, you can adapt the physics to your dataset.
</td>
</tr>
@ -818,7 +818,7 @@ var options = {
<td>false</td>
<td>
With the advent of the storePosition() function, the positions of the nodes can be saved after they are stabilized. The smoothCurves require support nodes and those positions are not stored. In order
to speed up the initialization of the graph by using storePosition() and loading the nodes with the stored positions, the freezeForStabilization option freezes all nodes that have been supplied with
to speed up the initialization of the network by using storePosition() and loading the nodes with the stored positions, the freezeForStabilization option freezes all nodes that have been supplied with
an x and y position in place during the stabilization. That way only the support nodes for the smooth curves have to stabilize, greatly speeding up the stabilization process with cached positions.
</td>
</tr>
@ -838,7 +838,7 @@ var options = {
<td>height</td>
<td>String</td>
<td>"400px"</td>
<td>The height of the graph in pixels or as a percentage.</td>
<td>The height of the network in pixels or as a percentage.</td>
</tr>
<tr>
@ -861,7 +861,7 @@ var options = {
<td>Boolean</td>
<td>true</td>
<td>
Toggle if the graph can be dragged. This will not affect the dragging of nodes.
Toggle if the network can be dragged. This will not affect the dragging of nodes.
</td>
</tr>
<tr>
@ -869,7 +869,7 @@ var options = {
<td>Boolean</td>
<td>true</td>
<td>
Toggle if the nodes can be dragged. This will not affect the dragging of the graph.
Toggle if the nodes can be dragged. This will not affect the dragging of the network.
</td>
</tr>
@ -902,7 +902,7 @@ var options = {
<td>selectable</td>
<td>Boolean</td>
<td>true</td>
<td>If true, nodes in the graph can be selected by clicking them.
<td>If true, nodes in the network can be selected by clicking them.
Long press can be used to select multiple nodes.</td>
</tr>
@ -910,7 +910,7 @@ var options = {
<td>stabilize</td>
<td>Boolean</td>
<td>true</td>
<td>If true, the graph is stabilized before displaying it. If false,
<td>If true, the network is stabilized before displaying it. If false,
the nodes move to a stabe position visibly in an animated way.</td>
</tr>
@ -919,21 +919,21 @@ var options = {
<td>Number</td>
<td>1000</td>