Append this code to the function 'onLinkCreated':
JavaScript Copy Code |
---|
// create a new ShapeNode |
Use the createShapeNode method of the Factory class to create node with specified location and size.
Use the setDestination method to connect the link to the destination node specified by the destNode variable. In addition, set the Dynamic property:
JavaScript Copy Code |
---|
// connect the link to the node and set its properties |
Draw several links starting from the root node. At the end of each link, a destination node is created automatically, and the node's text shows the node's number in it. Look at the pictures below: