Skip to content

Commit

Permalink
slight refactor on displaying the query 'name'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoertl committed Aug 11, 2024
1 parent 88ed40f commit c5b7616
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 29 deletions.
9 changes: 3 additions & 6 deletions src/components/DataDisplay/DataDisplayKeywordInContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ const showIds = ref(false);
<div v-for="(query, index) of queries" :key="query.id">
<VCheckbox v-model="showViewOptionsMode" :label="t('viewOptions')"></VCheckbox>
<KWICAttributeSelect v-if="showViewOptionsMode" :query="query" @refresh="refresh()" />
<div v-if="!KWICresultsLoading[index]">
<span :style="`color: ${query.color}`">
{{ query.type }}: {{ query.userInput }}
<CorpusChip :query="query" />
</span>
<div>
<QueryDisplay :query="query" :loading="KWICresultsLoading[index]" />
<VDataTable
v-if="!KWICresultsLoading[index]"
density="compact"
:headers="headers"
item-value="docid"
Expand Down Expand Up @@ -141,7 +139,6 @@ const showIds = ref(false);
@close="selectedKWIC = null"
/>
</div>
<VProgressCircular v-else :color="query.color" indeterminate></VProgressCircular>
</div>
</VCardText>

Expand Down
3 changes: 1 addition & 2 deletions src/components/DataDisplay/DataDisplayMediaSource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ const isStacked = computed(() => chartMode.value === "stack");
</div>
<div v-for="(query, index) of queries" :key="query.id">
<div v-if="sourceDistributionsLoading[index]">
<VProgressCircular :color="query.color" indeterminate></VProgressCircular>
<span :style="`color: ${query.color}`">{{ query.type }}: {{ query.userInput }}</span>
<QueryDisplay :query="query" :loading="sourceDistributionsLoading[index]" />
</div>
</div>
<!-- {{ series }} -->
Expand Down
16 changes: 3 additions & 13 deletions src/components/DataDisplay/DataDisplayRegionalFrequencies.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,9 @@ const expand = ref(false);
<!-- <JsonViewer boxed :value="regionalFrequencies" :expand-depth="5"></JsonViewer> -->

<div v-for="(query, index) of queries" :key="query.id">
<div v-if="regionalFrequenciesLoading[index]" class="mt-1">
<VProgressCircular :color="query.color" indeterminate></VProgressCircular>
<span :style="`color: ${query.color}`">
{{ query.type }}: {{ query.userInput }}
<CorpusChip :query="query" />
</span>
</div>
</div>
<div v-for="(query, index) of queries" :key="query.id">
<div v-if="!regionalFrequenciesLoading[index]" class="mt-1">
<span :style="`color: ${query.color}`">{{ query.type }}: {{ query.userInput }}</span>
<CorpusChip :query="query" />
<ClientOnly>
<div class="mt-1">
<QueryDisplay :query="query" :loading="regionalFrequenciesLoading[index]" />
<ClientOnly v-if="!regionalFrequenciesLoading[index]">
<MapChart
v-if="!isCombined"
:query="query"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ const expand = ref(false);
<VBtn variant="outlined" value="relative">{{ t("relative") }}</VBtn>
</VBtnToggle>
<div v-for="(query, index) of queries" :key="query.id">
<div v-if="wordFormFrequenciesLoading[index]">
<VProgressCircular :color="query.color" indeterminate></VProgressCircular>
<span :style="`color: ${query.color}`">{{ query.type }}: {{ query.userInput }}</span>
</div>
<QueryDisplay :query="query" :loading="wordFormFrequenciesLoading[index]" />
<HighCharts
:options="{
chart: {
Expand Down
5 changes: 1 addition & 4 deletions src/components/DataDisplay/DataDisplayYearlyFrequencies.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ const series = computed(() =>
<VBtn variant="outlined" value="relative">{{ t("relative") }}</VBtn>
</VBtnToggle>
<div v-for="(query, index) of queries" :key="query.id">
<div v-if="yearlyFrequenciesLoading[index]">
<VProgressCircular :color="query.color" indeterminate></VProgressCircular>
<span :style="`color: ${query.color}`">{{ query.type }}: {{ query.userInput }}</span>
</div>
<QueryDisplay :query="query" :loading="yearlyFrequenciesLoading[index]" />
</div>
<HighCharts
:options="{
Expand Down
18 changes: 18 additions & 0 deletions src/components/QueryDisplay.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts" setup>
defineProps<{ query: CorpusQuery; loading: { type: boolean; default: false } }>();
</script>

<template>
<div class="my-1">
<VProgressCircular
v-if="loading"
class="mr-1"
:color="query.color"
indeterminate
></VProgressCircular>
<span :style="`color: ${query.color}`">{{ query.type }}: {{ query.userInput }}</span>
<CorpusChip class="ml-1" :query="query" />
</div>
</template>

<style lang="postcss" scoped></style>

0 comments on commit c5b7616

Please sign in to comment.