Reference navigation
On this page
CLASS · v0.9.1
Annotation
Base class for text and lines drawn over the image.
from proteinmotion.annotations import AnnotationConstructor
Annotation()Notes
Image positions use normalized coordinates. Opacity ranges from 0 to 1. Subclasses supply geometry through layout().
Methods and properties
| Name | Description |
|---|---|
| set_opacity()method | Set or animate opacity in [0, 1]. |
| move_to()method | Set or animate text position in normalized image coordinates. |
| shift()method | Translate the object by an offset. |
| snapshot()method | Capture the current state for deterministic timeline evaluation. |
| restore()method | Restore a state produced by snapshot(). |
| animateproperty | Create a builder for fluent animation calls. Pass the result to scene.play(). |
| text_progressproperty | Current reveal progress for glyphs and annotation lines. |
Annotation.set_opacity(opacity)Set or animate opacity in [0, 1].
| Parameter | Default | Description |
|---|---|---|
opacity | Required | Opacity in [0, 1], from transparent to opaque. |
Returns: The object or animation builder.
Annotation.move_to(position)Set or animate text position in normalized image coordinates.
| Parameter | Default | Description |
|---|---|---|
position | Required | Image coordinates (x, y), with (0, 0) at the top-left and (1, 1) at the bottom-right. |
Returns: The annotation or animation builder.
Annotation.shift(offset)Translate the object by an offset.
| Parameter | Default | Description |
|---|---|---|
offset | Required | Offset (x, y) in design pixels at 1080p for residue labels; normalized image units for text shifts. |
Returns: The object or animation builder.
Annotation.snapshot()Capture the current state for deterministic timeline evaluation.
Returns: State dictionary.
Annotation.restore(state)Restore a state produced by snapshot().
| Parameter | Default | Description |
|---|---|---|
state | Required | State returned by snapshot(). |
Returns: None
Annotation.animateCreate a builder for fluent animation calls. Pass the result to scene.play().
Annotation.text_progressCurrent reveal progress for glyphs and annotation lines.