Remarks
GraphSnapContext makes use of this class to interactively snap moving elements to circles. The circle can be reduced to an arc by defining valid startAngle and endAngle.
The visualization of the circle can be styled with the yfiles-snap-reference-circle CSS class.
See Also
- Similar to other SnapResults, the visualization can be styled with CSS. An overview of the different CSS styling options is presented in detail in the section CSS Styling Snap References .
Developer's Guide
Members
Constructors
With the startAngle and endAngle, the circle can be reduced to an arc. Both values are interpreted in radians clockwise from the positive x-axis.
If startAngle and endAngle are equal, the constraint uses the full circle. Otherwise, it uses the arc starting from startAngle clockwise to endAngle.
Parameters
- center: Point
- The center of the circle to snap to in world coordinates.
- radius: number
- The radius of the circle to snap to in world coordinates.
- startAngle: number
- The start angle of the arc in radians.
- endAngle: number
- The end angle of the arc in radians.
- weight: number
- The weight (importance) of this snap reference. If more than one snap reference is snapped to, the one with the greater weight will be used.
- snappableItems: GraphItemTypes
- The graph item types that may snap to this snap reference.
- tag?: any
- A tag that is associated with this snap reference - see tag for a typical use of this value.
Properties
Gets the center of the circle to snap to in world coordinates.
With the startAngle and this end angle, the circle can be reduced to an arc. Both values are interpreted in radians clockwise from the positive x-axis.
If startAngle and endAngle are equal, the constraint uses the full circle. Otherwise, it uses the arc starting from startAngle clockwise to endAngle.
Gets which types of items may snap to this snap reference.
Defined in
SnapReference.snappableItemsWith this start angle and the endAngle, the circle can be reduced to an arc. Both values are interpreted in radians clockwise from the positive x-axis.
If startAngle and endAngle are equal, the constraint uses the full circle. Otherwise, it uses the arc starting from startAngle clockwise to endAngle.
Defined in
SnapReference.tagDefined in
SnapReference.weightMethods
Collects a valid SnapResult that snaps the movedPoint to this circle.
movedPoint to this circle.A snap result is considered to be valid if the projection of the movedPoint onto this circle hits the circle (or arc) and the distance between the moved and the projected point is not bigger than the snapDistance.
If a valid SnapResult is found, it is added to the evt and returned.
Parameters
- evt: CollectSnapResultsEventArgs
- The arguments describing the movement the SnapResult shall be created for.
- movedItem: IModelItem
- The item that is currently moved.
- movedPoint: Point
- The location that shall be snapped to the circle.
- snapDistance: number
- The maximum distance the moved point may snap to the circle.
Return Value
- SnapResult
- A valid snap result on this circle or
nullif no such snap result could be found.