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 | undefined
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 | undefined
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
additional-tagsValue that will be added to the oe-additional-tags columnTag[][]
disabledDisables the decision button and prevents decision events from firingbooleanfalse
verifiedEnumValue
shortcutA keyboard key that when pressed will act as a click event on the buttonstring | undefined

Properties

NameAttributeDescriptionTypeDefault
tagtagTag
decisionEventName"decision""decision"
additionalTagsadditional-tagsValue that will be added to the oe-additional-tags columnTag[][]
disableddisabledDisables the decision button and prevents decision events from firingbooleanfalse
verifiedverifiedEnumValue
shortcutshortcutA keyboard key that when pressed will act as a click event on the buttonstring | undefined
highlightedbooleanfalse
decisionIdDecisionId0
selectionModeThe selection mode of the verification gridSelectionObserverType"desktop"
decisionButtonHTMLButtonElement
keyboardHeldDownbooleanfalse
shouldEmitNextbooleantrue
decisionModelsDecision[] | undefined
keyUpHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
generateDecisionModels[Classification]
isShowingDecisionColorboolean

Events

NameDescription
decision

Slots

NameDescription
(default)The text/content of the decision

CSS Shadow Parts

NameDescription
decision-buttonThe button that triggers the decision

<oe-decision>

Attributes

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

Properties

NameAttributeDescriptionTypeDefault
decisionEventName"decision""decision"
additionalTagsadditional-tagsValue that will be added to the oe-additional-tags columnTag[][]
disableddisabledDisables the decision button and prevents decision events from firingbooleanfalse
verifiedverifiedEnumValue
shortcutshortcutA keyboard key that when pressed will act as a click event on the buttonstring | undefined
highlightedbooleanfalse
decisionIdDecisionId0
selectionModeThe selection mode of the verification gridSelectionObserverType"desktop"
decisionButtonHTMLButtonElement
keyboardHeldDownbooleanfalse
shouldEmitNextbooleantrue
decisionModelsDecision[] | undefined
keyUpHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
generateDecisionModelsDecision[]
isShowingDecisionColorboolean

Events

NameDescription
decision

Slots

NameDescription
(default)The text/content of the decision

CSS Shadow Parts

NameDescription
decision-buttonThe button that triggers the decision

<oe-verification>

Attributes

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

Properties

NameAttributeDescriptionTypeDefault
decisionEventName"decision""decision"
additionalTagsadditional-tagsValue that will be added to the oe-additional-tags columnTag[][]
disableddisabledDisables the decision button and prevents decision events from firingbooleanfalse
verifiedverifiedEnumValue
shortcutshortcutA keyboard key that when pressed will act as a click event on the buttonstring | undefined
highlightedbooleanfalse
decisionIdDecisionId0
selectionModeThe selection mode of the verification gridSelectionObserverType"desktop"
decisionButtonHTMLButtonElement
keyboardHeldDownbooleanfalse
shouldEmitNextbooleantrue
decisionModelsDecision[] | undefined
keyUpHandler
keyDownHandler

Methods

NameParametersDescriptionReturn
generateDecisionModels[Verification, ...Classification[]]
isShowingDecisionColorboolean

Events

NameDescription
decision

Slots

NameDescription
(default)The text/content of the decision

CSS Shadow Parts

NameDescription
decision-buttonThe button that triggers the decision

<oe-indicator>

Properties

NameAttributeDescriptionTypeDefault
spectrogramSpectrogramComponent | undefined
wrappedElementReadonly
xPosnumber0
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
defaultLinesdefault-linesNumber of subject key/values pairs to show before the "Show More" button is clickednumber3
modelSubjectWrapper | undefined
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-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()
doneFirstRenderbooleanfalse
spectrogramOptionsSpectrogramOptions
possibleWindowSizesReadonlyArray
possibleWindowOverlapsReadonlyArray
renderedSourcestring
nextRequestIdnumber | nullnull
playStartedAtDOMHighResTimeStamp | 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-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
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
spectrogramSpectrogramComponent | undefined
contentsWrapperHTMLDivElement
keyDownHandler
loadingHandler
loadedHandler
playHandler
loadedbooleanfalse
shortcutsstring[][]
decisionIndicesnumber[]

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"
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
spectrogramElementsTemplateResult<1> | TemplateResult<1>[] | undefined
historyHeadnumber0
verificationDecisionElementsselector for oe-verification elementsVerificationComponent[]
classificationDecisionElementsselector for oe-classification elementsClassificationComponent[]
gridItemTemplateHTMLTemplateElement
gridTilesNodeListOf
helpDialogVerificationHelpDialogComponent
gridContainerHTMLDivElement
decisionsContainerHTMLSlotElement
skipButtonDecisionComponent
currentSubSelectionSubjectWrapper[][]
pagedItemsnumber
decisionElementsA derived selector for all oe-decision, oe-verification and oe-classification elementsDecisionComponentUnion[]
keydownHandler
keyupHandler
blurHandler
intersectionHandler
selectionHandler
decisionHandler
intersectionObservernew IntersectionObserver(this.intersectionHandler)
subjectHistorySubjectWrapper[][]
currentPageSubjectWrapper[][]
hiddenTilesnumber0
decisionsDisabledbooleanfalse
showingSelectionShortcutsbooleanfalse
selectionHeadnumber | nullnull
doneRenderBoxInitbooleanfalse
highlightHighlightSelection{ start: { x: 0, y: 0 }, current: { x: 0, y: 0 }, highlighting: false, elements: [], }
paginationFetcherGridPageFetcher | undefined

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