From 2eea8ccf0f7baf0025663842139f7f51dca81692 Mon Sep 17 00:00:00 2001 From: Brandon Davis Date: Tue, 15 Feb 2022 09:46:32 -0500 Subject: [PATCH 1/3] WIP --- .../components/AnnotatorWrapper.vue | 196 ------------ .../components/ConfidenceFilter.vue | 4 +- .../components/ControlsContainer.vue | 15 +- client/dive-common/components/Sidebar.vue | 12 +- client/dive-common/components/Viewer.vue | 106 ++++--- client/dive-common/use/useModeManager.ts | 20 +- client/dive-common/use/useRequest.ts | 3 +- client/src/components/LayerManager.vue | 5 +- .../components/annotators/ImageAnnotator.vue | 42 ++- .../components/annotators/VideoAnnotator.vue | 37 +-- .../annotators/mediaControllerType.ts | 79 +++-- .../annotators/useMediaController.ts | 280 +++++++++++------- client/src/components/controls/Controls.vue | 14 +- .../controls/FileNameTimeDisplay.vue | 27 +- 14 files changed, 363 insertions(+), 477 deletions(-) delete mode 100644 client/dive-common/components/AnnotatorWrapper.vue diff --git a/client/dive-common/components/AnnotatorWrapper.vue b/client/dive-common/components/AnnotatorWrapper.vue deleted file mode 100644 index f527276f2..000000000 --- a/client/dive-common/components/AnnotatorWrapper.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/client/dive-common/components/ConfidenceFilter.vue b/client/dive-common/components/ConfidenceFilter.vue index 915d1d899..34596543b 100644 --- a/client/dive-common/components/ConfidenceFilter.vue +++ b/client/dive-common/components/ConfidenceFilter.vue @@ -25,9 +25,7 @@ export default defineComponent({ setup(props, { emit }) { function _updateConfidence(event: InputEvent) { if (event.target) { - // eslint-disable-next-line @typescript-eslint/ban-ts-ignore - // @ts-ignore - emit('update:confidence', Number.parseFloat(event.target.value)); + emit('update:confidence', Number.parseFloat((event.target as HTMLInputElement).value)); } } function _emitEnd() { diff --git a/client/dive-common/components/ControlsContainer.vue b/client/dive-common/components/ControlsContainer.vue index de8921aa0..7d4d2cacf 100644 --- a/client/dive-common/components/ControlsContainer.vue +++ b/client/dive-common/components/ControlsContainer.vue @@ -7,10 +7,10 @@ import FileNameTimeDisplay from 'vue-media-annotator/components/controls/FileNam import { Controls, EventChart, + injectAggregateController, LineChart, Timeline, } from 'vue-media-annotator/components'; -import { MediaControlAggregator } from 'vue-media-annotator/components/annotators/mediaControllerType'; export default defineComponent({ components: { @@ -20,6 +20,7 @@ export default defineComponent({ LineChart, Timeline, }, + props: { lineChartData: { type: Array as PropType, @@ -33,13 +34,9 @@ export default defineComponent({ type: String as PropType, required: true, }, - mediaControls: { - type: Object as PropType, - required: true, - }, }, - setup(props) { + setup() { const currentView = ref('Detections'); const collapsed = ref(false); @@ -55,7 +52,7 @@ export default defineComponent({ } const { maxFrame, frame, seek, volume, setVolume, setSpeed, speed, - } = props.mediaControls; + } = injectAggregateController().value; return { currentView, @@ -79,7 +76,7 @@ export default defineComponent({ dense style="position:absolute; bottom: 0px; padding: 0px; margin:0px;" > - +