Annotation Styles
Get and set visual properties for specific annotations on the canvas.
While global styles set the default for new drawings, Annotation Styles allow you to inspect and modify existing elements on the canvas independently.
Each annotation (shape, text, measurement) has its own unique set of styles that can be retrieved and updated via the Host API.
- Granular Control: Modify thickness, color, or transparency for a single item.
- Dynamic Updates: Reflect changes immediately on the canvas without reloading.
- Type-Specific: Access specialized properties like arrow types or count shapes.
Request properties for a specific annotation and update its appearance.
Fetch properties
Update properties
The interaction follows a standard request-response pattern for reading data, and a one-way command for updates.
1. Host Requests Props
The host pulls current styles for a selected annotation.
2. Viewer Returns Data
The viewer responds with a snapshot of the current state.
3. Host Updates Props
The host sends new style values to be applied.
The `AnnotationProperties` interface is used for both retrieval and updates.
0: Circle
Default circular marker.
1: Square
Solid block marker.
2: Triangle
Pointed indicator.
3: Diamond
Diamond indicator.
For Count annotations, the `countType` property determines the symbol used on the canvas. These can be set programmatically using IDs 0 through 3.
Explore related styling and selection APIs.
- Global Defaults: Global Styles
- Extraction: Data Extraction
- Technical: Full API Reference
