<vectorList>
<vectorList> is a graphical-list component that holds a collection
of vectors. Each vector is drawn as a <vector> is, and can
be dragged on its own.
A vector written as (x, y) in the listβs text is its displacement, with
its tail at the origin until its tail, or the whole vector, is dragged. A <vector> among its
children, or a reference such as $v, is one of its vectors too, with its
own tail and head, label and style. Taken on its own, as $vs[1] in a
graph, such a vector keeps its label, and is fixed, undraggable (as a
whole, by its head or by its tail) or has fixLocation when that vector
does. It is also fixed in a fixed graph.
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>
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 <vectorList name="v">
Number display (5)
$v.avoidScientificNotationIn developmentboolean. Whether to render numbers in full decimal form rather than scientific notation.
$v.displayDecimalsIn developmentinteger. Number of decimal places to display when rendering this number.
$v.displayDigitsIn developmentinteger. Number of significant digits to display when rendering this number.
$v.displaySmallAsZeroIn developmentnumber. Threshold below which numbers are displayed as zero.
$v.padZerosIn developmentboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Other (6)
$v.maxNumbernumber. Maximum number of items to retain in the list.
$v.numComponentsIn developmentnumber. The number of items in the list.
$v.numDimensionsIn developmentinteger. The number of dimensions of the items, the largest among them.
$v.numValuesnumber. The number of values in the list.
$v.numVectorsnumber. The number of vectors in the list.
$v.unorderedboolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).
Common to all components (8)
$v.disabledIn developmentboolean. Whether this component is disabled and cannot be interacted with.
$v.doenetMLtext. The DoenetML source code that produced this component.
$v.fixedIn developmentboolean. Whether this component's value is fixed and cannot be modified.
$v.fixLocationIn developmentboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$v.hideboolean. Whether to hide this component from the rendered output.
$v.isResponseIn developmentboolean. Whether this component is treated as a response for the purposes of assessment.
$v.styleNumberinteger. 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; a vector written as text, as here, starts at the origin. Drag
a vectorβs head to change its components, its tail to move the tail and
keep the head, or the vector itself to move it.
Example: 3-component vectors
Vectors may have any number of components; all vectors in the list have the same number (the most any of them has), and a vector with fewer has 0 in the components it lacks.
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.