<image/>
<image/> is a Sectional
component that renders an image from a hyperlink or an uploaded file.
Attributes and Properties
Attributes for <image>
Positioning (2)
point. 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 (12)
asFileNametext. File name to use when downloading the image.
number. Aspect ratio (width / height) for the image.
boolean. Default value: false. Whether the image is purely decorative.
keyword. How to size the image.
| Value | Description |
|---|---|
block (default) | Display as a block element on its own line. |
inline | Render inline with surrounding text. |
boolean. Default value: true. Whether the image can be dragged on a graph.
keyword. Horizontal alignment of the image within its container.
| Value | Description |
|---|---|
center (default) | Center the image horizontally. |
left | Align the image to the left edge. |
right | Align the image to the right edge. |
number. Default value: 0. Z-order layer index when shown on a graph.
mimeTypetext. MIME type of the image.
number. Default value: 0. Rotation angle (radians) applied to the image.
keyword. Named size preset for the image.
| Value | Description |
|---|---|
tiny | About 1/12 the full width. |
small | About 30% of the full width. |
medium (default) | About half the full width. |
large | About 70% of the full width. |
full | The full available width. |
text. URL or path of the image source.
componentSize. Explicit width of the image (overrides size).
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 <image name="i">
Positioning (2)
$i.anchorpoint. The coordinates where this component is anchored on the graph.
$i.positionFromAnchortext. Where this component sits relative to its anchor point.
Other (17)
$i.asFileNametext. File name to use when downloading the image.
$i.aspectRationumber. The aspect ratio (width / height) of the image.
$i.decorativeboolean. Whether the image is purely decorative.
$i.disabledboolean. Whether this component is disabled and cannot be interacted with.
$i.displayModetext. How to size the image.
$i.draggableboolean. Whether the image can be dragged on a graph.
$i.fixedboolean. Whether this component's value is fixed and cannot be modified.
$i.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$i.horizontalAligntext. Horizontal alignment of the image within its container.
$i.layernumber. Z-order layer index when shown on a graph.
$i.mimeTypetext. MIME type of the image.
$i.rotatenumber. Rotation angle (radians) applied to the image.
$i.shortDescriptiontext. A short accessibility description of the image.
$i.sizetext. The size of the image.
$i.sourcetext. URL or path of the image source.
$i.widthcomponentSize. The display width of the image.
Common to all components (4)
$i.doenetMLtext. The DoenetML source code that produced this component.
$i.hideboolean. Whether to hide this component from the rendered output.
$i.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$i.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <image/> from a hyperlink
An <image/> may be inserted from a hyperlink using the source attribute. A <shortDescription> child is required for accessibility.
Example: <image/> in a <figure>
An <image/> is often nested within a <figure> along with a <caption>. A <shortDescription> child is required for accessibility.
Example: <image/> on a <graph>
An <image/> can be placed on a <graph>. Control the size of the image with the size attribute and its initial position with the anchor attribute.
Attribute Examples
Attribute Example: width
The width attribute specifies the absolute width of the image. Doenet determines the size category corresponds to that width and sizes the image accordingly.
Attribute Example: size
The size attribute specifies one of 5 size categories for the <image/>: tiny, small, medium, large, or full.
Attribute Example: aspectRatio
The aspectRatio attribute allows for customization of the image’s default proportions.
Attribute Example: displayMode
The displayMode attribute affects how the <image/> is positioned on screen. The default mode is “block”, which renders the image centered on screen. The available modes are inline, and block.
Attribute Example: horizontalAlign
The horizontalAlign attribute specifies the horizontal position on-screen for the default block-mode style image. Valid values are left, center, and right, with a default of center.
Attribute Example: shortDescription
A <shortDescription> child provides a description of the <image/> for situations where the image
cannot load, or for use with screen-reading technology. It is required for accessibility.
If neither a <shortDescription> nor the decorative attribute is supplied, a warning is produced.
Attribute Example: decorative
If decorative is specified, it indicates that the image doesn’t add any information to the content of the page
and can be ignored by assistive technologies like screen readers.
Attribute Example: source
The source attribute specifies the url for a hyperlinked <image/> and the filepath for an uploaded <image/>.
Attribute Example: anchor
The anchor attribute positions the <image/> on a <graph>.
Attribute Example: draggable
The draggable attribute determines whether the <image/> can be dragged around the graph.
Attribute Example: layer
By adjusting the layer attribute number, geometry can be placed in front of or behind other geometry. The default layer number is 0; all higher numbers are placed in front.
Attribute Example: rotate
The rotate attribute allows for rotation of the <image> about its centerpoint.
Property Examples
Property Example: Attributes as properties 1
The above listed <image/> attributes are also accessible as properties.
Property Example: Attributes as properties 2
The above listed <image/> attributes are also accessible as properties.