<argMax>
<argMax> is a General Operator
component that renders the index of the largest of its arguments rather than the value
itself, so the position can be used to look up the matching entry of a different list —
which is what makes it more useful than <max> alone. Indices start at 1, ties
resolve to the first occurrence, and an empty list gives 0.
Attributes and Properties
Attributes for <argMax>
Highlighted (1)
typekeyword. Component type to interpret bare string children as. Omit it and they are read as what they look like: every piece naming a number makes the list numeric, anything else makes it text.
| Value | Description |
|---|---|
number | Read bare strings as numbers, ordered by value. |
math | Read bare strings as math expressions, ordered by value. |
text | Read bare strings as text, ordered alphabetically. |
boolean | Read bare strings as booleans, ordered with false before true. |
Number display (5)
avoidScientificNotationboolean. 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.
Positioning (2)
anchorpoint. Default value: . Coordinates of the anchor point used to position this component on a graph.
positionFromAnchorkeyword. Where this component sits relative to its anchor point.
| Value | Description |
|---|---|
upperRight | Place the component above and to the right of the anchor point. |
upperLeft | Place the component above and to the left of the anchor point. |
lowerRight | Place the component below and to the right of the anchor point. |
lowerLeft | Place the component below and to the left of the anchor point. |
top | Place the component directly above the anchor point. |
bottom | Place the component directly below the anchor point. |
left | Place the component directly to the left of the anchor point. |
right | Place the component directly to the right of the anchor point. |
center (default) | Center the component on the anchor point. |
Other (15)
assumptionsmath. Default value: . Assumptions applied when simplifying or comparing.
createIntervalsboolean. Default value: false. Whether range expressions are interpreted as intervals.
createVectorsboolean. Default value: false. Whether tuple-like expressions are interpreted as vectors.
displayBlanksboolean. Default value: true. Whether blanks (placeholders) are visibly rendered.
draggableboolean. Default value: true. Whether the math component can be dragged on a graph.
expandboolean. Default value: false. Whether to expand the expression.
formatkeyword. Input format.
| Value | Description |
|---|---|
text (default) | Plain-text math notation (e.g., x^2 + 1). |
latex | LaTeX-formatted math (e.g., x^{2} + 1). |
functionSymbolstextList. Default value: ["f","g"]. Symbols treated as function names when parsing.
layernumber. Default value: 0. Z-order layer index when shown on a graph.
parseScientificNotationboolean. Default value: false. Whether to parse expressions like 1e3 as scientific notation.
referencesAreFunctionSymbolsreference. References whose names should be treated as function symbols when parsing.
renderModekeyword. How the math is rendered.
| Value | Description |
|---|---|
inline (default) | Render inline with the surrounding text. |
display | Render as a centered equation on its own line. |
simplifykeyword. Level of simplification applied to the expression.
| Value | Description |
|---|---|
none (default) | No simplification is applied. |
full | Fully simplify the expression. |
numbers | Simplify numeric subexpressions only, leaving symbolic structure intact. |
numbersPreserveOrder | Like numbers, but does not reorder commutative operands. |
normalizeOrder | Reorder commutative operands into a canonical form without simplifying values. |
splitSymbolsboolean. Default value: true. Whether multi-character symbols are split into a product of variables.
unorderedboolean. Whether tuple- or list-like math expressions should be treated as unordered for comparison.
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 <argMax name="a">
Highlighted (1)
$a.valueargMax. The 1-based index the operator found, or 0 if there is none.
Number display (5)
$a.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$a.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$a.displayDigitsinteger. Number of significant digits to display when rendering this number.
$a.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$a.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Positioning (2)
$a.anchorpoint. The coordinates where this component is anchored on the graph.
$a.positionFromAnchortext. Where this component sits relative to its anchor point.
Other (38)
$a.assumptionsmath. Assumptions applied when simplifying or comparing.
$a.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$a.columns[ math ]. The matrix's entries grouped by column.
$a.createIntervalsboolean. Whether range expressions are interpreted as intervals.
$a.createVectorsboolean. Whether tuple-like expressions are interpreted as vectors.
$a.disabledboolean. Whether this component is disabled and cannot be interacted with.
$a.displayBlanksboolean. Whether blanks (placeholders) are visibly rendered.
$a.draggableboolean. Whether the math component can be dragged on a graph.
$a.expandboolean. Whether to expand the expression.
$a.fixedboolean. Whether this component's value is fixed and cannot be modified.
$a.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$a.formattext. Input format.
$a.functionSymbolstextList. Symbols treated as function names when parsing.
$a.isNumberboolean. Whether the expression evaluates to a finite number.
$a.isNumericboolean. Whether the expression evaluates to any number (including infinities).
$a.latexlatex. The expression rendered as a LaTeX string.
$a.layernumber. Z-order layer index when shown on a graph.
$a.list[ math ]. The math expression interpreted as a list (its elements).
$a.matrix[ math ]. The math expression interpreted as a matrix (its entries by row and column).
$a.matrixSizenumberList. The size of the math expression as a matrix, as a [numRows, numColumns] list.
$a.numbernumber. The numeric value of the expression (NaN if not a number).
$a.numColumnsinteger. The number of columns when the math expression is interpreted as a matrix.
$a.numDimensionsinteger. The number of dimensions if the math expression is interpreted as a vector or matrix.
$a.numListItemsinteger. The number of items when the math expression is interpreted as a list.
$a.numRowsinteger. The number of rows when the math expression is interpreted as a matrix.
$a.parseScientificNotationboolean. Whether to parse expressions like 1e3 as scientific notation.
$a.renderModetext. How the math is rendered.
$a.rows[ math ]. The matrix's entries grouped by row.
$a.simplifytext. Level of simplification applied to the expression.
$a.splitSymbolsboolean. Whether multi-character symbols are split into a product of variables.
$a.texttext. The expression rendered as a plain text string.
$a.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$a.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
$a.vector[ math ]. The math expression interpreted as a vector (its components).
$a.xmath. The first component of the math expression when interpreted as a vector.
$a.ymath. The second component of the math expression when interpreted as a vector.
$a.zmath. The third component of the math expression when interpreted as a vector.
Common to all components (4)
$a.doenetMLtext. The DoenetML source code that produced this component.
$a.hideboolean. Whether to hide this component from the rendered output.
$a.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$a.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: the position of the largest value
Example: who scored highest
The index from <argMax> indexes into the parallel list of names.
Example: responding to user input
The index updates as the values change.
Example: alphabetically last
On text, “largest” means alphabetically last.