<attractTo>
<attractTo> is a Graphical component that
is used within a <point> to attract it to a specified reference component.
Attributes and Properties
Attributes for <attractTo>
Other (2)
relativeToGraphScalesboolean. Default value: false. Whether the attraction threshold is interpreted relative to the enclosing graph's scales rather than absolute coordinates.
number. Distance within which the position attracts to a target.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <attractTo name="a">
Other (6)
$a.disabledboolean. Whether this component is disabled and cannot be interacted with.
$a.fixedboolean. Whether this component's value is fixed and cannot be modified.
$a.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$a.relativeToGraphScalesboolean. Whether the attraction threshold is interpreted relative to the enclosing graph's scales rather than absolute coordinates.
$a.thresholdnumber. Distance within which the position attracts to a target.
Common to all components (4)
$a.doenetMLtext. The DoenetML source code that produced this component.
$a.hideboolean. Whether to hide this component from the rendered output.
$a.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$a.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Attract a <point> to a <circle>
A <point> is attracted to a named <circle> with a default threshold of attraction of
of the graph axes.
Example: Attract a <point> to an <intersection>
A <point> is attracted to a named <intersection> with a default threshold of attraction of
of the graph axes.
Example: Attract a <point> to a <function> maximum
A <point> is attracted to a named <function> and a named <point> at the
function’s maximum with a default threshold of attraction of
of the graph axes.
Attribute Examples
Attribute Example: threshold
The threshold attribute allows customization of the the threshold of attraction.
Property Examples
Property Example: threshold
The threshold property renders the threshold value of the named <attractTo>.