@ -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 = 1 e9 , maxY = - 1 e9 , minX = 1 e9 , maxX = - 1 e9 , 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
} ;