ReferencevectorList

<vectorList>

A list of vectors

<vectorList> is a graphical-list component that defines a collection of <vector> components.

When creating a <vectorList>, separate items by spaces, not commas. The component will default to displaying the list with commas. (The commas inside each vector’s (x, y) component tuple are part of the vector itself, not separators between vectors.)

Attributes and Properties

Attributes for <vectorList>

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 vectors 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 vectors 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 <vectorList name="v">

Other (4)
$v.maxNumber

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

$v.numValues

number. The number of vectors in the list.

number. The number of vectors in the list.

$v.unordered

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

Common to all components (3)
$v.doenetML

text. The DoenetML source code that produced this component.

$v.hide

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

$v.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: Defining a <vectorList> and accessing an item

Each vector is written as (x, y). Spaces between the parenthesized tuples separate the vectors; the comma between x and y is part of a single vector. Individual vectors are addressable with array notation.


Example: A <vectorList> on a graph

When placed inside a <graph>, a <vectorList> renders each of its vectors from the origin. Drag a vector head to update its components.


Example: 3-component vectors

Vectors may have any number of components; all vectors in the list are rendered with the same dimension (the maximum across the list).

Attribute Examples

Attribute Example: unordered

The unordered attribute makes comparisons (e.g., inside a <boolean> or an <award>) ignore the order of vectors.


Attribute Example: maxNumber

The maxNumber attribute imposes a limit on the number of vectors retained in the list, regardless of how many are supplied.


Attribute Example: asList

By default a <vectorList> renders its items joined by commas. Setting asList="false" removes the separator so the items render concatenated.

Property Examples

Property Example: numVectors

The numVectors property returns the number of vectors in the list. The alias numValues returns the same value.