Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only.
These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use.
Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability.
Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing.
The software is provided as is with no guarantees or support.
The AnnotationAPI provides a set of tools for creating and managing annotations via the webvis context. It allows you to:
Create annotations and attach them to specific nodes in a scene.
Edit and update existing annotations.
Retrieve all annotations at once.
Request detailed annotation data for a specific annotations.
Remove annotations when they are no longer needed.
Examples of all operations are provided below.
Quick Start
The fastest way to get familiar with the AnnotationAPI is by creating annotations via the webvis context. Once you have the context, you can call the annotation methods directly.
Example: Create, update and remove an annotation using the AnnotationAPI and connect the annotation to a node.
// Get the webvis contextconstcontext = webvis.getContext();// Create a node to attach the annotation to and enable the resource to make it visibleconstnodeID = context.add({dataURI:"urn:x-i3d:shape:box", initialProperties: {enabled:true}});// Define custom annotation data using the AnnotationProperties typeconstcustomAnnotationData = {anchorPosition: [0, 0, 0],connectedNodeId:1,content:"New Annotation",contentOffset: [0, 0.5, 0],enabled:true,name:"Annotation 1",trustedSource:true };// Create an annotation using the custom annotation dataconstannotationId = context.createAnnotation(customAnnotationData);// Fetch the data of the newly created annotation constannotationData = awaitcontext.requestAnnotationData(annotationId); console.log("Fetched annotation data:", annotationData);// Update the annotation with new contentcontext.changeAnnotation(annotationId, { content:"Updated Annotation" }); // Fetch the data of the updated annotation constupdatedAnnotationData = awaitcontext.requestAnnotationData(annotationId); console.log("Fetched updated annotation data:", updatedAnnotationData);// Remove the annotation if no longer required context.removeAnnotation(annotationId);
Events
The following events are associated with the AnnotationAPI:
Overview
The AnnotationAPI provides a set of tools for creating and managing annotations via the webvis context. It allows you to:
Examples of all operations are provided below.
Quick Start
The fastest way to get familiar with the AnnotationAPI is by creating annotations via the webvis context. Once you have the context, you can call the annotation methods directly.
Example: Create, update and remove an annotation using the AnnotationAPI and connect the annotation to a node.
Events
The following events are associated with the AnnotationAPI: