Skip to content

Commit bc31204

Browse files
committed
add disable filter button to show all annotaitons
1 parent 69773b6 commit bc31204

File tree

10 files changed

+72
-3
lines changed

10 files changed

+72
-3
lines changed

client/dive-common/components/ConfidenceFilter.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export default defineComponent({
2121
type: String,
2222
default: null,
2323
},
24+
disabled: {
25+
type: Boolean,
26+
default: false,
27+
},
2428
},
2529
setup(props, { emit }) {
2630
function _updateConfidence(event: InputEvent & {target: {value: string}}) {
@@ -61,6 +65,7 @@ export default defineComponent({
6165
<input
6266
type="range"
6367
style="width: 100%"
68+
:disabled="disabled"
6469
:min="min"
6570
:max="1"
6671
:step="0.01"

client/dive-common/components/Sidebar.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export default defineComponent({
120120
typeSettings,
121121
readOnlyMode,
122122
styleManager,
123+
showAllAnnoations: trackFilterControls.showAllAnnotations,
123124
visible,
124125
/* methods */
125126
doToggleMerge,
@@ -157,6 +158,7 @@ export default defineComponent({
157158
:width="width"
158159
:style-manager="styleManager"
159160
:filter-controls="trackFilterControls"
161+
:disabled="showAllAnnoations"
160162
class="flex-shrink-1 flex-grow-1"
161163
>
162164
<template #settings>
@@ -175,6 +177,7 @@ export default defineComponent({
175177
:lock-types="typeSettings.lockTypes"
176178
:hotkeys-disabled="visible() || readOnlyMode"
177179
:height="bottomHeight"
180+
:disabled="showAllAnnoations"
178181
@track-seek="$emit('track-seek', $event)"
179182
>
180183
<template slot="settings">

client/dive-common/components/TypeThreshold.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { defineComponent } from 'vue';
2+
import { computed, defineComponent } from 'vue';
33
import {
44
useDatasetId,
55
useTrackFilters,
@@ -30,10 +30,13 @@ export default defineComponent({
3030
saveThreshold();
3131
}
3232
33+
const showAllAnnotationsRef = computed(() => trackFilters.showAllAnnotations.value);
34+
3335
return {
3436
checkedTypesRef: trackFilters.checkedTypes,
3537
confidenceFiltersRef: trackFilters.confidenceFilters,
3638
typeStylingRef: useTrackStyleManager().typeStyling,
39+
showAllAnnotationsRef,
3740
resetThresholds,
3841
saveThreshold,
3942
};
@@ -48,6 +51,7 @@ export default defineComponent({
4851
</span>
4952
<v-divider class="my-3" />
5053
<ConfidenceFilter
54+
:disabled="showAllAnnotationsRef"
5155
:confidence.sync="confidenceFiltersRef.default"
5256
text="Base Confidence Threshold"
5357
@end="saveThreshold"
@@ -59,6 +63,7 @@ export default defineComponent({
5963
class="slidercontainer"
6064
>
6165
<ConfidenceFilter
66+
:disabled="showAllAnnotationsRef"
6267
:confidence.sync="confidenceFiltersRef[type]"
6368
:text="type"
6469
:color="typeStylingRef.color(type)"

client/dive-common/components/Viewer.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,10 @@ export default defineComponent({
827827
useAttributeFilters,
828828
);
829829
830+
const showAllAnnotations = computed(() => (
831+
trackFilters.showAllAnnotations.value
832+
));
833+
830834
return {
831835
/* props */
832836
aggregateController,
@@ -868,6 +872,7 @@ export default defineComponent({
868872
readonlyState,
869873
imageEnhancementOutputs,
870874
isDefaultImage,
875+
showAllAnnotations,
871876
/* large image methods */
872877
getTiles,
873878
getTileURL,
@@ -1097,6 +1102,7 @@ export default defineComponent({
10971102
v-if="context.state.active !== 'TypeThreshold'"
10981103
class="ma-2 mb-0"
10991104
:confidence.sync="confidenceFilters.default"
1105+
:disabled="showAllAnnotations"
11001106
@end="saveThreshold"
11011107
>
11021108
<a

client/src/BaseFilterControls.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export default abstract class BaseFilterControls<T extends Track | Group> {
8383

8484
removeTypes: (id: AnnotationId, types: string[]) => ConfidencePair[];
8585

86+
showAllAnnotations: Ref<boolean>;
87+
8688
constructor(params: FilterControlsParams<T>) {
8789
this.checkedIDs = ref(params.sorted.value.map((t) => t.id));
8890

@@ -102,6 +104,8 @@ export default abstract class BaseFilterControls<T extends Track | Group> {
102104

103105
this.markChangesPending = params.markChangesPending;
104106

107+
this.showAllAnnotations = ref(false);
108+
105109
this.allTypes = computed(() => {
106110
const typeSet = new Set<string>();
107111
this.sorted.value.forEach((annotation) => {

client/src/TrackFilterControls.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default class TrackFilterControls extends BaseFilterControls<Track> {
4343
const resultsArr: AnnotationWithContext<Track>[] = [];
4444
const resultsIds: Set<AnnotationId> = new Set();
4545
params.sorted.value.forEach((annotation) => {
46-
if (this.timeFilters.value !== null) {
46+
if (this.timeFilters.value !== null && !this.showAllAnnotations.value) {
4747
const [startTime, endTime] = this.timeFilters.value;
4848
if (annotation.begin > endTime || annotation.end < startTime) {
4949
return;
@@ -78,14 +78,17 @@ export default class TrackFilterControls extends BaseFilterControls<Track> {
7878
confidencePairIndex = -1;
7979
}
8080
}
81+
if (this.showAllAnnotations.value) {
82+
confidencePairIndex = 0;
83+
}
8184
/* include annotations where at least 1 confidence pair is above
8285
* the threshold and part of the checked type set */
8386
if (
8487
(confidencePairIndex >= 0 || annotation.confidencePairs.length === 0)
8588
&& enabledInGroupFilters && !resultsIds.has(annotation.id)
8689
) {
8790
let addValue = true;
88-
if (this.attributeFilters.value.length > 0 && params.getTrack !== undefined
91+
if (!this.showAllAnnotations.value && this.attributeFilters.value.length > 0 && params.getTrack !== undefined
8992
&& this.enabledFilters.value.length > 0) {
9093
addValue = trackIdPassesFilter(
9194
annotation.id,

client/src/components/FilterList.vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ export default defineComponent({
278278
279279
const showMaxFrameButton = computed(() => clientSettings.typeSettings.maxCountButton);
280280
281+
const showAllAnnotations = computed({
282+
get: () => props.filterControls.showAllAnnotations.value,
283+
set: (val: boolean) => {
284+
// eslint-disable-next-line no-param-reassign
285+
props.filterControls.showAllAnnotations.value = val;
286+
},
287+
});
288+
281289
return {
282290
data,
283291
headCheckState,
@@ -293,6 +301,7 @@ export default defineComponent({
293301
virtualTypes,
294302
readOnlyMode,
295303
filteredTracksRef,
304+
showAllAnnotations,
296305
/* methods */
297306
clickDelete,
298307
clickEdit,
@@ -322,13 +331,31 @@ export default defineComponent({
322331
<v-checkbox
323332
:input-value="headCheckState !== -1 ? headCheckState : false"
324333
:indeterminate="headCheckState === -1"
334+
:disabled="showAllAnnotations"
325335
dense
326336
shrink
327337
hide-details
328338
color="white"
329339
class="my-1 type-checkbox mt-0"
330340
@change="headCheckClicked"
331341
/>
342+
<v-tooltip
343+
open-delay="100"
344+
bottom
345+
>
346+
<template #activator="{ on }">
347+
<v-icon
348+
small
349+
class="mr-1 hover-show-child"
350+
:color="showAllAnnotations ? 'primary' : ''"
351+
v-on="on"
352+
@click="showAllAnnotations = !showAllAnnotations"
353+
>
354+
mdi-filter-off-outline
355+
</v-icon>
356+
</template>
357+
<span>Disable Filters and Show All Annotations</span>
358+
</v-tooltip>
332359
<v-tooltip
333360
open-delay="100"
334361
bottom
@@ -396,6 +423,7 @@ export default defineComponent({
396423
:confidence-filter-num="item.confidenceFilterNum"
397424
:width="width"
398425
:display-max-button="showMaxFrameButton"
426+
:disabled="showAllAnnotations"
399427
@setCheckedTypes="updateCheckedType($event, item.type)"
400428
@goToMaxFrame="goToPeakTrackFrame($event)"
401429
@clickEdit="clickEdit"

client/src/components/TrackItem.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ export default defineComponent({
5757
type: Boolean,
5858
default: false,
5959
},
60+
disabled: {
61+
type: Boolean,
62+
default: false,
63+
},
6064
},
6165
6266
setup(props, { emit }) {
@@ -219,6 +223,7 @@ export default defineComponent({
219223
class="my-0 ml-1 pt-0"
220224
dense
221225
hide-details
226+
:disabled="disabled"
222227
:input-value="inputValue"
223228
:color="color"
224229
@change="trackFilters.updateCheckedId(track.trackId, $event)"

client/src/components/TrackList.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export default defineComponent({
5151
type: Number,
5252
default: 420,
5353
},
54+
disabled: {
55+
type: Boolean,
56+
default: false,
57+
},
5458
},
5559
5660
setup(props) {
@@ -348,6 +352,7 @@ export default defineComponent({
348352
<track-item
349353
v-bind="getItemProps(item)"
350354
:lock-types="lockTypes"
355+
:disabled="disabled"
351356
@seek="$emit('track-seek', $event)"
352357
/>
353358
</template>

client/src/components/TypeItem.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export default defineComponent({
3636
type: Boolean,
3737
default: false,
3838
},
39+
disabled: {
40+
type: Boolean,
41+
default: false,
42+
},
3943
},
4044
setup(props, { emit }) {
4145
/* Horizontal padding is the width of checkbox, scrollbar, and edit button */
@@ -67,6 +71,7 @@ export default defineComponent({
6771
<v-checkbox
6872
:input-value="checked"
6973
:color="color"
74+
:disabled="disabled"
7075
dense
7176
shrink
7277
hide-details

0 commit comments

Comments
 (0)