This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.
Constructs a GuidedDraggingTool and sets up the temporary guideline parts.
Optionalinit: Partial<GuidedDraggingTool>Gets or sets the collection of Parts that this tool has copied. The value is a go.Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part. The value is null when moving instead of copying.
draggedParts provides the map of Parts that are being moved and from which this collection was copied.
Gets or sets whether for a copying operation the extended selection is copied or only the selected parts. The default value is true. Setting this property does not raise any events.
The CommandHandler.copiesConnectedLinks property serves a similar role for the CommandHandler.copySelection command,
when the user types Ctrl-C to copy the currently selected parts.
The cursor to show when a drop is allowed and will result in a copy. This defaults to 'copy'. Read more about cursors at Diagram.currentCursor
since2.2
Gets or sets the Part found at the mouse point. This is normally set by a call to standardMouseSelect.
On touch gestures only, this property gets or sets the time in milliseconds for which the mouse must be stationary before this tool can be started. The default value is 100 milliseconds. Setting this property does not raise any events.
Gets or sets the collection of Parts being moved. The value is a go.Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part.
copiedParts provides the map of Parts that have been copied during a copying operation, if any.
Gets or sets the DraggingTool's DraggingOptions instance, which controls several dragging properties.
Several DraggingTool properties are just convenience properties:
Setting any of these properties really sets the corresponding dragOptions property.
Setting this property does not raise any events.
since2.0
Gets or sets whether the user can drag a single Link, disconnecting it from its connected nodes and possibly connecting it to valid ports when the link is dropped. The default value is false. Setting this property does not raise any events.
In order to avoid too many cases of having both ends of a dragged Link connect to the same node (if allowed), it is commonplace to decrease the LinkingBaseTool.portGravity to a smaller value such as 10 or 20.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets whether moving or copying a node also includes all of the node's tree children and their descendants, along with the links to those additional nodes. The default value is false. Setting this property does not raise any events.
The CommandHandler.copiesTree property serves a similar role for the CommandHandler.copySelection command,
when the user types Ctrl-C to copy the currently selected parts.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets the size of the grid cell used when snapping during a drag if the value of isGridSnapEnabled is true. By default this property is the Size(NaN, NaN), which causes this tool to use the Panel.gridCellSize value of the Diagram.grid. Setting this property does not raise any events.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets the Spot that specifies what point in the grid cell dragged parts snap to, if the value of isGridSnapEnabled is true. By default this property is Spot.TopLeft: node locations will snap exactly to the grid point. Setting this property does not raise any events.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets the snapping grid's origin point, in document coordinates, if the value of isGridSnapEnabled is true. By default this property is the Point(NaN, NaN), which causes this tool to use the Panel.gridOrigin value from the Diagram.grid. Setting this property does not raise any events.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets the Part to show on the left side when the moved Part leaves nearly the same spacing left and right between this Part and the nearest Parts on either side of it. This defaults to a vertical cyan dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show on the right side when the moved Part leaves nearly the same spacing left and right between this Part and the nearest Parts on either side of it. This defaults to a vertical cyan dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show when the moved Part's bottom lines up with a stationary Part. This defaults to a horizontal magenta dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show when the moved Part's center lines up with a stationary Part. This defaults to a horizontal magenta dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show when the moved Part's top lines up with a stationary Part. This defaults to a horizontal magenta dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show when the moved Part's center lines up with a stationary Part. This defaults to a vertical magenta dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show when the moved Part's left side lines up with a stationary Part. This defaults to a vertical magenta dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show when the moved Part's right side lines up with a stationary Part. This defaults to a vertical magenta dashed line. Set this to null to not show anything for this case.
Gets or sets the margin of error for which guidelines show up.
The default value is 6. Guidelines will show up when the aligned nodes are ± 6px away from perfect alignment.
Gets or sets the Part to show below when the moved Part leaves nearly the same spacing above and below between this Part and the nearest Parts above and below it. This defaults to a vertical cyan dashed line. Set this to null to not show anything for this case.
Gets or sets the Part to show above when the moved Part leaves nearly the same spacing above and below between this Part and the nearest Parts above and below it. This defaults to a vertical cyan dashed line. Set this to null to not show anything for this case.
Gets or sets whether this tool is started and is actively doing something.
You can set this to true after your tool is started (i.e. when it is the Diagram.currentTool and doStart had been called), but when it is not yet in a state that it is actually "doing" something, because it is waiting for the right circumstances. This is typically only important when the tool is used in a modal fashion.
The default value is false. This is normally set by doActivate and doDeactivate.
In 3.0 this is superceded by Router.isRealtime, and setting this property attempts to set that property on the "AvoidsLinks" Router.
Gets or sets whether link routing takes some short-cuts during dragging. When false Links whose routing is AvoidsNodes are not routed to avoid Nodes, in order to improve dragging performance. The default value is true.
deprecated
Gets or sets whether for any internal copying operation is permitted by control-drag-and-drop (or alt-drag-and-drop on Mac). This property affects the behavior of mayCopy, but does not affect whether copied objects may be dropped into this diagram from a different diagram.
The default value is true. Setting this property does not raise any events.
Gets or sets whether this tool can be started by a mouse event.
Set this to false to prevent canStart from returning true. Setting this property to false should prevent this tool from being used in a mode-less fashion by the ToolManager with a mouse down/move/up event. However, even when this property is false, this tool can still be used in a modal fashion: it can still be started by explicitly setting the Diagram.currentTool property to this tool.
The default value is true.
Gets or sets whether snapping to have equal space on both sides of the moved Part is enabled.
The default value is true.
Gets or sets whether the DraggingTool snaps objects to grid points. Whether the snapping movement of the dragged parts occurs during the drag or only upon a drop is determined by the value of isGridSnapRealtime.
This property does not affect dragging disconnected links, but those links do respect the Part.dragComputation, which can be used to snap them.
By default this property is false. Setting this property does not raise any events.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets whether the DraggingTool snaps objects to grid points during the drag. This property is ignored unless isGridSnapEnabled is true. By default this property is true; when false parts are only snapped to grid locations upon the drop (i.e. mouse-up). Setting this property does not raise any events.
This property is a convenience getter/setter, and sets a value on dragOptions.
Gets or sets whether snapping to guidelines provided by nearby Parts is enabled.
The default value is true.
Gets or sets whether snapping for equal spacing or to guidelines is enabled during a drag. This property is useless when both isGuidelineSnapEnabled and isEqualSpacingSnapEnabled are false.
The default value is true.
The cursor to show when a drop is allowed and will result in a move. This defaults to the empty string, which refers to the Diagram.defaultCursor. Read more about cursors at Diagram.currentCursor
since2.2
Gets or sets the name of this tool. The default name is an empty string, but the constructor for each instance of a subclass of Tool will initialize it appropriately. For example, the name of the DragSelectingTool is "DragSelecting".
This name is sometimes used by tools that use Adornments as the Part.category for their Adornments. It is also sometimes used by tools that conduct transactions as the transaction name.
The cursor to show when a drop is not allowed. This defaults to 'no-drop'. Read more about cursors at Diagram.currentCursor
since2.2
Gets or sets the distance around the selected part to search for aligned parts.
The default value is 2000. Set this to Infinity if you want to search the entire diagram no matter how far away.
Gets or sets whether the guidelines are shown or not. Setting this to false causes no horizontal or vertical guidelines, nor the spacing guides, to be shown. However, snapping may still take place, during the drag if isRealtimeSnapEnabled is true, or at the end on mouse-up.
The default value is true.
Gets or sets the mouse point from which parts start to move. The value is a Point in document coordinates. This property is normally set to the diagram's mouse-down point in doActivate, but may be set to a different point if parts are being copied from a different control. Setting this property does not raise any events.
Gets or sets the name of the transaction to be committed by stopTransaction
If null, the transaction will be rolled back.
If this is non-null at the time of a call to stopTransaction, it calls Diagram.commitTransaction with this transaction name; if this is null at that time, it calls Diagram.rollbackTransaction.
The default value is null; startTransaction will also set this to null. Because a value of null when stopTransaction is called will rollback the transaction, it is important that your code sets this property to a non-null value when it thinks it has succeeded.
This property exists so that no matter what execution path occurs to end the usage of a tool, any ongoing transaction can be properly committed or rolled-back. Many tools call startTransaction and stopTransaction; thus they set this property for their transaction to be committed. doCancel also sets this property to null.
VirtualcancelThis is called to cancel any running "WaitAfter" timer.
This is called when a tool is stopped.
This method is rarely overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualcanThis tool can run if the diagram allows selection and moves/copies/dragging-out, if the mouse has moved far enough away to be a drag and not a click, and if findDraggablePart has found a selectable part at the mouse-down point.
This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualcanThis method controls for some Tools whether canStart may return true depending on the button being used. Normally this returns true if InputEvent.left is true. This method may be overridden to consider other buttons, or to ignore which button by just returning true.
true, if the left mouse button is being held down
since4.0
VirtualcanAs of version 4, this predicate method is no longer called by the ToolManager. Most of the responsibility for pinch zooming has been moved to the PanningTool.
deprecatedRemoves all of the guidelines from the grid.
VirtualcomputeThis just calls CommandHandler.computeEffectiveCollection and remains for compatibility.
This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
Potential options for the collection computation
a Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part.
VirtualcomputeThis method computes the new location for a Node or simple Part, given a new desired location and an optional Map of dragged parts, taking any grid-snapping into consideration, any Part.dragComputation function, and any Part.minLocation and Part.maxLocation.
This just calls Diagram.computeMove and remains for compatibility.
This method may be overridden, but should usually be overridden on Diagram. Please read the Learn page on Extensions for how to override methods and how to call this base method.
the Node or simple Part that is being moved
the proposed new location
Optionaldraggedparts: Map<Part, DraggingInfo> | nullan optional Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part.
Optionalresult: Pointan optional Point that is modified and returned
the possibly grid-snapped computed Point that is within the minimum and maximum permitted locations
Start the dragging operation. This calls computeEffectiveCollection and saves the result as draggedParts.
This starts a "Drag" transaction. Depending on what happens, the transaction may be finished as a "Move" or a "Copy" transaction, or it may be rolled-back if the tool is cancelled.
Normally when this method is called the value of currentPart will be null, in which case this will call Tool.standardMouseSelect which will set currentPart. But if when this method is called the value of currentPart has already been set because the programmer wants the user to start dragging that Part, then this method will not need to call Tool.standardMouseSelect because the Part(s) to be selected and dragged have already been determined by the caller.
Abort any dragging operation.
OverridedoCalls the base method and removes the guidelines from the graph.
OverridedoShows vertical and horizontal guidelines for the dragged part.
OverridedoOn a mouse-up, snaps the selected part to the nearest guideline. If not snapping, the part remains at its position.
Handle switching between copying and moving modes as the Control/Option key is pressed or released.
Handle switching between copying and moving modes as the Control/Option key is pressed or released.
VirtualdoThe diagram will call this method upon a mouse down event. This is normally overridden for mouse-down tools; it is not called for mouse-move or mouse-up tools. However it may also be called when the tool is run in a modal fashion, when code explicitly sets the diagram's Diagram.currentTool. Implementations of this method can look at Diagram.lastInput to get the mouse event and input state.
By default this method checks isActive; if that is false it calls canStart. If that in turn is true, this calls doActivate. This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
Move the draggedParts (or if copying, the copiedParts) to follow the current mouse point.
If this creates any temporary parts, by default it adds them to the Tool layer.
This calls doDragOver for any side-effects on stationary parts.
On a mouse-up finish moving or copying the effective selection.
This calls doDropOnto for any side-effects on stationary parts.
This also updates the diagram's bounds, raises a "SelectionCopied" or "SelectionMoved" DiagramEvent, and stops this tool.
This method also raises the "ChangingSelection" and "ChangedSelection" diagram events. Changes are performed in a "Drag" transaction, but the "ChangedSelection" event is raised outside the transaction.
VirtualdoThe diagram will call this method as the mouse wheel is rotated. Implementations of this method can look at Diagram.lastInput to get the mouse event and input state.
By default this method does nothing. (But the ToolManager.doMouseWheel override will call Tool.standardMouseWheel.) This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualdoThe Diagram calls this method when this tool becomes the current tool; you should not call this method. Tool implementations should perform their per-use initialization here, such as setting up internal data structures, or capturing the mouse. Implementations of this method can look at Diagram.lastInput to get the mouse event and input state.
You should not call this method -- only the Diagram.currentTool property setter should call this method.
By default this method does nothing. This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
If you override this method, it is commonplace to also override doStop to clean up whatever you set up in this method.
VirtualdoThe Diagram calls this method when this tool stops being the current tool; you should not call this method. Tool implementations should perform their per-use cleanup here, such as releasing mouse capture.
You should not call this method -- only the Diagram.currentTool property setter should call this method. If you want to stop a tool unexpectedly, you should call doCancel. If your implementation of a tool wants to stop itself, you should call stopTool.
By default this method does nothing. This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
It is commonplace to override this method in order to clean up whatever you have set up in an override of doStart.
VirtualdoThis is called a certain delay after a call to standardWaitAfter if there has not been any call to cancelWaitAfter. The ToolManager overrides this method in order to implement support for mouse-hover behavior and tooltips.
By default this does nothing. This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
The event that caused standardWaitAfter.
VirtualfindReturn the selectable and movable/copyable Part at the mouse-down point. This is called by canStart to decide if this tool is ready to run.
This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualfindThis convenience function finds the front-most GraphObject that is at a given point and that is an element of an Adornment that is of a given category. The tool handle must be an immediate element of the Adornment, not a GraphObject that is nested within Panels within the Adornment.
This method is very infrequently overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
a Point in document coordinates.
the required Part.category of the Adornment.
When nodes are shifted due to being guided upon a drop, make sure all connected link routes are invalidated, since the node is likely to have moved a different amount than all its connected links in the regular operation of the DraggingTool.
VirtualisReturn true when the last mouse point is far enough away from the first mouse down point to constitute a drag operation instead of just a potential click.
This uses the value of ToolManager.dragSize. On touch devices the value is automatically increased to accommodate the unavoidable movement of fingers.
This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
Optionalfirst: PointPoint in view coordinates, defaults to Diagram.firstInput's InputEvent.viewPoint.
Optionallast: PointPoint in view coordinates, defaults to Diagram.lastInput's InputEvent.viewPoint.
ProtectedisVirtualmayThis predicate is true when the diagram allows objects to be copied and inserted, and some object in the selection is copyable, and the user is holding down the Control key (Option key on Mac).
This method may be overridden, although in most cases it is easiest to set Part.copyable. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualmayThis predicate is true when the diagram allows objects to be moved, and some object in the selection is movable.
This method may be overridden, although in most cases it is easiest to set Part.movable. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualmoveMove a collection Map of Parts by a given offset.
If check is true this respects the Part.canMove predicate for Nodes or simple Parts when this is the Diagram.currentTool. It also respects isGridSnapEnabled in order to try to automatically snap part locations to a grid. And it also uses the Part.dragComputation function, if any, to determine the new location for each part.
The first argument is a go.Map as produced by computeEffectiveCollection, not a List or go.Set or Iterator of Parts. Call Diagram.moveParts if you want to move a simple collection of Parts without having to create the argument Map.
a Map mapping Parts to DraggingInfo Objects that have a "point" property remembering the original location of that Part.
The offset, before snapping, to move parts. This offset reflects the total amount moved during tool operation, based on original Part locations remembered when the DraggingTool activated.
Optionalcheck: booleanWhether to check Part.canMove on each part. The default value is false.
ProtectedshowThis finds parts that are aligned near the selected part along horizontal and vertical lines. It compares the selected part to all parts within a rectangle approximately twice the searchDistance wide. The guidelines appear when a part is aligned within a margin-of-error equal to guideSnapDistance.
the Part being moved
if true, show guideline
if true, snap the part to where the guideline would be
VirtualstandardImplement the standard behavior for mouse clicks, searching for and calling click handler functions on GraphObjects or on Diagram, and raising the corresponding DiagramEvent.
A click on a GraphObject of the diagram will raise one of the following DiagramEvents: "ObjectSingleClicked", "ObjectDoubleClicked", or "ObjectContextClicked". This will also look at the corresponding click property: GraphObject.click, GraphObject.doubleClick, or GraphObject.contextClick. If the value is a function, this will call it, passing the current InputEvent and the GraphObject. If the value is null, it tries looking at the parent GraphObject.panel, and so on, walking up the visual tree until it finds the appropriate function to call. After calling the click function, if the value of InputEvent.handled is false, this method will continue walking up the visual tree looking for more click functions to call. Once it has looked at the top-level object (a Part) for a click function, this method stops.
A click in the background of the diagram will raise one of the following DiagramEvents: "BackgroundSingleClicked", "BackgroundDoubleClicked", or "BackgroundContextClicked". This will also look at the corresponding click property: Diagram.click, Diagram.doubleClick, or Diagram.contextClick. If the value is a function, this will call it, passing the current InputEvent.
This method is not responsible for selecting or deselecting any parts. Call standardMouseSelect for that functionality.
Note that this calls GraphObject.isEnabledObject on the target object; if it returns false, no click action will occur.
The ClickSelectingTool calls this method in its override of doMouseUp in order to raise "click" events. Note that by default GraphObjects in Layers that are Layer.isTemporary will not be "clicked". To change that behavior it is easiest to set GraphObject.isActionable to true on those objects for which you wish to handle "click" events. Then the ActionTool's doMouseUp override will raise the standard "click" events.
This method may be overridden, but you should consider calling this base method in order to get all of its functionality. Please read the Learn page on Extensions for how to override methods and how to call this base method.
Optionalnavig: ((a: GraphObject) => T | null) | nullAn optional custom navigation function to find target objects. This argument is passed to Diagram.findObjectAt.
Optionalpred: ((a: T) => boolean) | nullAn optional custom predicate function to find target objects. A null value is effectively the same as a function that always returns true. This argument is passed to Diagram.findObjectAt, unless the value is undefined, which means to use a predicate to consider only objects in layers holding permanent objects.
true if InputEvent.handled had been set to true on the Diagram.lastInput.
VirtualstandardImplement the standard behavior for mouse enter, over, and leave events, where the mouse is moving but no button is pressed. This should be called by mouse move event handlers when wanting to detect and invoke mouse enter/over/leave event handlers.
The GraphObject.mouseEnter property provides a function to call when the mouse first enters an object or any of its contained objects (if the object is actually a Panel).
The GraphObject.mouseLeave property provides a function to call when the mouse leaves an object and all of its contained objects (if the object is actually a Panel).
The GraphObject.mouseOver property and Diagram.mouseOver properties provide functions to call when the mouse moves but stays within the same GraphObject or when the mouse moves in the background of the Diagram.
This method is also responsible for updating the Diagram.currentCursor according to the value of GraphObject.cursor and Diagram.defaultCursor.
This method may be overridden, but you should consider calling this base method in order to get all of its functionality. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualstandardThis override prevents the Control modifier unselecting an already selected part. This also remembers the selectable currentPart at the current mouse point.
This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualstandardImplement the standard behavior for mouse wheel events. ToolManager.doMouseWheel calls this method.
Turning the mouse wheel if Diagram.allowVerticalScroll is true causes the diagram to scroll up or down. If InputEvent.shift and Diagram.allowHorizontalScroll are true, the diagram scrolls left or right.
If InputEvent.control and Diagram.allowZoom are true, turning the mouse wheel changes the diagram's scale, zooming in or out while trying to keep the point in the model at the same point as the mouse.
The value of ToolManager.mouseWheelBehavior affects what operations might occur upon mouse wheel events.
This method may be overridden, but you should consider calling this base method in order to get all of its functionality. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualstandardAs of version 4, this method is no longer called by the ToolManager. Most of the responsibility for pinch zooming has been moved to the PanningTool.
deprecatedVirtualstandardAs of version 4, this method is no longer called by the ToolManager. Most of the responsibility for pinch zooming has been moved to the PanningTool.
deprecatedVirtualstandardThis is called to start a new timer to call doWaitAfter after a given delay. It first cancels any previously running "WaitAfter" timer, by calling cancelWaitAfter.
This is normally used to implement mouse hover and mouse hold events. If the mouse has moved, it must not have moved beyond the distance as determined by Tool.isBeyondDragSize for it be considered "stationary". So the regular ToolManager.doMouseMove implementation only calls this method when the mouse has moved beyond the drag size.
This method is rarely overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
The delay, in milliseconds.
Optionalevent: InputEventAn optional event that caused this timer. Defaults to Diagram.lastInput. This gets passed on to doWaitAfter.
Call Diagram.startTransaction with the given transaction name. This always sets transactionResult to null.
This is normally called in an override of doActivate, if the tool modifies the model, along with a call to stopTransaction in an override of doDeactivate. Alternatively, you can surround a block of code that sets the transactionResult with calls to startTransaction and stopTransaction.
Optionaltname: stringa string describing the transaction.
the value of the call to Diagram.startTransaction.
VirtualstopIf the Diagram.currentTool is this tool, stop this tool and start the Diagram.defaultTool by making it be the new current tool. The implementation of various tool methods can call this method to stop the current tool. This will call doStop -- you should not call that method directly.
If you want to stop the current tool and have it restore the original state, call doCancel. Please read the Learn page on Extensions for how to override methods and how to call this base method.
VirtualstopThis calls the super Tool.stopTransaction method, and if the result is true,
attempts to optimize the transaction by removing all changes except the first and last
by calling Transaction.optimize.
This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
the result of the call to rollback or commit the transaction.
VirtualupdateThe diagram asks each tool to update any adornments the tool might use for a given part. If the tool uses its own tool handles, this should display them or hide them as appropriate. Typically this should only show them if the part is selected.
By default this method does nothing. This method may be overridden. Please read the Learn page on Extensions for how to override methods and how to call this base method.
The GuidedDraggingTool class makes guidelines visible as the parts are dragged around a diagram when the selected part is nearly aligned with another part, or when a part is nearly positioned between two other parts with equal space on both sides.
During dragging, this tool will show temporary Parts named "guide..." to indicate what the dragged Part will align with. You can customize the appearance of those Parts by setting those properties. By default they are Parts in the "Tool" Layer holding magenta or cyan dashed lines. You may also set some of those "guide..." properties to null if you do not want those guides to be shown and do not want to snap to those alignments.
Normally as the user drags a Part, that Part will snap to center itself with equal spacing on both sides, or it will line up with a nearby Part. If you do not want that snapping behavior during a drag, the user can hold down the Shift modifier key in order to move the Part smoothly, or you can set isRealtimeSnapEnabled to false. When that property is set to false, snapping will still happen upon mouse-up.
You can set the isGuidelineSnapEnabled or isEqualSpacingSnapEnabled property to false to avoid that kind of snapping behavior. When both those properties are true, as they are by default, and when a Part is near a point that provides both equal spacing between two Parts and alignment with a nearby Part, the equal spacing snapping takes precedence.
The maximum distance from perfect algnment that a dragged Part will snap to is controlled by the guideSnapDistance property. This tends to be a small value.
The maximum distance at which another Part might affect the alignment of the dragged Part is controlled by the searchDistance property. This tends to be a large value.
If you want to experiment with this extension, try the Guided Dragging sample.