documentationfor yFiles for HTML 3.0.0.3

GraphViewerInputMode

An IInputMode implementation for use in a GraphComponent to assign to the inputMode property.

Inheritance Hierarchy
Implemented Interfaces

Remarks

This mode can be used in a viewer-centric application where there is no need to modify the IGraph but browsing of the graph should be convenient. This mode allows for clicking or tapping on items using mouse, touch, or stylus, displaying tool tips for items, showing a context menu, allowing for easy navigation and traversal, moving the view port, and optionally doing marquee selection. Also ItemHoverInputMode can be used to get notified of the elements that the mouse is hovering over.

Due to the viewer-centric nature of this input mode, collapsing and expanding groups is disabled per default. To enable this feature, set allowCollapseGroup and allowExpandGroup to true.

This input mode manages a set of specialized input modes, each handling a specific part of the interaction with the graph. The following list details those along with their default priorities. Lower priorities come earlier when handing events.

  • waitInputMode (−1) – Disables this input mode when layouts or animations run.
  • keyboardInputMode (0) – Handles commands and arbitrary keyboard shortcuts.
  • clickInputMode (20) – Handles mouse and stylus clicks and double-clicks as well as touch taps and double-taps.
  • lassoSelectionInputMode (150) – Allows dragging a lasso path to select items within it. Disabled by default.
  • marqueeSelectionInputMode (160) – Allows dragging a rectangle to select items within it.
  • moveViewportInputMode (190) – Allows panning the viewport.
  • itemHoverInputMode (200) – Provides events to indicate that the mouse pointer hovers over an item.
  • navigationInputMode (210) – Provides general navigation facilities, such as navigating from one item to another with the arrow keys.
  • contextMenuInputMode (220) – Handles querying the context menu contents based on a location as well as preparing the menu for display.
  • toolTipInputMode (400) – Handles tooltips.

Examples

The GraphViewerInputMode can be installed by setting it as inputMode on the GraphComponent it handles.
Installing a configured GraphViewerInputMode
graphComponent.inputMode = new GraphViewerInputMode({
  toolTipItems: GraphItemTypes.LABEL_OWNER,
  clickableItems: GraphItemTypes.NODE,
  focusableItems: GraphItemTypes.NODE,
  selectableItems: GraphItemTypes.NONE,
  marqueeSelectableItems: GraphItemTypes.NONE,
})

Type Details

yFiles module
view

Constructors

Properties

Methods

Events