Annotation (comments/annotations)



Represents an annotation.

Annotation is an entity that combines an AnnotationView and an annotation target (a DOM element or a Rect) to which the annotation is bound.



  • focusableElements : Collection

    A collection of DOM elements which, when focused, make the annotation active.

    By default this collection only contains the annotation view element. It can be extended with custom targets that will be tracked by the annotation focus tracking system.

  • innerView : View

    The annotation inner view.

    It is the view that is wrapped by the annotation view.

  • isActive : Boolean

    The state of the annotation.

  • target : Rect | Element

    The annotation target to which the annotation view should be pinned.

    It is either a DOM element or a rect instance.

  • targetRect : Rect

    The position and dimensions of the annotation target to which the annotation is bound.

  • type : String

    The type of the annotation.

  • view : AnnotationView

    The annotation view.


  • constructor( options = { options.view,, options.type } )

    Creates an instance of the Annotation.


    options : Object
    options.view : AnnotationView

    The annotation view. : Rect | function | Element

    The annotation target.

    options.type : String | function

    The annotation type.

  • destroy()

    Clears all event listeners and internal collections.

  • updateTargetRect()

    Updates the target rect in the annotation view instance.