AnnotationModel
Container class holding all annotations. Annotations have unique IDs and each belongs to a dataset.
Extends
Methods
| Method | Description |
|---|---|
| remove() | Removes an annotation. |
| annotations() | Returns all annotations. |
| updateAnnotationVisibility() | Makes sure annotations are visible in and only in views in which their parent data items are visible. |
| add() | Adds a new annotation, and attaches it to all views. |
| dataAnnotations() | Returns all annotations belonging to the given dataset. |
| onAnnotationAdded() | Fires when an annotation is added. |
| onAnnotationAboutToBeRemoved() | Fires directly before an annotation is removed. |
| onAnnotationEvent() | Fires when an annotation lifecycle event occurs. |
Inherited from ClassHandle
| Method | Description |
|---|---|
| isAliasOf() | Returns true if this handle and other alias the same underlying C++ object. |
| delete() | Releases this JavaScript handle. |
| deleteLater() | Schedules this handle for deferred deletion and returns this handle. |
| isDeleted() | Returns true if this handle has already been deleted. |
| [dispose]() | Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually. |
| clone() | Returns a new JavaScript handle aliasing the same underlying C++ object. |
remove()
ts
Removes an annotation.
Parameters
| Parameter | Type |
|---|---|
annotation | Annotation | null |
Returns
void
annotations()
ts
Returns all annotations.
Returns
updateAnnotationVisibility()
ts
Makes sure annotations are visible in and only in views in which their parent data items are visible.
Returns
void
add()
ts
Adds a new annotation, and attaches it to all views.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | AnnotationType | Type of the annotation |
data | Data | null | The parent dataset |
Returns
Annotation | null
The created annotation or null in case of an error
dataAnnotations()
ts
Returns all annotations belonging to the given dataset.
Parameters
| Parameter | Type |
|---|---|
data | Data | null |
Returns
onAnnotationAdded()
ts
Fires when an annotation is added.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (annotation: Annotation) => void | Called with the added annotation. |
Returns
Unsubscribe function.
() => void
onAnnotationAboutToBeRemoved()
ts
Fires directly before an annotation is removed.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (annotation: Annotation) => void | Called with the annotation about to be removed. |
Returns
Unsubscribe function.
() => void
onAnnotationEvent()
ts
Fires when an annotation lifecycle event occurs.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (annotation: Annotation, event: AnnotationEvent) => void | Called with the annotation and the event type. |
Returns
Unsubscribe function.
() => void