<point>
<point> is a Graphical
component that renders a point on a <graph>.
Attributes and Properties
Attributes for <point>
Number display (5)
avoidScientificNotationboolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.
displayDecimalsinteger. Default value: 2. Number of decimal places to display when rendering this number.
displayDigitsinteger. Default value: 3. Number of significant digits to display when rendering this number.
displaySmallAsZeronumber. Default value: 1e-14. Threshold below which numbers are displayed as zero.
padZerosboolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (1)
labelIsNameboolean. Default value: false. Whether to use this component's name as its rendered label.
Other (16)
addControlskeyword. Whether to render interactive control handles.
| Value | Description |
|---|---|
none | Show no control handles. |
both (default) | Show control handles for moving the point in both x and y. |
xOnly | Show a control handle that constrains motion to the x direction. |
yOnly | Show a control handle that constrains motion to the y direction. |
applyStyleToLabelboolean. Default value: false. Whether to apply this component's selected style to its label.
controlOrderinteger. Default value: 0. Slot order for graph controls (1-indexed; 0 means no explicit slot request).
coords. The point's coordinates as a single math expression.
boolean. Default value: true. Whether the point can be dragged on a graph.
boolean. Whether to suppress the indicator drawn at the edge when the point is off-screen.
keyword. Position of the point's label.
| Value | Description |
|---|---|
upperRight (default) | Place the label above and to the right of the point. |
upperLeft | Place the label above and to the left of the point. |
lowerRight | Place the label below and to the right of the point. |
lowerLeft | Place the label below and to the left of the point. |
top | Place the label directly above the point. |
bottom | Place the label directly below the point. |
left | Place the label directly to the left of the point. |
right | Place the label directly to the right of the point. |
layerinteger. Default value: 0. Z-order layer index used to stack graphical components (higher values render on top).
boolean. Whether the marker is rendered filled (true) or open (false). Has no effect when markerStyle is cross or plus, which have no interior.
number. Marker size in pixels.
keyword. Marker shape.
| Value | Description |
|---|---|
circle | Circular marker. |
square | Square marker. |
triangle | Triangular marker pointing up (alias for "triangleUp"). |
triangleUp | Triangular marker pointing up. |
triangleDown | Triangular marker pointing down. |
triangleLeft | Triangular marker pointing left. |
triangleRight | Triangular marker pointing right. |
diamond | Diamond-shaped marker. |
cross | Cross-shaped marker (×). |
plus | Plus-shaped marker (+). |
boolean. Default value: true. Whether to show coordinate labels while dragging.
math. The first coordinate (x) of the point.
[ mathList ]. The point's coordinates as a list.
math. The second coordinate (y) of the point.
zmath. The third coordinate (z) of the point.
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 <point name="p">
Number display (5)
$p.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$p.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$p.displayDigitsinteger. Number of significant digits to display when rendering this number.
$p.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$p.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (2)
$p.labellabel. The label rendered with this component.
$p.labelIsNameboolean. Whether to use this component's name as its rendered label.
Other (28)
$p.addControlstext. Whether to render interactive control handles.
$p.applyStyleToLabelboolean. Whether to apply this component's selected style to its label.
$p.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
boolean. Whether this constraint was applied to the component.
$p.controlOrderinteger. Slot order for graph controls (1-indexed; 0 means no explicit slot request).
$p.coordscoords. The point's coordinates as a math expression.
$p.disabledboolean. Whether this component is disabled and cannot be interacted with.
$p.draggableboolean. Whether the point can be dragged on a graph.
$p.fixedboolean. Whether this component's value is fixed and cannot be modified.
$p.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$p.hideOffGraphIndicatorboolean. Whether to suppress the off-graph indicator when out of view.
$p.labelPositiontext. Position of the point's label.
$p.latexlatex. The point rendered as a LaTeX string.
$p.layerinteger. Z-order layer index used to stack graphical components (higher values render on top).
number. Number of dimensions of the point.
$p.numDimensionsForConstraintsnumber. Number of dimensions exposed to constraint computations (alias for numDimensions).
$p.scalesnumber. The graph axis scales (x and y) used when applying this constraint.
$p.showCoordsWhenDraggingboolean. Whether to show coordinate labels while dragging.
$p.styleDescriptiontext. A textual description of the point's style.
$p.styleDescriptionWithNountext. Style description including the word "point".
$p.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$p.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
$p.valuecoords. The point's coordinates as a single math expression.
$p.xmath. The first coordinate (x) of the point.
$p.xs[ math ]. The point's coordinates as a list.
$p.ymath. The second coordinate (y) of the point.
$p.zmath. The third coordinate (z) of the point.
Common to all components (4)
$p.doenetMLtext. The DoenetML source code that produced this component.
$p.hideboolean. Whether to hide this component from the rendered output.
$p.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$p.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Default <point>
Here a default <point> is illustrated without any additional attributes.
Example: <point> with nested coordinates
The initial coordinates of a <point> may be specified between opening and closing tags.
Example: <point> location specified with attributes
Three different ways to specify the coordinates of a <point> using its attributes are illustrated.
Example: A labeled <point>
Point labels can be created either with the shortcut attribute labelIsName or by
giving the <point> a <label> child.
Example: Points of different styles
Points with standard styleNumbers one through six are illustrated. If unspecified,
styleNumber = 1 is the default value.
Example: <point> constrained to a grid
Points can take constraints as children. Several different types of constraints are possible; in this example, the <constrainToGrid/> and <attractToGrid/> constraints are illustrated.
Example: <point> constrained to a <line>
Points can take constraints as children. Several different types of constraints are possible. In this case, the <constrainTo> constraint references a named <line>.
Example: An animated <point>
A <point> is animated by paraterizing its coordinates with respect to the <number> t. The parameter is animated using the <animateFromSequence/> component.
Example: Points that break the universe
Although point C depends on point B which depends on point A which, in turn, depends on point C, Doenet can determine that there is actually no circular dependency in their relationship.
This example also illustrates how one can change a point either by dragging it or by changing a <mathInput/> that is bound to one of its coordinates.
Attribute Examples
Attribute Example: draggable
The draggable attribute determines whether the <point> can be dragged around the <graph>. All graphical objects are draggable by default.
Attribute Example: x, y
The x and y attributes are used to specify isolated <point> coordinates.
Attribute Example: coords
The coords attribute specifies the <point> coordinates.
Attribute Example: xs
The xs attribute specifies the point’s location as a list of displacements.
Attribute Example: labelPosition
The labelPosition attribute specifies the location of the point’s label. Valid values are upperleft, upperright, top, left, right, lowerleft, bottom, lowerright. The default value is upperright.
Attribute Example: showCoordsWhenDragging
By default, a light-grey set of coordinates is shown while the user drags the point. To turn off this default behavior, set the showCoordsWhenDragging attribute to false.
Attribute Example: hideOffGraphIndicator
By default, when a <point> is dragged outside the extents of the <graph>, or when a point is located outside the extents, an triangle-shaped indicator appears at the edge of the <graph>. The user can either click this indicator to bring the <point> back to the position of the cursor, or zoom out until the <point> is visible again.
In this example, only one indicator appears initially, since point A has the hideOffGraphIndicator attribute specified. The student would not be aware that point A exists, until zooming out sufficiently far on the graph.
Attribute Example: markerStyle
The markerStyle attribute sets the shape of the marker drawn at the point. Valid values are circle, square, triangle (an alias for triangleUp), triangleUp, triangleDown, triangleLeft, triangleRight, diamond, cross, and plus. The default value is circle.
Attribute Example: markerSize
The markerSize attribute sets the size of the marker in pixels. The default value is 5.
Attribute Example: markerFilled
The markerFilled attribute determines whether the marker is drawn solid (true) or as an open outline (false). The default value is true. It has no effect when markerStyle is cross or plus, which have no interior.
Attribute Example: Standard graphical attributes
The uses of the following standard graphical attributes are illustrated: hide, layer, styleNumber, applyStyleToLabel and labelIsName.
Property Examples
Property Example: Attributes as properties
The above listed <point> attributes are also accessible as properties.
Property Example: numDimensions
The numDimensions property renders the number of dimensions required to define the point.
Property Example: latex
The latex property renders the latex code associated with rendering the coordinates of the <point>.
Property Example: constraintUsed
The constraintUsed property renders the boolean value corresponding to whether the current location of the <point> is utilizing the specified constraint - in this case, an <attractToGrid/> constraint.