<annotation>
<annotation> describes a single graph element for screen-reader
navigation when a <graph> is rendered through the
Prefigure backend. Each <annotation> attaches
to a referenced component (with the ref attribute) and supplies the spoken
text that assistive technology will read when the user navigates to that
element.
Annotations must be placed inside an <annotations> child
of a <graph>. Only the first (root) <annotation> child is used,
and it should, in general, describe the entire graph. Any additional
<annotation> components that sit inside the <annotations> but
are not nested inside the first <annotation> are ignored.
To annotate individual components of the graph, nest additional
<annotation> components inside the root <annotation>. If an
<annotation> references a component in the graph via the ref
attribute, it annotates that one component. Alternatively, if an
<annotation> contains multiple <annotation> children, it
annotates the entire group of components as a unit (e.g. a cluster of points
whose individual points are sub-annotations).
Attributes and Properties
Attributes for <annotation>
Other (5)
boolean. Default value: false. Whether navigation through this annotation's children wraps around.
refreference. Reference to the component this annotation is attached to.
boolean. Default value: false. Whether to play a tone when this annotation is focused and it references a function.
text. More detailed spoken text used by screen readers; used if expert mode is activated or extra details are requested.
texttext. The annotation text read by screen readers.
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 <annotation name="a">
Other (8)
$a.circularboolean. Whether navigation through this annotation's children wraps around.
$a.disabledboolean. Whether this component is disabled and cannot be interacted with.
$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.sonifyboolean. Whether to play a tone when this annotation is focused and it references a function.
$a.speechtext. More detailed spoken text used by screen readers; used if expert mode is activated or extra details are requested.
$a.texttext. The annotation text read by screen readers.
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: Label a single point
The <annotation> references the named point with ref="$P" and
supplies the text screen readers announce when the user navigates to that
point. References inside the text value (here $P.x and $P.y) are
substituted in, so the announcement updates as the point moves.
Example: Nested annotations for a group of points
Nesting <annotation> elements groups related graph elements together
under a parent annotation, allowing screen-reader users to navigate from the
group description down to individual members.
Attribute Examples
Attribute Example: speech
When speech is set, screen readers read out the text attribute by default
and read out the extra speech details when the user presses W.
Alternatively, when the user turns on expert mode by pressing X, the screen
reader reads out the speech attribute (if set) in place of text.
Attribute Example: sonify
Setting sonify to true on an <annotation> that references a
function lets the user press O to sound out the shape of the function.
Attribute Example: circular
When circular is set on a parent <annotation>, navigating past the
last child wraps back to the first child. Useful for describing closed
shapes (cycles, polygons) where there is no natural “end”.