Class links.Network
Defined in: network.js.
Constructor Attributes | Constructor Name and Description |
---|---|
links.Network(container)
|
Method Attributes | Method Name and Description |
---|---|
<static> |
links.Network.addEventListener(element, action, listener, useCapture)
Add and event listener.
|
addLinks(linksTable)
Load links by reading the data table
Note that Object DataTable is defined in google.visualization.DataTable
|
|
addNodes(nodesTable)
Append nodes
Nodes with a duplicate id will be replaced
|
|
addPackages(packagesTable)
Append packages
Packages with a duplicate id will be replaced
Note that Object DataTable is defined in google.visualization.DataTable
|
|
Start animation.
|
|
Start animation.
|
|
draw(nodes, links, packages, options)
Main drawing logic.
|
|
retrieve the currently selected nodes
|
|
<static> |
links.Network.isArray(obj)
Check if given object is a Javascript Array
|
isMoving(vmin)
Check if any of the nodes is still moving
|
|
onmousemove(event)
|
|
onmouseup(event)
|
|
ontouchend(event)
|
|
ontouchmove(event)
|
|
<static> |
links.Network.Popup(container, x, y, text)
Popup is a class to create a popup window with some text
|
<static> |
links.Network.preventDefault(event)
Cancels the event if it is cancelable, without stopping further propagation of the event.
|
redraw()
Redraw the network with the current data
chart will be resized too.
|
|
<static> |
links.Network.removeEventListener(element, action, listener, useCapture)
Remove an event listener from an element
|
setAnimationAcceleration(acceleration)
Set the time acceleration for playing the history.
|
|
setAnimationDuration(duration)
Set the duration of playing the whole package history
Only applicable when packages with a timestamp are available
|
|
setAnimationFramerate(framerate)
Set framerate for the animation.
|
|
setLinks(linksTable)
Load links by reading the data table
Note that Object DataTable is defined in google.visualization.DataTable
|
|
setNodes(nodesTable)
Load all nodes by reading the data table nodesTable
Note that Object DataTable is defined in google.visualization.DataTable
|
|
setPackages(packagesTable)
Set a new packages table
Packages with a duplicate id will be replaced
Note that Object DataTable is defined in google.visualization.DataTable
|
|
setSelection(selection)
select zero or more nodes
|
|
setTimestamp(timestamp)
Set the current timestamp.
|
|
start()
Start animating nodes, links, and packages.
|
|
stop()
Stop animating nodes, links, and packages.
|
|
<static> |
links.Network.stopPropagation(event)
Stop event propagation
|
<static> |
links.Network.tableToArray(table)
Convert a Google DataTable to a Javascript Array
|
trigger(event, params)
fire an event
|
Class Detail
links.Network(container)
- Parameters:
- {Element} container
- The DOM element in which the Network will be created. Normally a div element.
Method Detail
<static>
links.Network.addEventListener(element, action, listener, useCapture)
Add and event listener. Works for all browsers
- Parameters:
- {Element} element
- An html element
- {String} action
- The action, for example "click", without the prefix "on"
- {function} listener
- The callback function to be executed
- {boolean} useCapture
addLinks(linksTable)
Load links by reading the data table
Note that Object DataTable is defined in google.visualization.DataTable
- Parameters:
- {google.visualization.DataTable | Array} linksTable
- The data containing the links.
addNodes(nodesTable)
Append nodes
Nodes with a duplicate id will be replaced
- Parameters:
- {google.visualization.DataTable | Array} nodesTable
- The data containing the nodes.
addPackages(packagesTable)
Append packages
Packages with a duplicate id will be replaced
Note that Object DataTable is defined in google.visualization.DataTable
- Parameters:
- {google.visualization.DataTable | Array} packagesTable
- The data containing the packages.
animationStart()
Start animation.
Only applicable when packages with a timestamp are available
animationStop()
Start animation.
Only applicable when packages with a timestamp are available
draw(nodes, links, packages, options)
Main drawing logic. This is the function that needs to be called
in the html page, to draw the Network.
Note that Object DataTable is defined in google.visualization.DataTable
A data table with the events must be provided, and an options table.
- Parameters:
- {google.visualization.DataTable | Array} nodes Optional
- The data containing the nodes.
- {google.visualization.DataTable | Array} links Optional
- The data containing the links.
- {google.visualization.DataTable | Array} packages Optional
- The data containing the packages
- {Object} options
- A name/value map containing settings
{Object[]}
getSelection()
retrieve the currently selected nodes
- Returns:
- {Object[]} an array with zero or more objects. Each object contains the parameter row
<static>
{Boolean}
links.Network.isArray(obj)
Check if given object is a Javascript Array
- Parameters:
- {*} obj
- Returns:
- {Boolean} isArray true if the given object is an array
{boolean}
isMoving(vmin)
Check if any of the nodes is still moving
- Parameters:
- {number} vmin
- the minimum velocity considered as "moving"
- Returns:
- {boolean} true if moving, false if non of the nodes is moving
onmousemove(event)
- Parameters:
- event
onmouseup(event)
- Parameters:
- event
ontouchend(event)
- Parameters:
- event
ontouchmove(event)
- Parameters:
- event
<static>
links.Network.Popup(container, x, y, text)
Popup is a class to create a popup window with some text
- Parameters:
- {Element} container
- The container object.
- {Number} x
- {Number} y
- {String} text
<static>
links.Network.preventDefault(event)
Cancels the event if it is cancelable, without stopping further propagation of the event.
- Parameters:
- event
redraw()
Redraw the network with the current data
chart will be resized too.
<static>
links.Network.removeEventListener(element, action, listener, useCapture)
Remove an event listener from an element
- Parameters:
- {Element} element
- An html dom element
- {string} action
- The name of the event, for example "mousedown"
- {function} listener
- The listener function
- {boolean} useCapture
setAnimationAcceleration(acceleration)
Set the time acceleration for playing the history.
Only applicable when packages with a timestamp are available
- Parameters:
- {number} acceleration
- Acceleration, for example 10 means play ten times as fast as real time. A value of 1 will play the history in real time.
setAnimationDuration(duration)
Set the duration of playing the whole package history
Only applicable when packages with a timestamp are available
- Parameters:
- {number} duration
- The duration in seconds
setAnimationFramerate(framerate)
Set framerate for the animation.
Only applicable when packages with a timestamp are available
- Parameters:
- {number} framerate
- The framerate in frames per second
setLinks(linksTable)
Load links by reading the data table
Note that Object DataTable is defined in google.visualization.DataTable
- Parameters:
- {google.visualization.DataTable | Array} linksTable
- The data containing the links.
setNodes(nodesTable)
Load all nodes by reading the data table nodesTable
Note that Object DataTable is defined in google.visualization.DataTable
- Parameters:
- {google.visualization.DataTable | Array} nodesTable
- The data containing the nodes.
setPackages(packagesTable)
Set a new packages table
Packages with a duplicate id will be replaced
Note that Object DataTable is defined in google.visualization.DataTable
- Parameters:
- {google.visualization.DataTable | Array} packagesTable
- The data containing the packages.
setSelection(selection)
select zero or more nodes
- Parameters:
- {object[]} selection
- an array with zero or more objects. Each object contains the parameter row
setTimestamp(timestamp)
Set the current timestamp. All packages with a timestamp smaller or equal
than the given timestamp will be drawn.
- Parameters:
- {Date | Number} timestamp
start()
Start animating nodes, links, and packages.
stop()
Stop animating nodes, links, and packages.
<static>
links.Network.stopPropagation(event)
Stop event propagation
- Parameters:
- event
<static>
{Array}
links.Network.tableToArray(table)
Convert a Google DataTable to a Javascript Array
- Parameters:
- {google.visualization.DataTable} table
- Returns:
- {Array} array
trigger(event, params)
fire an event
- Parameters:
- {String} event
- The name of an event, for example "select" or "ready"
- {Object} params
- Optional object with event parameters