NPM Package/docs/components/measurement/selection
Annotation Selection
Select an annotation in Canvas, and clear the current annotation selection using the SDK.
Use viewer.annotations.select(...) to select an annotation in Canvas, and viewer.annotations.unselect() to clear the current annotation selection.
Selection commands are available after the viewer is mounted, Canvas is ready, and a document is open.
typescript
Overview
Perform selection operations programmatically:
- If both
uniqueIdandguidare provided, Canvas usesuniqueIdfirst and falls back toguid.
typescript
Select and Unselect
Listen for user or host selection changes natively:
typescript
Listen For Selection Updates
Complete integration code setup for Vanilla HTML/JS environments:
Vanilla Example
Complete React Component implementation details:
tsx
React Integration
Broker message mapping for selection APIs:
viewer.annotations.select(...)maps toselectAnnotation.viewer.annotations.unselect()maps tounselectAnnotation.viewer.annotations.on("selected", ...)listens toannotationSelected.
