Search
DiagramBase.nodeCreated Event
See Also
 





Raised when the user draws a new node.

Namespace: MindFusion.Diagramming
File: DiagramBase.js

 Syntax

JavaScript  Copy Code
diagram.nodeCreated.addEventListener(onNodeCreated);

 Event Data

Event handlers receive a NodeEventArgs instance containing data about this event.

 Example

This example handles the nodeCreated event to set new node's anchorPattern.

JavaScript  Copy Code
diagram.nodeCreated.addEventListener(
    (sender, args) =>
    {
        if (sender.defaultShape.id == "Rectangle")
            args.node.anchorPattern = pattern1;
        else
            args.node.anchorPattern = pattern2;
    });

 See Also