Fixed size nodes

I'm trying to port a desktop app to the web using Diagram. The app simply "connect" fixed sized shapes loaded from specific libraries to other shapes, is there a way to create some"fixed size shape" so that the user cannot resize them but can move, rotate and snap them together?
Something similar to this:https://gojs.net/latest/samples/pipes.html
Thanks for your time.
DR

1 Reply 1 reply marked as answer

AR Aravind Ravi Syncfusion Team October 21, 2020 07:09 AM UTC

Hi QED, 
 
By using the NodeConstraints we can able to restrict the node resize. To prevent the node from resizing remove resize constraints from node constraints. So that you cannot able to resize the node and able to drag, rotate the node. Please refer below code snippet for how to remove resize from node constraints 
 
let node: NodeModel = { 
    id: 'node1', width: 100, height: 100, offsetX: 100, offsetY: 100, annotations: [ { content: 'Node1'}], 
    constraints: NodeConstraints.Default & ~(NodeConstraints.Resize) 
 
}; 
 
Regards 
Aravind Ravi 


Marked as answer
Loader.
Up arrow icon