Align/snap nodes by top/bottom/center of other nodes

Hello,

My team has been asked to recreate functionality seen in similar tools that allows users to align elements on the diagram with other elements using guidelines and snapping. While moving an element around the canvas, we would like to generate snappable lines along the top, bottom, right, left, and center point of other objects that can be used to align the currently held object to existing objects. See example:

Screen Shot 2021-06-23 at 10.17.28 AM

Do you potentially have any examples of this functionality we can build off of? If not, do you have any specific tools or tips we can start with?

Thanks!

Here it is: Guided Dragging
The functionality is in an extension: GuidedDraggingTool | GoJS API
The code is available at: https://gojs.net/latest/extensions/GuidedDraggingTool.js
There is also a TypeScript version at: https://gojs.net/latest/extensionsTS/GuidedDraggingTool.ts

Great! Thanks Walter, we’ll let you know if we have any followup questions.