<function>
Attribute Examples Part 2
The following examples illustrate use of the <function> tag attributes.
Attributes
| Attribute | Type | Values |
|---|---|---|
applyStyleToLabel = "…" | boolean | "true" "false" |
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
domain = "…" | [ interval ] | |
expand = "…" | text | "true" "false" |
extrema = "…" | [ number ] | |
labelIsName = "…" | boolean | "true" "false" |
labelPosition = "…" | text | "upperright" "upperleft" "lowerright" "lowerleft" "top" "bottom" "left" "right" |
layer = "…" | number | |
maxima = "…" | [ number ] | |
minima = "…" | [ number ] | |
nearestPointAsCurve = "…" | "true" "false" | |
numInputs = "…" | integer | |
numOutputs = "…" | integer | |
padZeros = "…" | boolean | "true" "false" |
simplify = "…" | text | "none" "full" "numbers" "numberspreserveorder" |
symbolic = "…" | boolean | "true" "false" |
through = "…" | ||
throughSlopes = "…" | ||
variable = "…" | _variableName | |
variables = "…" | [ _variableName ] | |
xscale = "…" | number | |
yscale = "…" | number |
Attribute Example: maxima
One way to specify required features of an interpolated function is set the maxima to a
list of points that should be maxima of the function.
The maxima points can have an empty - or -coordinate, in which case
the missing values will be determined algorithmically.
The attributes xscale and yscale will be used to determine aspects of the
maxima that aren’t specified as well as the shape of the function.
If additional features (minima, extrema, through) of the function are specified,
the function may have additional maxima that were not given by the maxima attribute.
Attribute Example: extrema
One way to specify required features of an interpolated function is set the extrema to a
list of points that should be extrema of the function.
The extrema points can have an empty - or -coordinate, in which case the
missing values will be determined algorithmically.
The attributes xscale and yscale will be used to determine aspects of the
extrema that aren’t specified as well as the shape of the function.
If additional features (minima, maxima, through) of the function are specified,
the function may have additional extrema that were not given by the extrema attribute.
Attribute Example: through
One way to specify required features of an interpolated function is set the through attribute
to a list of points that the function should pass through.
To specify the slope of the function at the through points, use the throughSlopes attribute.
Attribute Example: throughSlopes
When the through attribute specifies a list of points that the function should pass
through, the throughPoints can specify the slope of the function at those points.
Attribute Example: xscale
The xscale is used to determine the range of -values over which to look for function extrema.
The xscale attribute also influences the position of extrema when they are specified without an -component.
Attribute Example: yscale
The yscale attribute influences the position of extrema when they are specified without an -component.
Attribute Example: labelIsName
The labelIsName attribute will label the graph of function by its name.
To add a custom name instead, add a <label> child to the <function>.
Disclaimer: Sometimes the auto-generated location of labels is inconvenient with
the <function> component. If this happens, one alternative is to
use a separate <label> component on the
graph and give it an exact location using the anchor attribute. (See the <label>
component for some examples of this.)
Attribute Example: applyStyleToLabel
If the applyStyleToLabel attribute is set, then the lineColor from the
selected style is applied to the label text.
Attribute Example: labelPosition
The labelPosition attribute changes the location of the label relative to the graph of the function. Valid options are:
- upperRight (the default)
- upperLeft
- lowerRight
- lowerLeft
- top
- bottom
- left
- right
Disclaimer: Sometimes the auto-generated location of labels (even with the labelPosition attribute)
is inconvenient with the <function> component. If this happens, one alternative is to
use a separate <label> component on the
graph and give it an exact location using the anchor attribute. (See the <label>
component for some examples of this.)
Attribute Example: layer
To make sure an object appears on top of another object in graph, one can use the layer attribute
to put the object in a higher layer.
Objects default to be in layer 0. Layers 0-9 are supported.