Open Ecoacoustics Web Components

API

<oe-axes>

Attributes

NameDescriptionTypeDefault
x-stepThe step size for the x-axisSeconds | undefined
y-stepThe step size for the y-axisHertz | undefined
x-titleThe text to show next to the x-axisstring"Time (Seconds)"
y-titleThe text to show next to the y-axisstring"Frequency (KHz)"
x-title-visibleWhether to show/hide the x-axis titlebooleantrue
y-title-visibleWhether to show/hide the y-axis titlebooleantrue
x-axisShows/hides x-axis labels and ticksbooleantrue
y-axisShows/hides y-axis labels and ticksbooleantrue
x-gridShows/hides x-axis labels and grid linesbooleantrue
y-gridShows/hides y-axis labels and grid linesbooleantrue

Properties

NameAttributeDescriptionTypeDefault
labelPaddingEmUnit0.25
tickSizeEmUnit0.75
titleOffsetEmUnit0.25
xStepOverridex-stepThe step size for the x-axisSeconds | undefined
yStepOverridey-stepThe step size for the y-axisHertz | undefined
xTitlex-titleThe text to show next to the x-axisstring"Time (Seconds)"
yTitley-titleThe text to show next to the y-axisstring"Frequency (KHz)"
showXTitlex-title-visibleWhether to show/hide the x-axis titlebooleantrue
showYTitley-title-visibleWhether to show/hide the y-axis titlebooleantrue
showXAxisx-axisShows/hides x-axis labels and ticksbooleantrue
showYAxisy-axisShows/hides y-axis labels and ticksbooleantrue
showXGridx-gridShows/hides x-axis labels and grid linesbooleantrue
showYGridy-gridShows/hides y-axis labels and grid linesbooleantrue
spectrogramSpectrogramComponent
wrappedElementReadonly
emUnitFontSizeSize
unitConverterUnitConverter
labelPaddingSize
tickSizeSize
titleOffsetSize
fontCanvasHTMLCanvasElement

Slots

NameDescription
(default)A spectrogram element to add axes to

CSS Shadow Parts

NameDescription
tickApply styles to both x and y tick lines
x-tickApply styles to only the x axis tick lines
y-tickApply styles to only the y axis tick lines
gridApply styles to both x and y grid lines
x-gridApply styles to only the x grid lines
y-gridApply styles to only the y grid lines
labelApply styles to both x and y labels
x-labelApply styles to only the x axis label
y-labelApply styles to only the x axis label
legendApply styles to both the x and y legends
x-legendApply styles to only the x axis legend
y-legendApply styles to only the x axis legend

<oe-data-source>

Attributes

NameDescriptionTypeDefault
srcA remote JSON or CSV file to use as the data sourcestring | undefined
forA verification grid component that the derived page fetcher callback will be applied tostring
localWhether to allow for local file inputs through a system UI dialogbooleanfalse
randomRandomly sample rows from a local or remote data sourcebooleanfalse

Properties

NameAttributeDescriptionTypeDefault
columnNamespace"oe_""oe_"
pageSize1010
srcsrcA remote JSON or CSV file to use as the data sourcestring | undefined
forforA verification grid component that the derived page fetcher callback will be applied tostring
locallocalWhether to allow for local file inputs through a system UI dialogbooleanfalse
randomrandomRandomly sample rows from a local or remote data sourcebooleanfalse
canDownloadbooleanfalse
fileNamestring | undefined
fileInputHTMLInputElement
dataFetcherDataSourceFetcher | undefined
verificationGridVerificationGridComponent | undefined
decisionHandler

Methods

NameParametersDescriptionReturn
downloadResultsPromise
resultRowsPromise>

CSS Shadow Parts

NameDescription
file-pickerA css target to style the file picker button

<oe-classification>

Attributes

NameDescriptionTypeDefault
tagTag
true-shortcutA shortcut key that when pressed will trigger a true classification decision to be emittedstring | undefined
false-shortcutA shortcut key that when pressed will trigger a false classification decision to be emittedstring | undefined
disabledDisables the decision button and prevents decision events from firingbooleanfalse

Properties

NameAttributeDescriptionTypeDefault
tagtagTag
trueShortcuttrue-shortcutA shortcut key that when pressed will trigger a true classification decision to be emittedstring | undefined
falseShortcutfalse-shortcutA shortcut key that when pressed will trigger a false classification decision to be emittedstring | undefined
trueDecisionButtonHTMLButtonElement
falseDecisionButtonHTMLButtonElement
derivedTrueShortcutstring | undefined
derivedFalseShortcutstring | undefined
decisionEventName"decision""decision"
injectorVerificationGridInjector{ colorService: decisionColor, }
disableddisabledDisables the decision button and prevents decision events from firingbooleanfalse
selectionModeThe selection mode of the verification gridSelectionObserverType"desktop"
shouldEmitNextbooleantrue
keyboardHeldDownbooleanfalse
keyUpHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
shortcutKeysKeyboardShortcut[]
handleShortcutKey
NameDescriptionType
eventKeyboardEvent
void
isShortcutKey
NameDescriptionType
eventKeyboardEvent
Readonly
emitDecision
NameDescriptionType
valueDecision[]
void

Events

NameDescription
decision

Slots

NameDescription
(default)Additional content to be displayed in the decision groups title

CSS Shadow Parts

NameDescription
true-decision-buttonStyling selector to target the true decision button
false-decision-buttonStyling selector to target the false decision button

<oe-decision>

Attributes

NameDescriptionTypeDefault
disabledDisables the decision button and prevents decision events from firingbooleanfalse

Properties

NameAttributeDescriptionTypeDefault
decisionEventName"decision""decision"
injectorVerificationGridInjector{ colorService: decisionColor, }
disableddisabledDisables the decision button and prevents decision events from firingbooleanfalse
selectionModeThe selection mode of the verification gridSelectionObserverType"desktop"
shouldEmitNextbooleantrue
keyboardHeldDownbooleanfalse
keyUpHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
handleShortcutKey
NameDescriptionType
eventKeyboardEvent
void
isShortcutKey
NameDescriptionType
eventKeyboardEvent
Readonly
shortcutKeysKeyboardShortcut[]
emitDecision
NameDescriptionType
valueDecision[]
void

Events

NameDescription
decision

<oe-verification>

Attributes

NameDescriptionTypeDefault
verifiedDecisionOptions
additional-tagsValue that will be added to the oe-additional-tags columnTag[][]
shortcutA keyboard key that when pressed will act as a click event on the buttonstring""
disabledDisables the decision button and prevents decision events from firingbooleanfalse

Properties

NameAttributeDescriptionTypeDefault
verifiedverifiedDecisionOptions
additionalTagsadditional-tagsValue that will be added to the oe-additional-tags columnTag[][]
shortcutshortcutA keyboard key that when pressed will act as a click event on the buttonstring""
decisionButtonHTMLButtonElement
decisionEventName"decision""decision"
injectorVerificationGridInjector{ colorService: decisionColor, }
disableddisabledDisables the decision button and prevents decision events from firingbooleanfalse
selectionModeThe selection mode of the verification gridSelectionObserverType"desktop"
shouldEmitNextbooleantrue
keyboardHeldDownbooleanfalse
keyUpHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
shortcutKeysKeyboardShortcut[]
handleShortcutKey
NameDescriptionType
eventKeyboardEvent
void
isShortcutKey
NameDescriptionType
eventKeyboardEvent
Readonly
emitDecision
NameDescriptionType
valueDecision[]
void

Events

NameDescription
decision

Slots

NameDescription
(default)Additional content to be displayed in the decision button

CSS Shadow Parts

NameDescription
decision-buttonThe button that triggers the decision

<oe-indicator>

Properties

NameAttributeDescriptionTypeDefault
spectrogramSpectrogramComponent | undefined
wrappedElementReadonly
unitConverterUnitConverter | undefined
computedTimePxReadonlySignal

Methods

NameParametersDescriptionReturn
handleSlotChangevoid

Slots

NameDescription
(default)A spectrogram component to add an indicator to

CSS Shadow Parts

NameDescription
indicator-lineA css target to style the indicator line
seek-iconA css target to style the seek icon underneath the indicator line

<oe-info-card>

Attributes

NameDescriptionTypeDefault
default-linesNumber of subject key/values pairs to show before the "Show More" button is clickednumber3

Properties

NameAttributeDescriptionTypeDefault
modelSubjectWrapper | undefined
defaultLinesdefault-linesNumber of subject key/values pairs to show before the "Show More" button is clickednumber3
showExpandedbooleanfalse
identityStrategyInfoCardTemplate
numberStrategyInfoCardTemplate
urlStrategy

<undefined>

Properties

NameAttributeDescriptionTypeDefault
loggerILogger | undefined

Methods

NameParametersDescriptionReturn
doThingvoid

<oe-media-controls>

A simple media player with play/pause and seek functionality that can be used with the open ecoacoustics spectrograms and components.

Attributes

NameDescriptionTypeDefault
forA DOM selector to target the spectrogram elementstring""
playIconPositionPreferenceLocation"default"

Properties

NameAttributeDescriptionTypeDefault
recursiveAxesSearch
forforA DOM selector to target the spectrogram elementstring""
playIconPositionplayIconPositionPreferenceLocation"default"
loggerILogger{ log: console.log, }
axesElementAxesComponent | null | undefined
spectrogramElementSpectrogramComponent | null | undefined
playHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
toggleAudio
NameDescriptionType
keyboardShortcut
void
isSpectrogramPlayingboolean

Slots

NameDescription
play-iconThe icon to display when the media is stopped
pause-iconThe icon to display when the media is playing

CSS Shadow Parts

NameDescription
play-iconStyling applied to the play icon (including default)
pause-iconStyling applied to the pause icon (including default)

<oe-progress-bar>

Attributes

NameDescriptionTypeDefault
history-headWhere the verification head is atnumber0
totalThe total number of items in the data setnumber | undefined
completedThe completion headnumber0

Properties

NameAttributeDescriptionTypeDefault
historyHeadhistory-headWhere the verification head is atnumber0
totaltotalThe total number of items in the data setnumber | undefined
completedcompletedThe completion headnumber0

<oe-spectrogram>

Attributes

NameDescriptionTypeDefault
windowRenderWindow | undefined
pausedWhether the spectrogram is pausedbooleantrue
srcThe source of the audio filestring""
scalingThe aspect ratio of the spectrogram stretch should scale without aspect ratio natural should scale with the correct aspect ratio to fill the container it is in. One dimension will be constrained by the container, the other by the aspect ratio. original will set the spectrogram to the native resolution of the FFT output. It will not scale the image at all.SpectrogramCanvasScale"stretch"
window-sizeThe size of the fft windownumber512
window-functionThe window function to use for the spectrogramWindowFunctionName"hann"
window-overlapThe amount of overlap between fft windowsnumber0
mel-scaleA boolean attribute representing if the spectrogram should be shown in mel-scalebooleanfalse
color-mapA color map to use for the spectrogramstring""
offsetAn offset (seconds) from the start of a larger audio recordingnumber0
brightnessAn increase in brightnessnumber0
contrastA scalar multiplier that should be applied to fft valuesnumber1

Properties

NameAttributeDescriptionTypeDefault
playEventName"play""play"
domRenderWindowwindowRenderWindow | undefined
pausedpausedWhether the spectrogram is pausedbooleantrue
srcsrcThe source of the audio filestring""
scalingscalingThe aspect ratio of the spectrogram stretch should scale without aspect ratio natural should scale with the correct aspect ratio to fill the container it is in. One dimension will be constrained by the container, the other by the aspect ratio. original will set the spectrogram to the native resolution of the FFT output. It will not scale the image at all.SpectrogramCanvasScale"stretch"
windowSizewindow-sizeThe size of the fft windownumber512
windowFunctionwindow-functionThe window function to use for the spectrogramWindowFunctionName"hann"
windowOverlapwindow-overlapThe amount of overlap between fft windowsnumber0
melScalemel-scaleA boolean attribute representing if the spectrogram should be shown in mel-scalebooleanfalse
colorMapcolor-mapA color map to use for the spectrogramstring""
offsetoffsetAn offset (seconds) from the start of a larger audio recordingnumber0
brightnessbrightnessAn increase in brightnessnumber0
contrastcontrastA scalar multiplier that should be applied to fft valuesnumber1
slotElementsArray
mediaElementHTMLMediaElement
canvasHTMLCanvasElement
audioSignal
currentTimeSignal
renderCanvasSizeSignal
renderWindowSignal
fftSliceTwoDSlice | undefined
unitConvertersSignal
audioHelpernew AudioHelper()
audioContextnew AudioContext()
highAccuracyTimeBuffernew SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT)
currentTimeBuffernew Float32Array(this.highAccuracyTimeBuffer)
doneFirstRenderbooleanfalse
spectrogramOptionsSpectrogramOptions
possibleWindowSizesReadonlyArray
possibleWindowOverlapsReadonlyArray
renderedSourcestring
nextRequestIdnumber | nullnull

Methods

NameParametersDescriptionReturn
hasSourceboolean
renderSpectrogramvoid
regenerateSpectrogramvoid
regenerateSpectrogramOptionsvoid
resetSettingsvoid
play
NameDescriptionType
keyboardShortcut
void
pause
NameDescriptionType
keyboardShortcut
void
stopvoid

Events

NameDescription
loading
loaded
Loading
Finished

Slots

NameDescription
(default)A `` element to provide the audio source

<oe-verification-grid-settings>

Properties

NameAttributeDescriptionTypeDefault
settingsVerificationGridSettings
gridSizeAn internal representation of the verification grids sizenumber | undefined
verificationGridVerificationGridComponent | undefined
fullscreenChangeHandler

<oe-verification-grid-tile>

Attributes

NameDescriptionTypeDefault
hiddenHides a grid tile. This is useful for virtual paging so if you have a grid of tiles where not all have a source, you can hide the ones that do not have a source instead of destroying them completely as they might be used in the future when paging back in history or the grid size is increased.booleanfalse

Properties

NameAttributeDescriptionTypeDefault
selectedEventName"selected""selected"
modelSubjectWrapper
settingsVerificationGridSettings
injectorVerificationGridInjector
hiddenhiddenHides a grid tile. This is useful for virtual paging so if you have a grid of tiles where not all have a source, you can hide the ones that do not have a source instead of destroying them completely as they might be used in the future when paging back in history or the grid size is increased.booleanfalse
showKeyboardShortcutsbooleanfalse
selectedbooleanfalse
indexThe index position of the tile within a verification grid that is used to determine the selection keyboard shortcut associated with the grid tilenumber0
requiredTagsTag[]
spectrogramSpectrogramComponent | undefined
contentsWrapperHTMLDivElement
keyDownHandler
loadingHandler
loadedHandler
playHandler
loadedbooleanfalse
shortcutsstring[][]

Methods

NameParametersDescriptionReturn
resetSettingsvoid
addDecision
NameDescriptionType
decisionDecision
removeDecision
NameDescriptionType
decisionDecision

Events

NameDescription
loaded
Loaded

Slots

NameDescription
(default)The template to be rendered inside the grid tile

CSS Custom Properties

NameDescription
--decision-colorThe border color that is applied when a decision is being shown
--selected-border-sizeThe size of the border when a decision is being shown

<oe-verification-help-dialog>

Attributes

NameDescriptionTypeDefault
decisionElementsDecisionComponent[]
selectionBehaviorSelectionObserverType
verificationTasksCountnumber
classificationTasksCountnumber

Properties

NameAttributeDescriptionTypeDefault
decisionElementsdecisionElementsDecisionComponent[]
selectionBehaviorselectionBehaviorSelectionObserverType
verificationTasksCountverificationTasksCountnumber
classificationTasksCountclassificationTasksCountnumber
showRememberOptionbooleantrue
helpDialogElementHTMLDialogElement
dialogPreferenceElementHTMLInputElement | undefined
openboolean
hasVerificationTaskboolean
hasClassificationTaskboolean

Methods

NameParametersDescriptionReturn
showModal
NameDescriptionType
showRememberOption

Events

NameDescription
openDispatched when the dialog is opened
closeDispatched when the dialog is closed

<oe-verification-grid>

Attributes

NameDescriptionTypeDefault
grid-sizeThe number of items to display in a single gridnumber8
selection-behaviorThe selection behavior of the verification gridSelectionObserverType"default"
get-pageA callback function that returns a page of recordingsPageFetcher | undefined

Properties

NameAttributeDescriptionTypeDefault
decisionMadeEventName"decision-made""decision-made"
loadedEventName"loaded""loaded"
settingsVerificationGridSettings{ showAxes: signal(true), showMediaControls: signal(true), isFullscreen: signal(false), }
injectorVerificationGridInjector{ colorService: decisionColor, }
gridSizegrid-sizeThe number of items to display in a single gridnumber8
selectionBehaviorselection-behaviorThe selection behavior of the verification gridSelectionObserverType"default"
getPageget-pageA callback function that returns a page of recordingsPageFetcher | undefined
historyHeadnumber0
verificationDecisionElementsselector for oe-verification elementsVerificationComponent[]
classificationDecisionElementsselector for oe-classification elementsClassificationComponent[]
gridItemTemplateHTMLTemplateElement | undefined
gridTilesNodeListOf
helpDialogVerificationHelpDialogComponent
gridContainerHTMLDivElement
decisionsContainerHTMLSlotElement
skipButtonDecisionComponent
currentSubSelectionSubjectWrapper[][]
currentPageThe array of subjects that are currently displayed in grid tilesSubjectWrapper[][]
pagedItemsnumber
decisionElementsA computed selector for all oe-verification and oe-classification elementsDecisionComponentUnion[]
keydownHandler
keyupHandler
blurHandler
intersectionHandler
selectionHandler
decisionHandler
intersectionObservernew IntersectionObserver(this.intersectionHandler)
subjectHistorySubjectWrapper[][]
verificationBufferSubjectWrapper[][]
requiredClassificationTagsTag[][]
hiddenTilesnumber0
decisionsDisabledbooleanfalse
showingSelectionShortcutsbooleanfalse
selectionHeadnumber | nullnull
doneRenderBoxInitbooleanfalse
highlightHighlightSelection{ start: { x: 0, y: 0 }, current: { x: 0, y: 0 }, highlighting: false, elements: [], }
paginationFetcherGridPageFetcher | undefined
effectivePageSizeA count of the number of tiles currently visible on the screennumber

Methods

NameParametersDescriptionReturn
isViewingHistoryboolean
resetSpectrogramSettingsvoid
isHelpDialogOpenboolean

Events

NameDescription
decisionEmits information about the decision that was made
loadedEmits when all the spectrograms have been loaded

Slots

NameDescription
(default)A template element that will be used to create each grid tile
(default)Decision elements that will be used to create the decision buttons
data-sourceAn `oe-data-source` element that provides the data