|
|||||
| SUMMARY: FIELD | CONSTR | METHOD| EVENT | DETAIL: FIELD | CONSTR | METHOD| EVENT | ||||
An area for displaying and interacting with a graph.
The graph canvas provides basic navigation (zooming and panning) for mouse and touch input out-of-the-box.
If navigation should be prevented, call setNoInteractionMode().
There are two different 'modes' of graph visualization: 'Bitmap Mode' and 'SVG Mode'. The mode can be set
using method setRenderMode().
| Field Summary | |
|---|---|
String |
RENDER_MODE_BITMAP
|
String |
RENDER_MODE_SVG
|
String |
baseURL
[readonly] Base path for server requests |
boolean |
dispatchGraphItemEvents
Determines whether mouse and touch events on graph items should be detected and dispatched. The default value is true. |
Object |
domNode
|
Object |
doubleTapSize
The area in view coordinates the touch pointer needs to stay in before multiple taps are considered multiple single taps instead of multi-taps. If the touch pointer stays within this size within doubleTapTime,
multiple taps will be considered double or multi-taps.
The default value is {width: 20, height: 20}. |
int |
doubleTapTime
The amount of time that may pass within which two subsequent touch taps are considered multi taps. The higher the value the easier it will be to double-tap. The default value is 500 milliseconds. |
Boolean |
edgeEvents
[readonly] Whether edge events should be reported. |
Boolean |
edgeLabelEvents
[readonly] Whether edge events should be reported. |
boolean |
fixed
Indicates whether this canvas is currently fixed. It is up to clients to consider this property in order to determine whether they want to move the canvas viewport. The default value is false. |
HTMLDivElement |
glassPane
A transparent div above the graph visualization, but below any elements that are added as children of the canvas. This div will usually be the target of any mouse and touch events occuring on and dispatched by the canvas. |
Number |
height
The height of the canvas DOM node in pixels |
Number |
highlightNodeSurroundPixels
The surrounding pixels for a highlighted node (default 10) |
int |
longPressTime
This value indicates the amount of time that may pass before a touch down is considered a long press when the pointer stays within its touchDragSize area.
The higher the value the later a touch pointer movement will be recognized as a long press.
The default value is 1000 milliseconds. |
string |
mainTouchId
An identifier of a currently active touch that is considered the "main touch". If multiple touches are currently active (i.e., during a pinch gesture), the "main touch" is the touch that was first started. |
Number |
maxZoomForFitContent
Determines the maximum for the zoom on fitContent (default 1000000) |
Number |
minPinchDelta
The minimum amount of pixels at least one pinch touch has to move in one direction in order to trigger a pinch event. The default value is 1. |
Number |
mouseWheelScrollFactor
Determines the zoom change amount, if the mouse is wheeled (default 2.0) |
boolean |
mouseWheelZoom
Determines whether the mouse wheel can be used to zoom in and out in the canvas. The default value is true. |
HTMLDivElement |
movables
[readonly] Container HTML element for all elements that will be moved simultaneously with the canvas viewpoint. |
NavigationInputMode |
navigationMode
[readonly] The navigation mode that enables panning and pinch-zoom functionality for this canvas. The navigation mode is created by createNavigationMode().
If this canvas is in "no interaction mode" (setNotInteractionMode()), the value of this
property is null. |
Boolean |
nodeEvents
[readonly] Whether node events should be reported. |
Boolean |
nodeLabelEvents
[readonly] Whether nodelabel events should be reported. |
HTMLElement |
oldTiles
The element containing old tiles (if the canvas is in Bitmap Mode). |
HTMLElement |
overlays
The element containing the overlays, i.e. for selection. |
Number |
paintDetailThreshold
The lower bound of detailed painting. If the zoom level is below this number, the rendering will be in sloppy mode. The default value is 0.3. |
Boolean |
paperEvents
[readonly] Whether paper events should be reported. Paper events are mouse and touch events that did not hit any graph elements. |
String |
path
[readonly] The symbolic name of the graph displayed by the canvas |
Boolean |
showLoading
Whether the canvas shows a loading image when new image tiles are loaded. The loading image will only be shown if no graph image tiles are currently visible. The loading image can be configured using the .loading css class. This property is only relevant in Bitmap Mode. |
int |
svgBorder
Space that should be added between the actual graph bounds and the border of the generated SVG (in SVG Mode). This property does not influence the graph's bounding box on the client - i.e., it will not change the resulting graph placement when calling fitContent(). Instead, the property can be used when node visualizations extend
beyond the graph bounds calculated on the server (as might be the case for drop shadow effects).
The default value is 0. |
HTMLElement |
svgLayer
The element containing the SVGViewPort widget (if in SVG Mode). |
String |
svgPrefix
The prefix added to the generated SVG. Use this value if multiple GraphCanvas objects in SVG Mode are used on the
same page. Each canvas in SVG Mode has to use a unique prefix. |
String |
templatePath
The path to the dojo template used when creating this component. |
Number |
tileSize
The width and height of the image tiles showing the graph. This property is only relevant in Bitmap Mode. |
HTMLElement |
tilesFrame
[readonly] The element containing the current and old tiles (in Bitmap Mode). |
Object |
touchDragSize
the area in view coordinates the touch may stay in before a movement is considered a drag. The default value is {width: 5, height: 5}. |
Boolean |
useTouchEventsExclusively
Whether to use only touch events (if available). The default is true. If the value of this property is true, evt.preventDefault() is called
on each touch event, thereby preventing the additional mouse event. |
ViewportLimiter |
viewportLimiter
The viewport limiter instance that can be used to limit the explorable region. By default there are no limits set on the explorable region. |
Number |
width
The width of the canvas DOM node in pixels |
Number |
x
x-coordinate of the upper left corner of the graph visualization, relative to the top left corner of this canvas |
Number |
y
y-coordinate of the upper left corner of the graph visualization, relative to the top left corner of this canvas |
Number |
zoom
[readonly] The current zoom factor |
Number |
zoomMarginFactor
The factor that is used to add a margin when fitting the graph into the view. The default value is 0.95. |
| Method Summary | |
|---|---|
TouchPointHandler |
_createTouchPointHandler(/*String*/ identifier)
Called by _getOrCreateTouchPointHandler to create a new yfiles.client.support.TouchPointHandler instance
to handle the touch event that corresponds to the provided identifier. |
TouchPointHandler |
_getOrCreateTouchPointHandler(/*Number*/ identifier, /*Object*/ currentTouchPoint)
Gets or creates a yfiles.client.support.TouchPointHandler for a touch event identified by the provided identifier. |
|
_mouseWheeled(/*Event*/ evt)
Callback invoked when the mouse wheel is used over the canvas. |
Boolean |
_supportMultiTouch()
determines whether simultaneous touch events should be processed, e.g. in order to detect pinch gestures |
|
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.
To center world coordinates, use setCenter(). |
|
clear(/*Boolean*/ newGraph)
Clears the display. |
NavigationInputMode |
createNavigationMode()
Creates a NavigationInputMode that enables panning and zooming support for
mouse and touch input. |
|
decreaseZoom(/*Number*/ factor)
Decreases the canvas zoom value, using the provided factor. |
|
fitContent()
Adjusts the viewport and the zoom level such that the entire graph is displayed in the canvas area. |
Object |
getCenter()
Returns the world coordinates at the center of the view. |
Graph |
getGraph()
Returns the current graph. |
GraphHighlighter |
getHighlighter()
Returns the GraphHighlighter instance that is used to create the visual representation of the highlight for nodes and edges. |
HitTest |
getHitTest()
returns the hit test instance used by this graph canvas. |
HitInfo |
getLastHitInfo()
returns the last hit info object. |
Object |
getMousePosition()
Returns the coordinates of the last mouse or touch position over the canvas as an object with "x" and "y" fields. |
Object |
getViewCoordinates(/*Number*/ rawX, /*Number*/ rawY)
Translates the provided coordinates to view coordinates, making them relative to the upper left corner of the canvas. |
|
getViewport()
Returns the currently visible viewing region in world coordinates. |
GraphBounds |
getWorldBounds()
Returns the current world bounds. |
Object |
getWorldCoordinates(/*Number*/ x, /*Number*/ y)
Translates the provided coordinates to view coordinates and takes the zoom factor into account. |
|
highlight(/*String*/ id)
Highlights the graph element with the given id. |
|
increaseZoom(/*Number*/ factor)
Increases the canvas zoom value, using the provided factor. |
|
invalidateSVG(/*Function*/ callback)
Invalidates the current SVG and reloads it from the server. Also updates the world bounds. |
Boolean |
isAutoRefresh()
Returns whether the canvas refreshes itself whenever the graph changes. |
Boolean |
isBitmapMode()
Returns whether or not this canvas is in Bitmap Mode |
|
isMainTouch(/**/ touch)
Returns whether the provided touch instance is currently considered the "mainTouch". |
Boolean |
isMouseOver()
Returns true, if the mouse is over the canvas; false otherwise. |
Boolean |
isSVGMode()
Returns whether or not this canvas is in SVG Mode. |
|
onWorldBoundsChanged(/*GraphBounds*/ oldBounds, /*GraphBounds*/ newBounds)
Called when the world bounds changed |
|
pathSet(/*String*/ path)
hook for listeners called after setting a path |
|
postCreate()
|
|
pushTiles()
Moves the currently visible tiles to the second layer. This method is only relevant in <i>Bitmap Mode</i>. |
|
recalculateTiles(/*Boolean*/ replaceTiles)
Calculates the tiles for the visible area and loads missing tiles from the server. This method is only relevant in <i>Bitmap Mode</i>. |
|
refresh(/*Object*/ bounds, /*Object*/ shift, /*Boolean*/ doNotPushTiles, /*Function*/ callback)
Refreshes the display, useful after changes of the graph. This method is only relevant in <i>Bitmap Mode</i> |
|
requestDone(/*Boolean*/ success)
hook for listeners called after a server request |
|
resize(/*Object*/ marginBox)
Resizes the canvas. |
|
setAutoRefresh(/*Boolean*/ autoRefresh)
Sets whether the canvas refreshes itself whenever the graph changes. |
|
setBaseURL(/*String*/ baseURL)
Sets the base path for server requests (possibly relative to the current page) |
|
setCenter(/*Object*/ center)
Sets the world coordinates at the center of the view. |
|
setHighlighter(/*GraphHighlighter*/ highlighter)
Set the GraphHighlighter instance that will be used to create the visual representation of the highlight for nodes and edges. |
|
setNoInteractionMode()
Sets the interaction mode to no interaction. |
|
setPanMode(/*Boolean*/ replaceTiles)
Enables the NavigationInputMode to enable pan and pinch-zoom functionality. |
|
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. |
|
setRenderMode(/*String*/ mode)
Set whether the graph visualization should be rendered on the client using bitmap tiles or using a single SVG image. |
|
setViewPoint(/*Number*/ newX, /*Number*/ newY, /*Boolean*/ fixOldTiles)
moves the visible area, such that the view coordinates (newX, newY) become the coordinates of the upper left corner. |
|
setViewPointWorld(/*Number*/ worldX, /*Number*/ worldY)
Sets the viewpoint such that the provided world coordinates will be located at the top left corner of the canvas viewport. |
|
setZoom(/*Number*/ zoom)
Sets the zoom factor to the specified value. |
|
setZoomBoundsProviders(/*Function*/ minZoomProvider, /*Function*/ maxZoomProvider)
Sets functions which are used to obtain the bounds on the zoom value in setZoom. |
|
shift(/*Number*/ dx, /*Number*/ dy, /*Boolean*/ fixOldTiles)
Shifts the visible area by (dx, dy). |
Object |
toLocal(/*Number*/ x, /*Number*/ y)
Translates the passed page coordinates to local view coordinates of this canvas |
|
unhighlight(/*String*/ id)
Unhighlights the graph elements with the given id. |
|
unhighlightAll()
Unhighlights all graph elements. |
|
updateWorldBounds(/*Object*/ newWorldBounds, /*boolean*/ doNotUpdateHitTest)
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 |
|
zoomTo(/*Object*/ worldRect)
Sets the zoom level and view port center so that the given rectangle in world coordinates fits the viewport. |
Boolean |
zoomToPointRecognizer(/*Event*/ evt)
Callback to decide whether to zoom to the mouse position or setZoom on mouse wheel event. |
|
zoomWithPoint(/*Number*/ x, /*Number*/ y, /*Number*/ newZoom)
Zooms the canvas such that the world coordinates that are currently displayed at the provided view coordinates will stay at the same view coordinates after the zoom change. |
| Event Summary | |
|---|---|
|
onClick(/*Event*/ evt)
Called when the user clicks the widget |
|
onClickEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
Called when an edge was clicked, if edgeEvents are enabled. |
|
onClickEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when an edge label was clicked, if edgeLabelEvents are enabled. |
|
onClickNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
Called when a node was clicked, and nodeEvents are enabled. |
|
onClickNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when a node label is clicked, if nodeLabelEvents are enabled. |
|
onClickPaper(/*Object*/ info, /*HitInfo*/ evt)
Called when a click event does not hit any graph element, if paperEvents are enabled. |
|
onDblClick(/*Event*/ evt)
Called when the user double-clicks the widget |
|
onDblClickEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
Called when an edge was double-clicked, if edgeEvents are enabled. |
|
onDblClickEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when an edge label was double-clicked, if edgeLabelEvents are enabled. |
|
onDblClickNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
Called when a node was double-clicked, and nodeEvents are enabled. |
|
onDblClickNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when a node label is double-clicked, if nodeLabelEvents are enabled. |
|
onDblTapEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ touch)
Called when an edge was double-tapped, if edgeEvents are enabled. |
|
onDblTapEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ touch)
Called when an edge label was double-tapped, if edgeLabelEvents are enabled. |
|
onDblTapNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ touch)
Called when a node was double-tapped, if nodeEvents are enabled. |
|
onDblTapNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ touch)
Called when a node label was double-tapped, if nodeLabelEvents are enabled. |
|
onDblTapPaper(/*HitInfo*/ info, /*Object*/ touch)
Called for a double tap event that does not hit any graph element, if paperEvents are enabled. |
|
onLoadSVG()
called when a new SVG is requested from the server. |
|
onLoadTiles()
hook for listeners called when tiles will be (re)loaded. This method is only relevant in <i>Bitmap Mode</i>. |
|
onLongPressEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ touch)
Called when an edge was long-pressed, if edgeEvents are enabled. |
|
onLongPressEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ touch)
Called when an edge label was long-pressed, if edgeLabelEvents are enabled. |
|
onLongPressNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ touch)
Called when a node was long-pressed, if nodeEvents are enabled. |
|
onLongPressNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ touch)
Called when a node label was long-pressed, if nodeLabelEvents are enabled. |
|
onLongPressPaper(/*HitInfo*/ info, /*Object*/ touch)
Called for a long press event that does not hit any graph elements, if paperEvents are enabled. |
|
onMouseDown(/*Event*/ evt)
Called when the user pressed the mouse on the widget but before it is released |
|
onMouseMove(/*MouseEvent*/ evt)
Called when the mouse is moved on the canvas |
|
onMouseOut(/*Event*/ evt)
Called when the mouse left the canvas |
|
onMouseOutEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse stops hovering over an edge path, if edgeEvents are enabled. |
|
onMouseOutEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse exits the bounds of an edge label, if edgeLabelEvents are enabled. |
|
onMouseOutNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse exits the bounds of a node, if nodeEvents are enabled. |
|
onMouseOutNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse exits the bounds of a node label, if nodeLabelEvents are enabled. |
|
onMouseOver(/*Event*/ evt)
Called when the mouse is over the canvas |
|
onMouseOverEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse hovers over an edge path, if edgeEvents are enabled. |
|
onMouseOverEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse enters the bounds of an edge label, if edgeLabelEvents are enabled. |
|
onMouseOverNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse enters the bounds of a node, if nodeEvents are enabled. |
|
onMouseOverNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
Called when the mouse enters the bounds of a node label, if nodeLabelEvents are enabled. |
|
onMouseUp(/*Event*/ evt)
Called when the user releases a pressed mouse button |
|
onPinch(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Array*/ pinchTouches)
Callback that is invoked when a touch (or both touches) of a pinch gesture moved. |
|
onPinchEnd(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Array*/ pinchTouches)
Callback that is invoked when a pinch gesture has ended. |
|
onPinchStart(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Array*/ pinchTouches)
Callback that is invoked when a pinch gesture was started on the canvas. |
|
onSVGLoaded()
called when an SVG request has completed (i.e., the SVG is now available on the client). |
|
onTapEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ touch)
Called when an edge has been tapped, if edgeEvents are enabled. |
|
onTapEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ touch)
is called for a tap event on an edge label, if edgeLabelEvents are enabled. |
|
onTapNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ touch)
Called when a node is tapped, if nodeEvents are enabled. |
|
onTapNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ touch)
Called when a node label is tapped, if nodeLabelEvents are enabled. |
|
onTapPaper(/*HitInfo*/ info, /*Object*/ touch)
Called for a tap event that does not hit any graph elements. |
|
onTilesLoaded()
hook for listeneres called when all tiles have been loaded. This method is only relevant in <i>Bitmap Mode</i>. |
|
onTouchEnd(/*Touch*/ touch, /*Object*/ worldCoords)
Callback that is invoked when a touch gesture that started on the canvas has ended. |
|
onTouchLongPress(/*Touch*/ touch, /*Object*/ worldCoords)
Callback that is invoked when a long press touch gesture occurred on the canvas. |
|
onTouchMove(/*Touch*/ touch, /*Object*/ worldCoords)
Callback that is invoked when a touch location that started on the canvas was moved. |
|
onTouchStart(/*Touch*/ touch, /*Object*/ worldCoords)
Callback that is invoked when a touch gesture has started on the canvas. |
|
onTouchTapped(/*Touch*/ touch, /*Object*/ worldCoords, /*int*/ tapCount)
Callback that is invoked when a tap gesture occurred on the canvas. |
|
onZoomChanged(/*Object*/ evt)
Called when the zoom is changed |
|
tileLoaded(/*String*/ tileId)
Hook for listeners called after loading a bitmap tile. This method is only relevant in <i>Bitmap Mode</i>. |
| Field Detail |
|---|
/*String*/ RENDER_MODE_BITMAP
/*String*/ RENDER_MODE_SVG
/*String*/ baseURL
/*boolean*/ dispatchGraphItemEvents
true.
/*Object*/ domNode
/*Object*/ doubleTapSize
doubleTapTime,
multiple taps will be considered double or multi-taps.
The default value is {width: 20, height: 20}.
/*int*/ doubleTapTime
/*Boolean*/ edgeEvents
/*Boolean*/ edgeLabelEvents
/*boolean*/ fixed
false.
/*HTMLDivElement*/ glassPane
/*Number*/ height
/*Number*/ highlightNodeSurroundPixels
/*int*/ longPressTime
touchDragSize area.
The higher the value the later a touch pointer movement will be recognized as a long press.
The default value is 1000 milliseconds.
/*string*/ mainTouchId
/*Number*/ maxZoomForFitContent
/*Number*/ minPinchDelta
1.
/*Number*/ mouseWheelScrollFactor
/*boolean*/ mouseWheelZoom
true.
/*HTMLDivElement*/ movables
/*NavigationInputMode*/ navigationMode
createNavigationMode().
If this canvas is in "no interaction mode" (setNotInteractionMode()), the value of this
property is null.
/*Boolean*/ nodeEvents
/*Boolean*/ nodeLabelEvents
/*HTMLElement*/ oldTiles
Bitmap Mode).
/*HTMLElement*/ overlays
/*Number*/ paintDetailThreshold
0.3.
/*Boolean*/ paperEvents
/*String*/ path
/*Boolean*/ showLoading
/*int*/ svgBorder
fitContent(). Instead, the property can be used when node visualizations extend
beyond the graph bounds calculated on the server (as might be the case for drop shadow effects).
The default value is 0.
/*HTMLElement*/ svgLayer
SVGViewPort widget (if in SVG Mode).
/*String*/ svgPrefix
SVG Mode are used on the
same page. Each canvas in SVG Mode has to use a unique prefix.
/*String*/ templatePath
/*Number*/ tileSize
Bitmap Mode.
/*HTMLElement*/ tilesFrame
Bitmap Mode).
/*Object*/ touchDragSize
{width: 5, height: 5}.
/*Boolean*/ useTouchEventsExclusively
true, evt.preventDefault() is called
on each touch event, thereby preventing the additional mouse event.
/*ViewportLimiter*/ viewportLimiter
/*Number*/ width
/*Number*/ x
/*Number*/ y
/*Number*/ zoom
/*Number*/ zoomMarginFactor
| Method Detail |
|---|
TouchPointHandler _createTouchPointHandler(/*String*/ identifier)
_getOrCreateTouchPointHandler to create a new yfiles.client.support.TouchPointHandler instance
to handle the touch event that corresponds to the provided identifier.identifier - The identifier that should be passed on to the TouchPointHandler.
TouchPointHandler _getOrCreateTouchPointHandler(/*Number*/ identifier, /*Object*/ currentTouchPoint)
identifier - The identifier for which a TouchPointHandler is requested.
currentTouchPoint - If a point is passed, it is used to check whether a double-tap occurred. If so, the TouchPointHandler
that corresponds to the previous touch event is reused for the current touch event (even though the touch
identifiers differ).
_mouseWheeled(/*Event*/ evt)
mouseWheelZoom property is enabled, a mouse wheel event will change the zoom level.
The zoom behavior is influenced by the current limits of the viewportLimiter, and by the
mouseWheelScrollFactor and zoomToPointRecognizer properties.evt - The mouse wheel event.
Boolean _supportMultiTouch()
beforeRequest()
center(/*Number*/ cX, /*Number*/ cY)
(cX, cY) become the
new coordinates of the center of the visible area.
To center world coordinates, use setCenter().cX - The new x coordinate of the center of the visible area.
cY - The new y coordinate of the center of the visible area.
clear(/*Boolean*/ newGraph)
newGraph - If true (the default), the canvas is set up for loading a new graph.
NavigationInputMode createNavigationMode()
NavigationInputMode that enables panning and zooming support for
mouse and touch input.decreaseZoom(/*Number*/ factor)
viewportLimiter into account.factor - The factor the current zoom value should be divided by.
If no factor is provided, a default factor of 1.2 is used.
fitContent()
zoomMarginFactor property is taken into account.Object getCenter()
Graph getGraph()
GraphHighlighter getHighlighter()
HitTest getHitTest()
HitInfo getLastHitInfo()
Object getMousePosition()
Object getViewCoordinates(/*Number*/ rawX, /*Number*/ rawY)
rawX - The raw x coordinate.
rawY - The raw y coordinate.
getViewport()
GraphBounds getWorldBounds()
Object getWorldCoordinates(/*Number*/ x, /*Number*/ y)
getViewCoordinates()
and then the zoom factor is taken into account. If no parameters are provided,
it will use the last known mouse location instead.
Note that passed x and y coordinates are assumed to be relative to the position of the canvas -
i.e., this method will not translate the passed coordinates by the canvas position.
To translate page coordinates to local canvas coordinates, use toLocal().x - The x coordinate.
y - The y coordinate.
highlight(/*String*/ id)
id - id of a node or edge
increaseZoom(/*Number*/ factor)
viewportLimiter into account.factor - The factor the current zoom value should be multiplied by.
If no factor is provided, a default factor of 1.2 is used.
invalidateSVG(/*Function*/ callback)
callback - A Callback that will be invoked when the new SVG has been loaded
Boolean isAutoRefresh()
Boolean isBitmapMode()
Bitmap Modetrue if Bitmap Mode is enabled; false otherwise.isMainTouch(/**/ touch)
touch -
Boolean isMouseOver()
true, if the mouse is over the canvas; false otherwise.Boolean isSVGMode()
SVG Mode.true if SVG Mode is enabled; false otherwise.onWorldBoundsChanged(/*GraphBounds*/ oldBounds, /*GraphBounds*/ newBounds)
oldBounds - The old graph bounds
newBounds - The new graph bounds
pathSet(/*String*/ path)
path - the symbolic graph name
postCreate()
pushTiles()
recalculateTiles(/*Boolean*/ replaceTiles)
replaceTiles - If true, existing tiles are replaced with newly loaded tiles.
refresh(/*Object*/ bounds, /*Object*/ shift, /*Boolean*/ doNotPushTiles, /*Function*/ callback)
bounds - Optional new world bounds as an object with minX,
minY, maxX and maxY 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.
callback - Callback that is invoked after the new world bounds have been loaded.
requestDone(/*Boolean*/ success)
success - whether the request succeeded
resize(/*Object*/ marginBox)
marginBox - The object must have the properties
t (top offset), l (left offset),
h (height) and w (width).
setAutoRefresh(/*Boolean*/ autoRefresh)
autoRefresh - If true then the canvas can refresh itself.
setBaseURL(/*String*/ baseURL)
baseURL - The new base url.
setCenter(/*Object*/ center)
center - An object with "x" and "y" properties that specify the
target world coordinates that should be moved to the center
of the view.
setHighlighter(/*GraphHighlighter*/ highlighter)
highlighter - The highlighter instance that provides drawNodeHighlight and drawEdgeHighlight implementations.
setNoInteractionMode()
setPanMode(/*Boolean*/ replaceTiles)
NavigationInputMode to enable pan and pinch-zoom functionality.replaceTiles - If true, existing tiles are replaced with newly loaded tiles.
setPath(/*String*/ newPath, /*Boolean*/ reload)
newPath - The symbolic name of the graph
reload - If true, the graph is reloaded even if it is already cached for the session (default false)
setRenderMode(/*String*/ mode)
The client can be used either in Bitmap Mode or in SVG Mode. SVG Mode is supported only in modern browsers.
Bitmap mode uses a number of Bitmap tiles to render the diagram. This means that basic navigation actions like zooming and panning require multiple server requests. However, the client-side rendering performance in Bitmap Mode does not depend on the graph size.
In SVG Mode, a single SVG image is generated on the server. For panning and zooming, this image is just moved/scaled on the client, without the need for additional server requests. Of course, client-side editing support and level-of-detail functionality still requires server requests for the updated SVG image.
In contrast to Bitmap Mode, the client-side rendering performance in SVG Mode does heavily depend on the graph size and on the complexity of the graph visualizations.
mode - yfiles.client.tiles.widget.GraphCanvas.RENDER_MODE_SVG or
yfiles.client.tiles.widget.GraphCanvas.RENDER_MODE_BITMAP
setViewPoint(/*Number*/ newX, /*Number*/ newY, /*Boolean*/ fixOldTiles)
newX - The new x coordinate.
newY - The new y coordinate.
fixOldTiles - If true, the old tiles will be fixed by moving their position appropriately.
The default value is false.
setViewPointWorld(/*Number*/ worldX, /*Number*/ worldY)
worldX - The x-coordinate of the new viewpoint.
worldY - The y-coordinate of the new viewpoint.
setZoom(/*Number*/ zoom)
zoom - The new zoom value.
setZoomBoundsProviders(/*Function*/ minZoomProvider, /*Function*/ maxZoomProvider)
minZoomProvider - A function that takes a graph canvas and returns a Number that represents the minimal allowed value for zoom.
maxZoomProvider - A function that takes a graph canvas and returns a Number that represents the maximal allowed value for zoom.
shift(/*Number*/ dx, /*Number*/ dy, /*Boolean*/ fixOldTiles)
dx - The amount of shifting to the right (if positive) or left (if negative).
dy - The amount of shifting down (if positive) or up (if negative).
fixOldTiles - If true, the old tiles will be fixed by moving their position appropriately.
The default value is false.
Object toLocal(/*Number*/ x, /*Number*/ y)
x - y-coordinate of a point on the page
y -
unhighlight(/*String*/ id)
id - id of a node or edge
unhighlightAll()
updateWorldBounds(/*Object*/ newWorldBounds, /*boolean*/ doNotUpdateHitTest)
newWorldBounds - object with minX, minY, maxX and maxY attributes
doNotUpdateHitTest - do not set the bounds for the hit test of the canvas (default: false)
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
zoomTo(/*Object*/ worldRect)
viewportLimiter into account.worldRect - A rectangle with properties x,y,width and height
that specifies the desired rectangle in world coordinates that should fit into the viewport.
Boolean zoomToPointRecognizer(/*Event*/ evt)
evt - The mouse event.
zoomWithPoint(/*Number*/ x, /*Number*/ y, /*Number*/ newZoom)
x - The x coordinate at the center of the zoom.
y - The y coordinate at the center of the zoom.
newZoom - The new zoom value to be applied to that point.
| Event Detail |
|---|
onClick(/*Event*/ evt)
evt - The event.
onClickEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
edgeEvents are enabled.edgeId - The id of the clicked edge
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The click event
onClickEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
edgeLabelEvents are enabled.edgeLabelId - The id of the clicked edge label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The click event
onClickNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
nodeEvents are enabled.nodeId - The id of the clicked node
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The click event
onClickNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
nodeLabelEvents are enabled.nodeLabelId - The id of the node label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The click event
onClickPaper(/*Object*/ info, /*HitInfo*/ evt)
paperEvents are enabled.info - The hit info, as returned by getHitTest().getHitInfo()
evt - The click event
onDblClick(/*Event*/ evt)
evt -
onDblClickEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
edgeEvents are enabled.edgeId - The id of the clicked edge
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The double click event
onDblClickEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
edgeLabelEvents are enabled.edgeLabelId - The id of the clicked edge label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The double click event
onDblClickNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
nodeEvents are enabled.nodeId - The id of the double clicked node
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The double click event
onDblClickNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
nodeLabelEvents are enabled.nodeLabelId - The id of the node label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The double click event
onDblTapEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ touch)
edgeEvents are enabled.edgeId - The id of the tapped edge.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the double-taps' last touch event.
onDblTapEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ touch)
edgeLabelEvents are enabled.edgeLabelId - The id of the tapped edge label.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the double-taps' last touch event.
onDblTapNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ touch)
nodeEvents are enabled.nodeId - The id of the tapped node.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the double-taps' last touch event.
onDblTapNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ touch)
nodeLabelEvents are enabled.nodeLabelId - The id of the tapped node label.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the double-taps' last touch event.
onDblTapPaper(/*HitInfo*/ info, /*Object*/ touch)
paperEvents are enabled.info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the double-taps' last touch event.
onLoadSVG()
onLoadTiles()
onLongPressEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ touch)
edgeEvents are enabled.edgeId - The id of the edge that was pressed.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the original touch down event.
onLongPressEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ touch)
edgeLabelEvents are enabled.edgeLabelId - The id of the pressed edge label.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the original touch down event.
onLongPressNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ touch)
nodeEvents are enabled.nodeId - The id of the pressed node.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the original touch down event.
onLongPressNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ touch)
nodeLabelEvents are enabled.nodeLabelId - The id of the pressed node label.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the original touch down event.
onLongPressPaper(/*HitInfo*/ info, /*Object*/ touch)
paperEvents are enabled.info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the original touch down event.
onMouseDown(/*Event*/ evt)
evt -
onMouseMove(/*MouseEvent*/ evt)
evt -
onMouseOut(/*Event*/ evt)
evt -
onMouseOutEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
edgeEvents are enabled.edgeId - The id of the edge
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse out event
onMouseOutEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
edgeLabelEvents are enabled.edgeLabelId - The id of the edge label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse out event
onMouseOutNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
nodeEvents are enabled.nodeId - the id of the node
info - The hit info, as returned by getHitTest().getHitInfo()
evt - the mouse out event
onMouseOutNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
nodeLabelEvents are enabled.nodeLabelId - The id of the node label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse out event
onMouseOver(/*Event*/ evt)
evt -
onMouseOverEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ evt)
edgeEvents are enabled.edgeId - The id of the edge
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse over event
onMouseOverEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ evt)
edgeLabelEvents are enabled.edgeLabelId - The id of the edge label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse over event
onMouseOverNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ evt)
nodeEvents are enabled.nodeId - The id of the node
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse over event
onMouseOverNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ evt)
nodeLabelEvents are enabled.nodeLabelId - The id of the node label
info - The hit info, as returned by getHitTest().getHitInfo()
evt - The mouse over event
onMouseUp(/*Event*/ evt)
evt -
onPinch(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Array*/ pinchTouches)
worldCoords1 - The world coordinates of the first touch event of the pinch gesture.
worldCoords2 - The world coordinates of the second touch event of the pinch gesture.
pinchTouches - The individual touches that make up the pinch gesture.
onPinchEnd(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Array*/ pinchTouches)
worldCoords1 - The world coordinates of the first touch event of the pinch gesture.
worldCoords2 - The world coordinates of the second touch event of the pinch gesture.
pinchTouches - The individual touches that make up the pinch gesture.
onPinchStart(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Array*/ pinchTouches)
worldCoords1 - The world coordinates of the first touch event of the pinch gesture.
worldCoords2 - The world coordinates of the second touch event of the pinch gesture.
pinchTouches - The individual touches that make up the pinch gesture.
onSVGLoaded()
onTapEdge(/*String*/ edgeId, /*HitInfo*/ info, /*Object*/ touch)
edgeEvents are enabled.edgeId - The id of the tapped egde.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the touch tap event.
onTapEdgeLabel(/*String*/ edgeLabelId, /*HitInfo*/ info, /*Object*/ touch)
edgeLabelEvents are enabled.edgeLabelId - The id of the tapped edge label.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the touch tap event.
onTapNode(/*String*/ nodeId, /*HitInfo*/ info, /*Object*/ touch)
nodeEvents are enabled.nodeId - The id of the tapped node.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the touch tap event.
onTapNodeLabel(/*String*/ nodeLabelId, /*HitInfo*/ info, /*Object*/ touch)
nodeLabelEvents are enabled.nodeLabelId - The id of the tapped node label.
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the touch tap event.
onTapPaper(/*HitInfo*/ info, /*Object*/ touch)
info - The hit info, as returned by getHitTest().getHitInfo()
touch - The touch instance of the touch tap event.
onTilesLoaded()
onTouchEnd(/*Touch*/ touch, /*Object*/ worldCoords)
touch -
worldCoords - The world coordinates of the touch event.
onTouchLongPress(/*Touch*/ touch, /*Object*/ worldCoords)
longPressTime and touchDragSize properties.touch -
worldCoords - The world coordinates of the touch event.
onTouchMove(/*Touch*/ touch, /*Object*/ worldCoords)
touch -
worldCoords - The world coordinates of the touch event.
onTouchStart(/*Touch*/ touch, /*Object*/ worldCoords)
touch -
worldCoords - The world coordinates of the touch event.
onTouchTapped(/*Touch*/ touch, /*Object*/ worldCoords, /*int*/ tapCount)
touch -
worldCoords - The world coordinates of the touch event.
tapCount -
onZoomChanged(/*Object*/ evt)
evt - An object which defines the properties
"zoom", "oldZoom" and "zoomPoint".
tileLoaded(/*String*/ tileId)
tileId - The id of the tile that has been loaded.