documentationfor yFiles for HTML 2.6

Configuration Properties

Oftentimes, the logic to accomplish certain things in yFiles for HTML is not hard-coded, but encapsulated in (functional) interfaces and configuration classes where possible.

This, combined with the fact that yFiles for HTML is built extremely modularly makes exchanging these objects on the operating classes one of the most common forms of customization in yFiles for HTML. For example, you can completely change the possible user interactions in a yFiles for HTML application by simply exchanging the IInputMode set on the inputMode property of the GraphComponent.

We can configure the user interaction to behave like an editor by setting an instance of GraphEditorInputMode as the IInputMode for the GraphComponent:

Enabling editor functions in the GraphComponent
graphComponent.inputMode = new GraphEditorInputMode()

In the next example however, we change the set of available user interactions on the GraphComponent completely by setting an instance of GraphViewerInputMode as the GraphComponent’s IInputMode.

Enabling viewer functions in the GraphComponent
graphComponent.inputMode = new GraphViewerInputMode()

When you are looking for a way to change yFiles for HTML’s default behavior, always look for properties that might be related to your needs and use object composition.