This sample replaces the default text editor with the RealtimeTextEditor.js which exposes window.RealtimeTextEditor that is used in this sample as the value of myDiagram.toolManager.textEditingTool.defaultTextEditor. As you type in a text editor you will see that the node changes size automatically, which in turn causes a layout to be performed.

This also adds a text validation predicate, okName, as the TextBlock.textValidation property. That predicate makes sure that when trying to accept a new string that it has at least three characters and contains a vowel.