<pointList>
<pointList> is a graphical-list component that holds a collection
of points. Each point is drawn as a <point> is, and can be
dragged on its own.
A point written as (x, y) in the listโs text is held by the list. A
<point> among its children, or a reference such as $P, is one of
its points too, drawn with that pointโs label and style. Taken on its own,
as $pts[1] in a graph, such a point keeps its label, and is fixed,
undraggable or has fixLocation when that point does. It is also fixed in
a fixed graph. All the points
have the same number of coordinates, the most any of them has: a point
with fewer has 0 in the coordinates it lacks.
When creating a <pointList>, separate items by spaces, not commas.
The component will default to displaying the list with commas. (The commas
inside each pointโs (x, y) coordinate tuple are part of the point itself, not
separators between points.)
Attributes and Properties
Attributes for <pointList>
Highlighted (1)
boolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).
Number display (5)
avoidScientificNotationAdded in 0.7.16boolean. 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.
Other (2)
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 <pointList name="p">
Number display (5)
$p.avoidScientificNotationIn developmentboolean. Whether to render numbers in full decimal form rather than scientific notation.
$p.displayDecimalsIn developmentinteger. Number of decimal places to display when rendering this number.
$p.displayDigitsIn developmentinteger. Number of significant digits to display when rendering this number.
$p.displaySmallAsZeroIn developmentnumber. Threshold below which numbers are displayed as zero.
$p.padZerosIn developmentboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Other (6)
$p.maxNumbernumber. Maximum number of items to retain in the list.
$p.numComponentsIn developmentnumber. The number of items in the list.
$p.numDimensionsIn developmentinteger. The number of dimensions of the items, the largest among them.
$p.numPointsnumber. The number of points in the list.
$p.numValuesnumber. The number of values in the list.
$p.unorderedboolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).
Common to all components (8)
$p.disabledIn developmentboolean. Whether this component is disabled and cannot be interacted with.
$p.doenetMLtext. The DoenetML source code that produced this component.
$p.fixedIn developmentboolean. Whether this component's value is fixed and cannot be modified.
$p.fixLocationIn developmentboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$p.hideboolean. Whether to hide this component from the rendered output.
$p.isResponseIn developmentboolean. 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: Defining a <pointList> and accessing an item
Each point is written as (x, y). Spaces between the parenthesized tuples
separate the points; the comma between x and y is part of a single
pointโs coordinates. Individual points are addressable with array notation.
Example: A <pointList> on a graph
When placed inside a <graph>, a <pointList> renders each of
its points on the graph. Drag any point to update its coordinates.
Example: Feeding a <pointList> to another component
Components that accept multiple points as an attribute (such as
<line>โs through) accept a <pointList> directly.
Example: Constraining every point
A constraint among the children of a <pointList>, such as
<constrainToGrid> or <attractTo>, applies to every point in
the list, as it would to a <point> it is a child of. Drag any point
to see it snap to the grid.
Attribute Examples
Attribute Example: unordered
The unordered attribute makes comparisons (e.g., inside a <boolean>
or an <award>) ignore the order of points.
Attribute Example: maxNumber
The maxNumber attribute imposes a limit on the number of points retained
in the list, regardless of how many are supplied.
Attribute Example: asList
By default a <pointList> renders its items joined by commas. Setting
asList="false" removes the separator so the items render concatenated.
Property Examples
Property Example: numPoints
The numPoints property returns the number of points in the list.
The alias numValues returns the same value.