Class: AnnotationPane

AnnotationPane(options)

An AnnotationPane holds annotations.

Constructor

new AnnotationPane(options)

Create an annotation pane.
Parameters:
Name Type Description
options Object Configuration options.
Author:
  • Lawrence Fyfe
Source:

Methods

activate()

Activate this pane, allowing it to accept pointer events.
Source:

activateAnnotations(activate)

Activate or deactivate all annotations.
Parameters:
Name Type Description
activate boolean True activates annotations and false deactivates them.
Source:

activateKeyboardInput()

Activate keyboard controls for deleting annotations via the "Backspace" or "Delete" keys.
Source:

activateSaveButton()

Activate the save annotation button.
Source:

addAnnotations(type, annotations)

Add an array of annotations of the specified type to this pane.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
annotations Array An array of annotations.
Source:

addBoundary(time, strength, label, properties)

Add a boundary annotation with the specified parameters. The boundary will have a status of UNCHANGED (see AnnotationStatus for other status values). This method is most useful for adding saved boundaries to an annotation pane.
Parameters:
Name Type Description
time number The time.
strength number The strength.
label string A label.
properties Object Properties.
Source:

addComment(time, label, properties)

Add a comment annotation with the specified parameters. The comment will have a status of UNCHANGED (see AnnotationStatus for other status values). This method is most useful for adding saved comments to an annotation pane.
Parameters:
Name Type Description
time number The time.
label string A label.
properties Object Properties.
Source:

addMarker(time, label, properties)

Add a marker annotation with the specified parameters. The marker will have a status of UNCHANGED (see AnnotationStatus for other status values). This method is most useful for adding saved markers to an annotation pane.
Parameters:
Name Type Description
time number The time.
label string A label.
properties Object Properties.
Source:

addNoteGroup(noteArray, label, properties)

Add a note group annotation with the specified parameters. The note group will have a status of UNCHANGED (see AnnotationStatus for other status values). This method is most useful for adding saved markers to an annotation pane.
Parameters:
Name Type Description
noteArray Array An array of notes.
label string A label.
properties Object Properties.
Source:

addRegion(startTime, endTime, label, properties)

Add a region annotation with the specified parameters. The region will have a status of UNCHANGED (see AnnotationStatus for other status values). This method is most useful for adding saved markers to an annotation pane.
Parameters:
Name Type Description
startTime number The start time.
endTime number The end time.
label string A label.
properties Object Properties.
Source:

createBoundary(time, strength, label, properties)

Create a new boundary annotation with a status of CREATED and run onCreate() if it is set. This method is used for interactively-created boundaries.
Parameters:
Name Type Description
time number The time.
strength number The strength.
label string A label.
properties Object Properties.
Source:

createComment(time, label, properties)

Create a new comment annotation with a status of CREATED and run onCreate() if it is set. This method is used for interactively-created comments.
Parameters:
Name Type Description
time number The time.
label string A label.
properties Object Properties.
Source:

createMarker(time, label, properties)

Create a new marker annotation with a status of CREATED and run onCreate() if it is set. This method is used for interactively-created markers.
Parameters:
Name Type Description
time number The time.
label string A label.
properties Object Properties.
Source:

createNoteGroup(noteArray, label, properties)

Create a new note group annotation with a status of CREATED and run onCreate() if it is set. This method is used for interactively-created note groups.
Parameters:
Name Type Description
noteArray Array An array of notes.
label string A label.
properties Object Properties.
Source:

createRegion(startTime, endTime, label, properties)

Create a new region annotation with a status of CREATED and run onCreate() if it is set. This method is used for interactively-created regions.
Parameters:
Name Type Description
startTime number The start time.
endTime number The end time.
label string A label.
properties Object Properties.
Source:

deactivate()

Deactivate this pane, preventing it from accepting pointer events.
Source:

deactivateKeyboardInput()

Deactivate keyboard controls.
Source:

deactivateSaveButton()

De-activate the save annotation button.
Source:

deleteAllAnnotations()

Delete all annotations from this pane.
Source:

deleteSelectedAnnotations()

Delete selected annotations of any type.
Source:

deselectAllAnnotations()

Deselect all annotations regardless of type.
Source:

draw()

Draw this annotation pane.
Source:

drawAnnotationList()

Draw the annotation list for the current annotation type. Display a message if no annotations of the current type exist.
Source:

drawBoundaries()

Draw boundaries on this pane.
Source:

drawBoundaryList()

Draw the boundary list.
Source:

drawCheckBox(parentElement, annotation)

Draw a checkbox for selecting or deselecting the specified annotation.
Parameters:
Name Type Description
parentElement d3.selection The parent element for this checkbox.
annotation annotation The annotation to control.
Source:

drawCommentList()

Draw the comment list.
Source:

drawComments()

Draw comments on this pane.
Source:

drawLabelInput(parentElement, size, annotation)

Draw an input text box for setting the label of the specified annotation.
Parameters:
Name Type Description
parentElement d3.selection The parent element for this checkbox.
size number The size of the input in characters.
annotation annotation The time of the annotation.
Source:

drawMarkerList()

Draw the marker list.
Source:

drawMarkers()

Draw markers on this pane.
Source:

drawNoteGroupList()

Draw the note group list.
Source:

drawNoteGroups()

Draw note groups on this pane.
Source:

drawNoteSelectors()

Draw note selectors on this pane. Note selectors are invisible interactive rectangles that cover notes. When clicked a note selector can either add or remove a note from a note group or create a new note group.
Source:

drawPanel()

Draw the panel.
Source:

drawRegionList()

Draw the region list.
Source:

drawRegions()

Draw regions on this pane.
Source:

drawSelectedAnnotationControls()

Draw controls that affect selected annotations of any type.
Source:

drawStrengthSelect(parentElement, annotation)

Draw a select list for setting the strength of a boundary.
Parameters:
Name Type Description
parentElement d3.selection The parent element for this checkbox.
annotation Boundary The boundary whose strength should be set.
Source:

drawTime(parentElement, annotation)

Draw the time value of the specified annotation.
Parameters:
Name Type Description
parentElement d3.selection The parent element for this checkbox.
annotation annotation The time of the annotation.
Source:

eraseAll()

Erase all annotations from this pane.
Source:

eraseAnnotationList()

Erase any annotation list.
Source:

eraseBoundaries()

Erase boundaries from this pane.
Source:

eraseComments()

Erase comments from this pane.
Source:

eraseMarkers()

Erase markers from this pane.
Source:

eraseNoteGroups()

Erase note groups from this pane.
Source:

erasePanel()

Erase the panel.
Source:

eraseRegions()

Erase regions from this pane.
Source:

generateBoundary(time, strength, label, properties, firstCreated) → {Boundary}

Generate a boundary annotation with the specified parameters and return it. If the type mode for this annotation pane is set to BOUNDARY, the newly-generated Boundary will be active.
Parameters:
Name Type Description
time number The time.
strength number The strength.
label string A label.
properties Object Properties.
firstCreated boolean Whether this boundary was created for the first time.
Source:
Returns:
A newly-generated Boundary.
Type
Boundary

generateComment(time, label, properties, firstCreated) → {Comment}

Generate a comment annotation with the specified parameters and return it. If the type mode for this annotation pane is set to COMMENT, the newly-generated Comment will be active.
Parameters:
Name Type Description
time number The time.
label string A label.
properties Object Properties.
firstCreated boolean Whether this comment was created for the first time.
Source:
Returns:
A newly-generated Comment.
Type
Comment

generateMarker(time, label, properties, firstCreated) → {Marker}

Generate a marker annotation with the specified parameters and return it. If the type mode for this annotation pane is set to MARKER, the newly-generated Marker will be active.
Parameters:
Name Type Description
time number The time.
label string A label.
properties Object Properties.
firstCreated boolean Whether this comment was created for the first time.
Source:
Returns:
A newly-generated Marker.
Type
Marker

generateNoteGroup(noteArray, label, properties, firstCreated) → {NoteGroup}

Generate a note group annotation with the specified parameters and return it. If the type mode for this annotation pane is set to NOTE_GROUP, the newly-generated NoteGroup will be active.
Parameters:
Name Type Description
noteArray Array An array of notes.
label string A label.
properties Object Properties.
firstCreated boolean Whether this comment was created for the first time.
Source:
Returns:
A newly-generated NoteGroup.
Type
NoteGroup

generateRegion(startTime, endTime, label, properties, firstCreated) → {Region}

Generate a region annotation with the specified parameters and return it. If the type mode for this annotation pane is set to REGION, the newly-generated Region will be active.
Parameters:
Name Type Description
startTime number The start time.
endTime number The end time.
label string A label.
properties Object Properties.
firstCreated boolean Whether this comment was created for the first time.
Source:
Returns:
A newly-generated Region.
Type
Region

getAllAnnotations() → {Array}

Get all annotations of all types or return an empty array if no annotations exist.
Source:
Returns:
An array of annotations or an empty array.
Type
Array

getAnnotationCount() → {number}

Get a count of all annotations in this pane.
Source:
Returns:
The number of annotations.
Type
number

getAnnotationTypeName(type)

Get the name string for the specified annotation type.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
Source:

getAnnotationsByType(type) → {Array}

Get an array of all annotations of the specified type or an empty array if no annotations of that type exist.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
Source:
Returns:
An array of annotations or an empty array.
Type
Array

getChangedAnnotations() → {Array}

Get annotations of all types that have been changed such that their AnnotationStatus value is not UNCHANGED. Returns an empty array if no annotations have been changed.
Source:
Returns:
An array of changed annotations or an empty array.
Type
Array

getSelectedAnnotationsByType(type) → {Array}

Get an array of selected annotations of the specified type or an empty array if no annotations of that type are selected.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
Source:
Returns:
An array of selected annotations or an empty array.
Type
Array

getTypeMode() → {AnnotationType}

Get the current type mode where types are defined in AnnotationType.
Source:
Returns:
A constant representing the type.
Type
AnnotationType

initialize(parentElement, width, height, timeScale)

Initialize this annotation pane, attaching it to the specified parent element and setting its size and time scale.
Parameters:
Name Type Description
parentElement d3.selection The parent element.
width number The width.
height number The height.
timeScale d3.scaleLinear The time scale.
Source:

initializePanel(panelElement)

Initialize the panel, attaching it to the specified parent element.
Parameters:
Name Type Description
panelElement element The panel's parent element.
Source:

isTypeAllowed(type)

Is the specified annotation type allowed for this pane? If an annotation type is not allowed, then no annotations of that type can be created or displayed.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
Source:

lower()

Lower this pane to the bottom of the list of panes in its containing TimeFrame.
Source:

raise()

Raise this pane to the top of the list of panes in its containing TimeFrame.
Source:

raiseAnnotations(type)

Raise annotations of the specified type.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
Source:

selectAllAnnotationsOfType(type, selectAll)

Select or deselect all annotations of the specified type.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
selectAll boolean True selects all annotations and false deselects them.
Source:

selectNote(note, createGroup)

Select a note for creating a new note group or adding to an existing one. If a note group exists and is selected, then calling this method will add the note to that group. Otherwise the selected note will create a new note group.
Parameters:
Name Type Description
note Object The annotations that is not to be deselected.
createGroup boolean The annotations that is not to be deselected.
Source:

selectNoteRange(t1, t2, y1, y2, createGroup, deselectGroup)

Select a note for creating a new note group or adding to an existing one. If a note group exists and is selected, then calling this method will add the note to that group. Otherwise the selected note will create a new note group.
Parameters:
Name Type Description
t1 number The start of the time range.
t2 number The end of the time range.
y1 number The start of the value range.
y2 number The end of the value range.
createGroup boolean Whether to create a new note group.
deselectGroup boolean Whether notes in a group should be deleted from or added to a note group.
Source:

setTypeMode(type)

Set the specified type mode for this pane where types are defined in AnnotationType. By setting the type mode, this annotation pane makes annotations of that type active and deactivates all other types. Activating a type of annotation means that annotations of that type can be created, updated, or deleted.
Parameters:
Name Type Description
type number A type defined in AnnotationType.
Source:

showAllAnnotations(show)

Set the show/hide value for all annotations.
Parameters:
Name Type Description
show boolean True shows annotations and false hides them.
Source:

showAnnotationType(type, show)

Show or hide annotations of the specified type.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
show boolean True shows annotations and false hides them.
Source:

showAnnotationsByProperty(type, propertyName, propertyValue, show)

Show or hide annotations of the specified type and with the specified property that's equal to the specified value.
Parameters:
Name Type Description
type AnnotationType The type of annotation.
propertyName string The name of the property.
propertyValue string The value of the property.
show boolean True shows annotations and false hides them.
Source: