<attractToGrid/>
<attractToGrid> is a Graphical component that
is used to within a <point> to attract it to a specified grid. This component must be
nested within a <constraints> block.
Attributes and Properties
| Attribute | Type | Values |
|---|---|---|
dx = "…" | number | |
dy = "…" | number | |
dz = "…" | number | |
includeGridlines = "…" | boolean | "true" "false" |
xoffset = "…" | number | |
xthreshold = "…" | number | |
yoffset = "…" | number | |
ythreshold = "…" | number | |
zoffset = "…" | number | |
zthreshold = "…" | number |
| Property | Type |
|---|---|
$a.disabled | boolean |
$a.dx | number |
$a.dy | number |
$a.dz | number |
$a.fixed | boolean |
$a.fixLocation | boolean |
$a.hidden | boolean |
$a.includeGridlines | boolean |
$a.xoffset | number |
$a.xthreshold | number |
$a.yoffset | number |
$a.ythreshold | number |
$a.zoffset | number |
$a.zthreshold | number |
Example: Attract <point> to a grid, default behavior
The default grid spacing for attraction for a <point> with
the <attractToGrid> constraint is 1.
Attribute Example: dx, dy
The dx and dy attributes allow for customization of the attraction grid.
Note that it is not required to display the grid in the graph; this is done for illustration.
Attribute Example: xOffset, yOffset
With the xOffset and yOffset attributes, the spacing of attraction gridlines can be adjusted to a
specific offset of the specified dx and dy.
The grey points are included as an illustration of where the offset attraction grids occur.
Attribute Example: xThreshold, yThreshold
The xThreshold and yThreshold attributes can be used to control how close the <point> must be to
a grid for attraction to take effect. Notice the different behavior above when dragging the point
close to the gridlines and gridlines.
Property Example: Attributes as properties
The attributes of <attractToGrid/> shown in the example above are also available as properties.