documentationfor yFiles for HTML 2.6

NavigationInputMode

An IInputMode that can navigate an IGraph displayed in a graphComponent.

Inheritance Hierarchy
NavigationInputMode
Implemented Interfaces

Remarks

This mode is exclusive by default.

Examples

Typically the NavigationInputMode is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the navigationInputMode property.

const navigationInputMode = mode.navigationInputMode

The NavigationInputMode supports e.g. opening and closing group nodes. These actions can be configured in details:

// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode

// enable expanding and collapsing group nodes
mode.navigationInputMode.allowCollapseGroup = true
mode.navigationInputMode.allowExpandGroup = true
// don't fit the content after expand/collapse
mode.navigationInputMode.fitContentAfterGroupActions = false
// expand/collapse group nodes in a way that their
// top right corner stays at its current coordinates
mode.navigationInputMode.autoGroupNodeAlignmentPolicy =
  NodeAlignmentPolicy.TOP_RIGHT

It also reports when groups are opened or collapsed interactively by raising the following events:

// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
mode.navigationInputMode.addGroupExpandingListener((sender, args) => {
  const node = args.item
  // do something with the node before it will be expanded
})
mode.navigationInputMode.addGroupExpandedListener((sender, args) => {
  const node = args.item
  // do something with the node after it has been expanded
})
mode.navigationInputMode.addGroupCollapsingListener((sender, args) => {
  /* same for collapse operations */
})
mode.navigationInputMode.addGroupCollapsedListener((sender, args) => {
  /* same for collapse operations */
})

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.input.NavigationInputMode

See Also

Constructors

Properties

Methods

Events