While moving the element in the canvas area it should fit inside the center of the cell grid

Hi,

I have an issue while moving the element in the canvas area it should fit center of the cell grid every time when I will move the element . the element I am having inside the group and label is also part of the group so when I will move group only element should be come always center of the grid cell …
do we have any event here while I will move the diagram it should come center of the cell grid.

image

Thank You

I’m not sure what you are asking for. There is a “SelectionMoved” DiagramEvent listener that you could define to adjust the locations of nodes at the end of a drag.

is there any way while moving the element in the canvas area automatic element should be fit center of the grid cell?

hope it is clear now.

Thank You

Do you mean https://gojs.net/latest/intro/grids.html#GridSnapping?

If you set the Part.locationSpot to go.Spot.Center and set DraggingTool.gridSnapCellSpot to go.Spot.Center as well, do you get the effect that you want?