NPM Package/docs/components/measurement/creation
Annotation Events
Listen for annotation creation, selection, and deletion events emitted by Canvas using the SDK.
Use viewer.annotations.on(...) to listen for annotation creation, selection, and deletion events emitted by Canvas.
Annotation event subscriptions can be registered after the viewer is created. They connect to Canvas once ready:
typescript
Overview
Register listeners for these key SDK events:
created: Normalized annotation created events.createdWithDetail: Detailed/raw annotation creation events.selected: Normalized selection events.selectedWithDetail: Detailed/raw selection events.deleted: Normalized deletion events.deletedWithDetail: Detailed/raw deletion events.
typescript
Supported Events
Every annotation event has the following SDK shape:
typescript
Event Payload Shape
Use normalized events for standard UI workflows, and detail events for raw RxCore markup data:
typescript
Normalized vs Detail Events
Complete integration code setup for Vanilla HTML/JS environments:
Vanilla Example
Complete React Component implementation details:
tsx
React Integration
Broker message mapping for annotation events:
viewer.annotations.on("created", ...)listens toannotationCreated.viewer.annotations.on("selected", ...)listens toannotationSelected.viewer.annotations.on("deleted", ...)listens toannotationDeleted.
