From d93a608f79e48cacca534422464c39269f697b92 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 7 Sep 2023 12:15:09 +0200 Subject: [PATCH 1/2] store all selections --- report-viewer/src/stores/state.ts | 12 +++++++++ report-viewer/src/stores/store.ts | 8 +++++- report-viewer/src/views/OverviewView.vue | 34 +++++++++++++++--------- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/report-viewer/src/stores/state.ts b/report-viewer/src/stores/state.ts index c49794467..43cbad1a3 100644 --- a/report-viewer/src/stores/state.ts +++ b/report-viewer/src/stores/state.ts @@ -1,3 +1,5 @@ +import type { MetricType } from '@/model/MetricType' + /** * Local store. Stores the state of the application. */ @@ -68,4 +70,14 @@ export interface LoadConfiguration { export interface UIState { useDarkMode: boolean + comparisonTableSortingMetric: MetricType + distributionChartConfig: DistributionChartConfig +} + +/** + * Configuration for the distribution chart. + */ +export interface DistributionChartConfig { + metric: MetricType + xScale: 'linear' | 'logarithmic' } diff --git a/report-viewer/src/stores/store.ts b/report-viewer/src/stores/store.ts index 9b6512af5..d18fabbb5 100644 --- a/report-viewer/src/stores/store.ts +++ b/report-viewer/src/stores/store.ts @@ -1,5 +1,6 @@ import { defineStore } from 'pinia' import type { State, SubmissionFile, File, LoadConfiguration, UIState } from './state' +import { MetricType } from '@/model/MetricType' /** * The store is a global state management system. It is used to store the state of the application. @@ -20,7 +21,12 @@ const store = defineStore('store', { fileIdToDisplayName: new Map() }, uiState: { - useDarkMode: false + useDarkMode: false, + comparisonTableSortingMetric: MetricType.AVERAGE, + distributionChartConfig: { + metric: MetricType.AVERAGE, + xScale: 'linear' + } } }), getters: { diff --git a/report-viewer/src/views/OverviewView.vue b/report-viewer/src/views/OverviewView.vue index 4da8aca4d..870c174f4 100644 --- a/report-viewer/src/views/OverviewView.vue +++ b/report-viewer/src/views/OverviewView.vue @@ -26,8 +26,8 @@

Distribution of Comparisons:

@@ -36,16 +36,21 @@ @@ -71,8 +76,9 @@