Skip to Content
ReferencepointList

<pointList>

A list of points

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

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.

Other (2)

number. Default value: Infinity. Maximum number of items to retain in the list.

boolean. Default value: false. Whether the order of items in this list should be treated as unordered (e.g. for matching).

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 <pointList name="p">

Number display (5)
$p.avoidScientificNotationIn development

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

$p.displayDecimalsIn development

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

$p.displayDigitsIn development

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

$p.displaySmallAsZeroIn development

number. Threshold below which numbers are displayed as zero.

$p.padZerosIn development

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

Other (6)
$p.maxNumber

number. Maximum number of items to retain in the list.

$p.numComponentsIn development

number. The number of items in the list.

$p.numDimensionsIn development

integer. The number of dimensions of the items, the largest among them.

number. The number of points in the list.

$p.numValues

number. The number of values in the list.

$p.unordered

boolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).

Common to all components (8)
$p.disabledIn development

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

$p.doenetML

text. The DoenetML source code that produced this component.

$p.fixedIn development

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

$p.fixLocationIn development

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

$p.hiddenIn development

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

$p.hide

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

$p.isResponseIn development

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

Last updated on