addAnnotation method
Adds an annotation to the graph.
Annotations are visual elements like sticky notes, markers, or group containers that provide additional context to the graph.
Triggers the onAnnotationCreated callback after successful addition.
Parameters:
annotation: The annotation to add
See also:
createStickyNotefor creating sticky note annotationscreateGroupAnnotationfor creating group annotationscreateMarkerfor creating marker annotations
Implementation
void addAnnotation(Annotation annotation) {
annotations.addAnnotation(annotation);
// Fire callback after successful addition
callbacks.onAnnotationCreated?.call(annotation);
}