Class links.Graph3d
Defined in: graph3d.js.
Constructor Attributes | Constructor Name and Description |
---|---|
links.Graph3d(container)
|
Method Attributes | Method Name and Description |
---|---|
Start animation
|
|
Stop animation
|
|
create()
Create the main frame for the Graph3d.
|
|
draw(data, options)
Main drawing logic.
|
|
Retrieve the current camera rotation
|
|
onmousemove(event)
|
|
onmouseup(event)
|
|
ontouchend(event)
|
|
ontouchmove(event)
|
|
<static> |
links.Graph3d.px(x)
Append suffix "px" to provided value x
|
redraw(data)
Redraw the Graph.
|
|
setCameraPosition(pos)
Set the rotation and distance of the camera
|
|
setSize(width, height)
Set a new size for the graph
|
Class Detail
links.Graph3d(container)
- Parameters:
- {Element} container
- The DOM element in which the Graph will be created. Normally a div element.
Method Detail
animationStart()
Start animation
animationStop()
Stop animation
create()
Create the main frame for the Graph3d.
This function is executed once when a Graph3d object is created. The frame
contains a canvas, and this canvas contains all objects like the axis and
nodes.
draw(data, options)
Main drawing logic. This is the function that needs to be called
in the html page, to draw the Graph.
A data table with the events must be provided, and an options table.
- Parameters:
- {google.visualization.DataTable} data
- The data containing the events for the Graph.
- {Object} options
- A name/value map containing settings for the Graph.
{object}
getCameraPosition()
Retrieve the current camera rotation
- Returns:
- {object} An object with parameters horizontal, vertical, and distance
onmousemove(event)
- Parameters:
- event
onmouseup(event)
- Parameters:
- event
ontouchend(event)
- Parameters:
- event
ontouchmove(event)
- Parameters:
- event
<static>
{string}
links.Graph3d.px(x)
Append suffix "px" to provided value x
- Parameters:
- {int} x
- An integer value
- Returns:
- {string} the string value of x, followed by the suffix "px"
redraw(data)
Redraw the Graph. This needs to be executed after the start and/or
end time are changed, or when data is added or removed dynamically.
- Parameters:
- {google.visualization.DataTable} data
- Optional, new data table
setCameraPosition(pos)
Set the rotation and distance of the camera
- Parameters:
- {Object} pos
- An object with the camera position. The object contains three parameters: - horizontal {number} The horizontal rotation, between 0 and 2*PI. Optional, can be left undefined. - vertical {number} The vertical rotation, between 0 and 0.5*PI if vertical=0.5*PI, the graph is shown from the top. Optional, can be left undefined. - distance {number} The (normalized) distance of the camera to the center of the graph, a value between 0.71 and 5.0. Optional, can be left undefined.
setSize(width, height)
Set a new size for the graph
- Parameters:
- {string} width
- Width in pixels or percentage (for example "800px" or "50%")
- {string} height
- Height in pixels or percentage (for example "400px" or "30%")