|
|||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
an area for displaying and interacting with a graph. There are some read-only fields which provide information on the current state of the canvas.
Some of them can be set in HTML markup or during programmatic widget creation, namely path,
nodeEvents, nodeLabelEvents, edgeEvents,
edgeLabelEvents and baseURL. Lateron, only the setters like setPath()
should be used. Changing the reported events can be done by using setEventTypes() on
the HitTest instance returned by getHitTest().
| Field Summary | |
|---|---|
String |
baseURL
(read-only) base path for server requests |
Boolean |
edgeEvents
(read-only) report edge events |
Boolean |
edgeLabelEvents
(read-only) report edge label events |
Number |
height
(read-only) the height of the canvas DOM node in pixels |
Number |
highlightNodeSurroundPixels
(read-write) the surrounding pixels for a highlighted node (default 10) |
Number |
mouseWheelScrollFactor
(read-write) determines the zoom change amount, if the mouse is wheeled (default 1.2) |
Boolean |
nodeEvents
(read-only) report node events |
Boolean |
nodeLabelEvents
(read-only) report node label events |
Boolean |
paperEvents
(read-only) report paper events |
String |
path
(read-only) the symbolic name of the graph displayed by the canvas |
Number |
tileSize
(read-only) the width and height of the image tiles showing the graph |
Number |
x
(read-only) x-coordinate of the upper right corner of the visible area (world coordinates) |
Number |
y
(read-only) y-coordinate of the upper right corner of the visible area (world coordinates) |
Number |
zoom
(read-only) the current zoom factor |
| Method Summary | |
|---|---|
|
beforeRequest()
hook for listeners called before a server request |
|
center(/*Number*/ cX, /*Number*/ cY)
moves the visible area such that the view coordinates (cX, cY) become the new coordinates of the center of the visible area. |
|
clear()
clears the display |
|
fitContent()
adjusts the vieport and the zoom level such that the entire graph is displayed in the entire area |
|
fix()
disables panning temporarily. This is only useful in "pan" mode. |
Graph |
getGraph()
returns the current graph. |
HitTest |
getHitTest()
returns the hit test instance used by this graph canvas. |
Object |
getLastHitInfo()
returns the last hit info object. |
Object |
getMousePosition()
returns the coordinates of the last mouse position over the canvas as an object with "x" and "y" fields. |
Object |
getViewCoordinates(/*Number?*/ rawX, /*Number?*/ rawY)
returns the coordinates of the last mouse position over the canvas as an object with "x" and "y" fields in view coordinates (pixels). |
Object |
getWorldCoordinates(/*Number?*/ x, /*Number?*/ y)
returns the coordinates of the last mouse position over the canvas as an object with "x" and "y" fields in world coordinates. |
|
highlight(/*String*/ id)
highlights the graph element with the given id. |
Boolean |
isMouseOver()
returns true, if the mouse is over the canvas. |
|
onClickEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
is called for a click event concerning an edge. |
|
onClickEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a click event concerning an edge label. |
|
onClickNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
is called, if the user clicks a node. |
|
onClickNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a click event concerning a node label. |
|
onClickPaper(/*Object*/ info, /*Object*/ evt)
is called for a click event which does not hit any graph element. |
|
onDblClickEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
is called for a double click event concerning an edge. |
|
onDblClickEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a double click event concerning an edge label. |
|
onDblClickNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
is called, if the user double clicks a node. |
|
onDblClickNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a double click event concerning a node label. |
|
onMouseOutEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
is called for a mouse out event concerning an edge. |
|
onMouseOutEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a mouse out event concerning an edge label. |
|
onMouseOutNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
is called for a mouse out event concerning a node. |
|
onMouseOutNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a mouse out event concerning a node label. |
|
onMouseOverEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
is called for a mouse over event concerning an edge. |
|
onMouseOverEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a mouse over event concerning an edge label. |
|
onMouseOverNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
is called for a mouse over event concerning a node. |
|
onMouseOverNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
is called for a mouse over event concerning a node label. |
|
pathSet(/*String*/ path)
hook for listeners called after setting a path |
|
pushTiles()
moves the currently visible tiles to the second layer. |
|
recalculateTiles(/*Boolean?*/ replaceTiles)
calculates the tiles for the visible area and loads missing tiles from the server. |
|
refresh(/*Object?*/ bounds, /*Object?*/ shift, /*Boolean?*/ doNotPushTiles)
refreshes the display, useful after changes of the graph |
|
release()
enables panning again (after a call to fix()). |
|
requestDone(/*Boolean*/ success)
hook for listeners called after a server request |
|
setBaseURL(/*String*/ baseURL)
sets the base path for server requests (possibly relative to the current page) |
|
setNoInteractionMode()
sets the interaction mode to no interaction. |
|
setPanMode(/*Boolean*/ replaceTiles)
sets the interaction moode to the "normal" pan mode, where the user can pan the graph. |
|
setPath(/*String*/ newPath, /*Boolean?*/ reload)
initializes the canvas for a graph given by a symbolic name, if it is set to a non-empty string. |
|
setViewPoint(/*Number*/ newX, /*Number*/ newY, /*Boolean?*/ fixOldTiles)
moves the visible area, such that the view coordinates (newX, newY) become the coordinates of the upper right corner. |
|
setZoom(/*Number*/ zoom)
sets the zoom factor to the specified value. |
|
shift(/*Number*/ dx, /*Number*/ dy, /*Boolean?*/ fixOldTiles)
shifts the visible area by (dx, dy). |
|
tileLoaded(/*String*/ tileId)
hook for listeners called after loading a tile |
|
unhighlight(/*String*/ id)
unhighlights the graph elements with the given id. |
|
unhighlightAll()
unhighlights all graph elements. |
|
updateWorldBounds(/*Object*/ newWorldBounds)
sets new world bounds for this graph canvas. |
|
viewPortChanged(/*Number*/ x, /*Number*/ y, /*Number*/ width, /*Number*/ height, /*Number*/ zoom)
hook for listeners called after a viewport change |
| Field Detail |
|---|
/*String*/ baseURL
/*Boolean*/ edgeEvents
/*Boolean*/ edgeLabelEvents
/*Number*/ height
/*Number*/ highlightNodeSurroundPixels
/*Number*/ mouseWheelScrollFactor
/*Boolean*/ nodeEvents
/*Boolean*/ nodeLabelEvents
/*Boolean*/ paperEvents
/*String*/ path
/*Number*/ tileSize
/*Number*/ x
/*Number*/ y
/*Number*/ zoom
| Method Detail |
|---|
beforeRequest()
center(/*Number*/ cX, /*Number*/ cY)
clear()
fitContent()
fix()
Graph getGraph()
HitTest getHitTest()
Object getLastHitInfo()
Object getMousePosition()
Object getViewCoordinates(/*Number?*/ rawX, /*Number?*/ rawY)
Object getWorldCoordinates(/*Number?*/ x, /*Number?*/ y)
highlight(/*String*/ id)
id - id of a node or edge
Boolean isMouseOver()
onClickEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
edgeId - the id of the edge
info - the hit info
evt - the click event
onClickEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
edgeLabelId - the id of the edge label
info - the hit info
evt - the click event
onClickNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
nodeId - the id of the clicked node
info - the hit info
evt - the click event
onClickNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
nodeLabelId - the id of the node label
info - the hit info
evt - the click event
onClickPaper(/*Object*/ info, /*Object*/ evt)
info - the hit info
evt - the click event
onDblClickEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
edgeId - the id of the edge
info - the hit info
evt - the double click event
onDblClickEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
edgeLabelId - the id of the edge label
info - the hit info
evt - the double click event
onDblClickNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
nodeId - the id of the double clicked node
info - the hit info
evt - the double click event
onDblClickNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
nodeLabelId - the id of the node label
info - the hit info
evt - the double click event
onMouseOutEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
edgeId - the id of the edge
info - the hit info
evt - the mouse out event
onMouseOutEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
edgeLabelId - the id of the edge label
info - the hit info
evt - the mouse out event
onMouseOutNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
nodeId - the id of the node
info - the hit info
evt - the mouse out event
onMouseOutNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
nodeLabelId - the id of the node label
info - the hit info
evt - the mouse out event
onMouseOverEdge(/*String*/ edgeId, /*Object*/ info, /*Object*/ evt)
edgeId - the id of the edge
info - the hit info
evt - the mouse over event
onMouseOverEdgeLabel(/*String*/ edgeLabelId, /*Object*/ info, /*Object*/ evt)
edgeLabelId - the id of the edge label
info - the hit info
evt - the mouse over event
onMouseOverNode(/*String*/ nodeId, /*Object*/ info, /*Object*/ evt)
nodeId - the id of the node
info - the hit info
evt - the mouse over event
onMouseOverNodeLabel(/*String*/ nodeLabelId, /*Object*/ info, /*Object*/ evt)
nodeLabelId - the id of the node label
info - the hit info
evt - the mouse over event
pathSet(/*String*/ path)
path - the symbolic graph name
pushTiles()
recalculateTiles(/*Boolean?*/ replaceTiles)
replaceTiles - If true, existing tiles are replaced with newly loaded tiles.
refresh(/*Object?*/ bounds, /*Object?*/ shift, /*Boolean?*/ doNotPushTiles)
bounds - optional new world bounds as an object with x, y, width and height attributes
shift - an optional shift for the new tiles, the tiles on the second layer are fixed
doNotPushTiles - the current tiles are pushed to the second layer in a first step, unless this is true
release()
requestDone(/*Boolean*/ success)
success - whether the request succeeded
setBaseURL(/*String*/ baseURL)
setNoInteractionMode()
setPanMode(/*Boolean*/ replaceTiles)
setPath(/*String*/ newPath, /*Boolean?*/ reload)
newPath - symbolic name of the graph
reload - if true, the graph is reloaded even if it is already cached for the session (default false)
setViewPoint(/*Number*/ newX, /*Number*/ newY, /*Boolean?*/ fixOldTiles)
setZoom(/*Number*/ zoom)
shift(/*Number*/ dx, /*Number*/ dy, /*Boolean?*/ fixOldTiles)
tileLoaded(/*String*/ tileId)
unhighlight(/*String*/ id)
id - id of a node or edge
unhighlightAll()
updateWorldBounds(/*Object*/ newWorldBounds)
viewPortChanged(/*Number*/ x, /*Number*/ y, /*Number*/ width, /*Number*/ height, /*Number*/ zoom)
x - view coordinate of the left boundary of the visible area
y - view coordinate of the upper boundary of the visible area
width - width of the visible area in pixels
height - height of the visible area in pixels
zoom - zoom factor, view units divided by world units