<point>

A point with coordinates that can be displayed and dragged on a graph

<point> is a Graphical component that renders a point on a <graph>.

Attributes and Properties

Attributes for <point>

Number display (5)
avoidScientificNotation

boolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.

displayDecimals

integer. Default value: 2. Number of decimal places to display when rendering this number.

displayDigits

integer. Default value: 3. Number of significant digits to display when rendering this number.

displaySmallAsZero

number. Default value: 1e-14. Threshold below which numbers are displayed as zero.

padZeros

boolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Labels (1)
labelIsName

boolean. Default value: false. Whether to use this component's name as its rendered label.

Other (16)
addControls

keyword. Whether to render interactive control handles.

ValueDescription
noneShow no control handles.
both (default)Show control handles for moving the point in both x and y.
xOnlyShow a control handle that constrains motion to the x direction.
yOnlyShow a control handle that constrains motion to the y direction.
applyStyleToLabel

boolean. Default value: false. Whether to apply this component's selected style to its label.

controlOrder

integer. 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.

ValueDescription
upperRight (default)Place the label above and to the right of the point.
upperLeftPlace the label above and to the left of the point.
lowerRightPlace the label below and to the right of the point.
lowerLeftPlace the label below and to the left of the point.
topPlace the label directly above the point.
bottomPlace the label directly below the point.
leftPlace the label directly to the left of the point.
rightPlace the label directly to the right of the point.
layer

integer. 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.

ValueDescription
circleCircular marker.
squareSquare marker.
triangleTriangular marker pointing up (alias for "triangleUp").
triangleUpTriangular marker pointing up.
triangleDownTriangular marker pointing down.
triangleLeftTriangular marker pointing left.
triangleRightTriangular marker pointing right.
diamondDiamond-shaped marker.
crossCross-shaped marker (×).
plusPlus-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.

z

math. The third coordinate (z) of the point.

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. 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.avoidScientificNotation

boolean. Whether to render numbers in full decimal form rather than scientific notation.

$p.displayDecimals

integer. Number of decimal places to display when rendering this number.

$p.displayDigits

integer. Number of significant digits to display when rendering this number.

$p.displaySmallAsZero

number. Threshold below which numbers are displayed as zero.

$p.padZeros

boolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Labels (2)
$p.label

label. The label rendered with this component.

$p.labelIsName

boolean. Whether to use this component's name as its rendered label.

Other (28)
$p.addControls

text. Whether to render interactive control handles.

$p.applyStyleToLabel

boolean. Whether to apply this component's selected style to its label.

$p.backgroundColor

text. 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.controlOrder

integer. Slot order for graph controls (1-indexed; 0 means no explicit slot request).

$p.coords

coords. The point's coordinates as a math expression.

$p.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$p.draggable

boolean. Whether the point can be dragged on a graph.

$p.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$p.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$p.hidden

boolean. Whether this component is hidden from the rendered output.

$p.hideOffGraphIndicator

boolean. Whether to suppress the off-graph indicator when out of view.

$p.labelPosition

text. Position of the point's label.

latex. The point rendered as a LaTeX string.

$p.layer

integer. Z-order layer index used to stack graphical components (higher values render on top).

number. Number of dimensions of the point.

$p.numDimensionsForConstraints

number. Number of dimensions exposed to constraint computations (alias for numDimensions).

$p.scales

number. The graph axis scales (x and y) used when applying this constraint.

$p.showCoordsWhenDragging

boolean. Whether to show coordinate labels while dragging.

$p.styleDescription

text. A textual description of the point's style.

$p.styleDescriptionWithNoun

text. Style description including the word "point".

$p.textColor

text. Human-readable name for this component's text color, derived from the active style and theme.

$p.textStyleDescription

text. Human-readable description of this component's text styling (color and any background color).

$p.value

coords. The point's coordinates as a single math expression.

$p.x

math. The first coordinate (x) of the point.

$p.xs

[ math ]. The point's coordinates as a list.

$p.y

math. The second coordinate (y) of the point.

$p.z

math. The third coordinate (z) of the point.

Common to all components (4)
$p.doenetML

text. The DoenetML source code that produced this component.

$p.hide

boolean. Whether to hide this component from the rendered output.

$p.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$p.styleNumber

integer. 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.