Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jamie dataset preview toggle histograms #1586

Merged
merged 15 commits into from
Jul 28, 2023
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
1b3f539
feat: darker text in content switcher buttons
jamiewaese-uncharted Jul 13, 2023
696ff88
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 14, 2023
3f29442
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 14, 2023
8d271e0
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 14, 2023
9e059d3
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 17, 2023
0733410
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 17, 2023
36bbf01
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 18, 2023
fb88e51
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 19, 2023
6bb287f
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 19, 2023
1cdc024
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 19, 2023
1919fd1
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 20, 2023
dc47094
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 21, 2023
6f52d1e
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 24, 2023
cfe96d5
Added summary row and toggle button to the top row of datatables
jamiewaese-uncharted Jul 25, 2023
9856258
Merge branch 'main' into jamie-dataset-preview-toggle-histograms
jamiewaese-uncharted Jul 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<!-- column summary charts below -->
<template>
<!-- Toggle histograms & column summary charts -->
<div class="datatable-toolbar">
<span class="datatable-toolbar-item"
>{{ csvHeaders?.length || 'No' }} columns | {{ csvContent?.length || 'No' }} rows</span
>
<span class="datatable-toolbar-item"
>Show column summaries<InputSwitch v-model="showSummaries"
/></span>
</div>
YohannParis marked this conversation as resolved.
Show resolved Hide resolved
<!-- Datable -->
<DataTable
:class="previewMode ? 'p-datatable-xsm' : 'p-datatable-sm'"
:value="csvContent?.slice(1, csvContent.length)"
Expand All @@ -24,7 +33,7 @@
>
<template #header>
<!-- column summary charts below -->
<div v-if="!previewMode && props.rawContent?.stats" class="column-summary">
<div v-if="!previewMode && props.rawContent?.stats && showSummaries" class="column-summary">
<div class="column-summary-row">
<span class="column-summary-label">Max:</span>
<span class="column-summary-value">{{ csvMaxsToDisplay?.at(index) }}</span>
Expand Down Expand Up @@ -59,11 +68,12 @@
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { computed, ref } from 'vue';
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import Chart from 'primevue/chart';
import { CsvAsset } from '@/types/Types';
import InputSwitch from 'primevue/inputswitch';

const props = defineProps<{
rawContent: CsvAsset | null; // Temporary - this is also any in ITypeModel
Expand All @@ -78,6 +88,8 @@ const CATEGORYPERCENTAGE = 0.9;
const BARPERCENTAGE = 1.0;
const MINBARLENGTH = 1;

const showSummaries = ref(true);

const csvContent = computed(() => props.rawContent?.csv);
const csvHeaders = computed(() => props.rawContent?.headers);
const chartData = computed(() =>
Expand Down Expand Up @@ -182,6 +194,21 @@ const setChartOptions = () => {
</script>

<style scoped>
.datatable-toolbar {
display: flex;
flex-direction: row;
gap: 1rem;
}
.datatable-toolbar-item {
display: flex;
flex-direction: row;
padding: 0 0.5rem 0.5rem 0.5rem;
font-size: var(--font-caption);
color: var(--text-color-subdued);
align-items: center;
gap: 0.5rem;
}

.p-datatable:deep(.p-column-header-content) {
display: grid;
grid-template-areas:
Expand Down