Articles in this section

How to prevent node resize in Javascript platform

In the Syncfusion® JavaScript Diagram , by using the NodeConstraints, we can enable or disable certain features of nodes.

To prevent node resizing in the Diagram, use resize constraints.

// Set constraints as resize for Node
constraints: ej.diagrams.NodeConstraints.Default & ~ej.diagrams.NodeConstraints.Resize 

Set the constraints as follows for the node:

var nodes = [
   {
       id: "heptagon",
       offsetX: 200, offsetY: 160,
       width: 100, height: 100,
       shape: { type: 'Basic', shape: 'Heptagon' },
       annotations: [{ content: 'Resize = False' }],
       constraints: ej.diagrams.NodeConstraints.Default & ej.diagrams.NodeConstraints.Resize
   },
]; 

You can find a working example of this implementation in the provided sample on StackBlitz.

Sample - Click here for sample

Conclusion

I hope you enjoyed learning how to prevent node resizing in the JavaScript Diagram.
You can refer to our JavaScript Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our JavaScript Diagram example to understand how to create and manipulate data. For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied