ReferencepointList

<pointList>

A list of points

<pointList> is a graphical-list component that defines a collection of <point> components.

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>

Other (8)

boolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).

avoidScientificNotation

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

displayDecimals

Number of decimal places to display when rendering this number.

displayDigits

Number of significant digits to display when rendering this number.

displaySmallAsZero

Threshold below which numbers are displayed as zero.

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

padZeros

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

boolean. Default value: false. Whether the order of points 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

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

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">

Other (4)
$p.maxNumber

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

number. The number of points in the list.

$p.numValues

number. The number of points 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 (3)
$p.doenetML

text. The DoenetML source code that produced this component.

$p.hide

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

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

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.