Articles in this section

How to Prevent Node Rotation in Vue Diagram?

This article explains how to prevent node rotation in Vue Diagram. In the Syncfusion® Vue Diagram, we have the flexibility to enable or disable specific behaviors of nodes through the use of NodeConstraints.

To prevent the rotation of a node in Diagram, we can use the Rotate NodeConstraint and disable it using the Bitwise ‘&~’ (XOR) operator.

// Set the constraints for node as Rotate and disable it
constraints: NodeConstraints.Default & ~NodeConstraints.Rotate

Below is a code example demonstrating how to prevent rotation in a node:

<template>
 <div class="col-lg-9 control-section">
   <!-- Diagram component section -->
   <div class="content-wrapper">
     <ejs-diagram
       id="diagram"
       ref="diagram"
       :width="width"
       :height="height"
       :nodes="nodes"
     ></ejs-diagram>
   </div>
 </div>
</template>

<script>
import {
 DiagramComponent,
 Diagram,
 NodeConstraints,
} from '@syncfusion/ej2-vue-diagrams';

let nodes = [
 {
   offsetX: 250,
   offsetY: 250,
   width: 100,
   height: 100,
   constraints: NodeConstraints.Default & ~NodeConstraints.Rotate,
 },
];

// Export Vue component
export default {
 components: {
   'ejs-diagram': DiagramComponent,
 },
 data: function () {
   return {
     width: '100%',
     height: '350px',
     nodes: nodes,
   };
 },
};
</script>

Refer to the working sample for additional details and implementation: Click here for sample

Conclusion

We hope you enjoyed learning how to prevent node rotation in Vue Diagram.

You can refer to our Vue 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 Vue 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, BoldDesk Support, 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