Editing Graphs
A major feature of yFiles for HTML is its comprehensive support for editing graphs interactively. This functionality is encapsulated in GraphEditorInputMode, a highly customizable input mode. On its own, it provides an editing experience similar to conventional graph editing applications. However, it can also be configured to achieve almost any combination of desired interactions. For most use cases, you will likely want GraphEditorInputMode as the main input mode for your application.
graphComponent.inputMode = new GraphEditorInputMode()
The benefits of using GraphEditorInputMode are:
- Scalability: You can add new interactive functionality (in the form of other input modes) to GraphEditorInputMode.
- Flexibility: Everything can be enabled or disabled, allowing you to adjust the default behavior to your needs.
GraphEditorInputMode supports creating and removing graph elements, as well as moving and resizing items. Furthermore, it provides support for click handling, touch handling, selection, and context menus. You can find an overview of these features in Supported User Interactions.
Most functionality is delegated to a wide array of child input modes. Both GraphEditorInputMode and its child input modes offer several ways to customize their behavior. These customization options are discussed briefly in Supported User Interactions and in detail in Customizing User Interaction.