A snap line is a line segment in the world coordinate system to which other items (lines or points) snap during interactive movements.
Inheritance Hierarchy
Remarks
GraphSnapContext and LabelSnapContext make use of this class to interactively snap moving elements to snap lines.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.SnapLine
See Also
Constructors
SnapLine
(snapType: SnapLineSnapTypes, visualizationType: SnapLineVisualizationType, coordinates: Point, from: Point, to: Point, tag: Object, weight: number)Creates a new snap line using the provided attributes.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- snapType - SnapLineSnapTypes
- visualizationType - SnapLineVisualizationType
- The type of the visual representation of this snap line.
- coordinates - Point
- The coordinates of the center point of the snap line.
- from - Point
- The first location that delimits this snap line.
- to - Point
- The second location that delimits this snap line.
- tag - Object
- A tag that is associated with this snap line - see tag for a typical use of this value.
- weight - number
- The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight will be used.
Properties
Gets the coordinates of the center point of the snap line.
Gets or sets the first location that delimits this snap line.
Gets the tag that is associated with this snap line.
Remarks
The tag is most commonly used for the snap result tag.
Gets or sets the second location that delimits this snap line.
Gets the visualization type which determines the visual appearance of the snap line.
Constants
Resource key which determines the Stroke used for the snap line visualization.
Remarks
If
null
is yielded, the ThemeVariant of the current theme determines the snap line color. The CLASSIC variant uses a blue Stroke while the other variants use the secondaryColor.