From 2bd521eacce1f2299ee27bf698b9bbb0be3968fb Mon Sep 17 00:00:00 2001 From: EmmaLRussell Date: Tue, 11 Jun 2024 16:24:01 +0100 Subject: [PATCH] add graph --- app/static/src/app/components/code/CodeTab.vue | 13 +++++++++++-- .../src/app/components/code/SelectedVariables.vue | 14 ++++++++++---- .../src/app/components/mixins/baseSensitivity.ts | 2 +- .../src/app/components/options/LinkData.vue | 2 +- app/static/src/app/components/run/RunPlot.vue | 12 ++++++++---- .../src/app/components/run/RunStochasticPlot.vue | 2 +- app/static/src/app/components/run/RunTab.vue | 15 ++++++++++++--- .../sensitivity/SensitivitySummaryPlot.vue | 2 +- .../sensitivity/SensitivityTracesPlot.vue | 2 +- .../src/app/excel/wodinModelOutputDownload.ts | 4 ++-- app/static/src/app/serialise.ts | 6 +++--- app/static/src/app/store/fitData/actions.ts | 2 +- app/static/src/app/store/model/actions.ts | 4 ++-- app/static/src/app/store/model/model.ts | 2 +- app/static/src/app/store/model/mutations.ts | 6 ++++++ 15 files changed, 61 insertions(+), 27 deletions(-) diff --git a/app/static/src/app/components/code/CodeTab.vue b/app/static/src/app/components/code/CodeTab.vue index f72d3260..7c020e76 100644 --- a/app/static/src/app/components/code/CodeTab.vue +++ b/app/static/src/app/components/code/CodeTab.vue @@ -16,7 +16,9 @@
- +
Click to toggle variables to include in graphs.
+ +
@@ -60,6 +62,11 @@ export default defineComponent({ const appIsConfigured = computed(() => store.state.configured); const compile = () => store.dispatch(`model/${ModelAction.CompileModel}`); const loadingMessage = userMessages.code.isValidating; + const graphKeys = computed(() => Object.keys(store.state.model.graphs)); + const addGraph = () => { + const newGraphKey = `Graph ${Object.keys(store.state.model.graphs).length + 1}`; + store.dispatch(`model/${ModelAction.UpdateSelectedVariables}`, { key: newGraphKey, selectedVariables: [] }); + }; return { appIsConfigured, @@ -72,7 +79,9 @@ export default defineComponent({ showSelectedVariables, codeHelp, codeValidating, - loadingMessage + loadingMessage, + graphKeys, + addGraph }; } }); diff --git a/app/static/src/app/components/code/SelectedVariables.vue b/app/static/src/app/components/code/SelectedVariables.vue index f774b7fd..311faec7 100644 --- a/app/static/src/app/components/code/SelectedVariables.vue +++ b/app/static/src/app/components/code/SelectedVariables.vue @@ -1,6 +1,6 @@