<function>
The following examples illustrate use of the <function> tag properties.
Properties
Properties for <function name="f">
Number display (5)
$f.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$f.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$f.displayDigitsinteger. Number of significant digits to display when rendering this number.
$f.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$f.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (2)
$f.labellabel. The label rendered with this component.
$f.labelIsNameboolean. Whether to use this component's name as its rendered label.
Other (42)
$f.applyStyleToLabelboolean. Whether to apply the function's style to its label.
$f.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$f.disabledboolean. Whether this component is disabled and cannot be interacted with.
$f.domain[ interval ]. Domain interval(s) of the function.
$f.expandtext. Whether to expand the formula.
$f.expandSpecifiedboolean. Whether to expand the function's formula.
$f.extrema[ number ]. Local extrema (minima + maxima) of the function.
[ number ]. The x-coordinates of the function's local extrema.
[ number ]. The values of the function's local extrema.
$f.fixedboolean. Whether this component's value is fixed and cannot be modified.
$f.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$f.formulamath. The symbolic formula of the function.
$f.globalInfimum[ number ]. The global infimum of the function.
$f.globalMaximum[ number ]. The global maximum of the function (if attained).
$f.globalMinimum[ number ]. The global minimum of the function (if attained).
$f.globalSupremum[ number ]. The global supremum of the function.
$f.labelPositiontext. Position of the function's label.
$f.latexlatex. The function rendered as a LaTeX string.
$f.layernumber. Z-order layer index for stacking the function on a graph.
$f.maxima[ number ]. Local maxima of the function.
[ number ]. The x-coordinates of the function's local maxima.
[ number ]. The values of the function's local maxima.
$f.minima[ number ]. Local minima of the function.
[ number ]. The x-coordinates of the function's local minima.
[ number ]. The values of the function's local minima.
$f.numExtremanumber. Number of local extrema (minima + maxima) of the function.
$f.numInputsinteger. Number of input variables of the function.
$f.numMaximanumber. Number of local maxima of the function.
$f.numMinimanumber. Number of local minima of the function.
$f.numOutputsinteger. Number of output values of the function.
$f.simplifytext. Level of simplification applied when displaying the formula.
text. A textual description of the function's style.
text. Style description including the word "function".
$f.symbolicboolean. Whether the function is treated symbolically.
$f.texttext. The function rendered as a plain text string.
$f.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$f.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
$f.variable_variableName. The function's first input variable name.
$f.variables[ _variableName ]. The names of the function's input variables.
$f.xscalenumber. Scale factor used along the x-axis.
$f.yscalenumber. Scale factor used along the y-axis.
Common to all components (4)
$f.doenetMLtext. The DoenetML source code that produced this component.
$f.hideboolean. Whether to hide this component from the rendered output.
$f.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$f.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Property Examples
Property Example: Attributes as properties
The <function> attributes listed above are also accessible as properties.
Property Example: numOutputs
The numOutputs property of a function is the dimension of its range.
Property Example: formula
If a function is defined by a formula, the formula property gives that formula.
If the expand or simplify attributes are used, these are applied only during evaluation
, so they do not effect the formula property.
To simplify or expand the formula property of a function, you should
nest it inside a <math> with the appropriate attributes.
The formula property isn’t currently implemented for interpolated functions.
Property Example: latex
The latex property gives the LaTeX of the function’s formula.
Property Example: numMinima
The property numMinima gives the number of minima calculated for a function of a single variable. By default, it looks for minima in the interval . This interval can be changed with the xscale attribute.
Property Example: minima/minimumLocations/minimumValues
The property minima gives the minima of a function of a single variable
as an array of points. The property minimumLocations gives the values of the
independent variable where the minima occur. The property minimumValues
gives the values of the function at the minima.
By default, minima are calculated in the interval .
This interval can be changed with the xscale attribute.
Property Example: numMaxima
The property numMaxima gives the number of maxima calculated for a
function of a single variable. By default, it looks for maxima in the interval .
This interval can be changed with the xscale attribute.
Property Example: maxima/maximumLocations/maximumValues
The property maxima gives the maxima of a function of a single variable as
an array of points. The property maximumLocations gives the values of the
independent variable where the maxima occur. The property maximumValues gives
the values of the function at the maxima.
By default, maxima are calculated in the interval . This interval
can be changed with the xscale attribute.
Property Example: numExtrema
The property numExtrema gives the number of extrema calculated for a
function of a single variable. By default, it looks for maxima in the interval .
This interval can be changed with the xscale attribute.
Property Example: extrema/extremumLocations/extremumValues
The property extrema gives the extrema of a function of a single variable as
an array of points. The property extremumLocations gives the values of the
independent variable where the extrema occur. The property extremumValues gives
the values of the function at the extrema.
By default, extrema are calculated in the interval . This
interval can be changed with the xscale attribute.
Property Example: styleDescription/styleDescriptionWithNoun
Since users can override styles and so may see different colors and line styles,
don’t directly refer to the colors and line styles you create. Instead, use the
properties styleDescription and styleDescriptionWithNoun. With those properties,
the text will change to match the displayed styles.