From 7b7f8cd594ba24bdc289faf4cbaacda196bc46fd Mon Sep 17 00:00:00 2001 From: Brianna Major Date: Wed, 9 Aug 2023 16:30:42 -0400 Subject: [PATCH 01/21] Update ui and plot state for plot display options We will need to support the user being able to select whether or not to display plot axes, scalar bars, titles, etc. Plots should also default to applying the global range with the option to turn off. Add these options to the state. Signed-off-by: Brianna Major --- client/src/store/plot.js | 34 +++++++++++++++++++++++++++ client/src/store/ui.js | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/client/src/store/plot.js b/client/src/store/plot.js index 9ddeac86..658239de 100644 --- a/client/src/store/plot.js +++ b/client/src/store/plot.js @@ -10,6 +10,9 @@ export default { times: null, loadedTimeStepData: null, availableTimeSteps: null, + xRange: null, + yRange: null, + colorRange: null, }), getters: { PLOT_LEGEND_VISIBILITY(state) { @@ -42,6 +45,15 @@ export default { PLOT_AVAILABLE_TIME_STEPS(state) { return state.availableTimeSteps; }, + PLOT_X_RANGE(state) { + return state.xRange; + }, + PLOT_Y_RANGE(state) { + return state.yRange; + }, + PLOT_COLOR_RANGE(state) { + return state.colorRange; + }, }, mutations: { PLOT_LEGEND_VISIBILITY_SET(state, val) { @@ -71,6 +83,15 @@ export default { PLOT_AVAILABLE_TIME_STEPS_SET(state, val) { state.availableTimeSteps = val; }, + PLOT_X_RANGE_SET(state, val) { + state.xRange = val; + }, + PLOT_Y_RANGE_SET(state, val) { + state.yRange = val; + }, + PLOT_COLOR_RANGE_SET(state, val) { + state.colorRange = val; + }, }, actions: { PLOT_DATA_RESET({ commit }) { @@ -112,5 +133,18 @@ export default { commit("VIEW_TIME_STEP_SET", newCurr, { root: true }); } }, + PLOT_META_DATA_CHANGED({ commit, dispatch }, meta) { + dispatch("PLOT_AVAILABLE_TIME_STEPS_CHANGED", meta.steps); + + if (meta?.x_range) { + commit("PLOT_X_RANGE_SET", meta.x_range); + } + if (meta?.y_range) { + commit("PLOT_Y_RANGE_SET", meta.y_range); + } + if (meta?.color_range) { + commit("PLOT_COLOR_RANGE_SET", meta.color_range); + } + }, }, }; diff --git a/client/src/store/ui.js b/client/src/store/ui.js index c7ea0195..abbcc527 100644 --- a/client/src/store/ui.js +++ b/client/src/store/ui.js @@ -25,6 +25,11 @@ export default { boxSelector: null, showSettings: false, autoSavedViewDialogEnabled: true, + useRunGlobals: true, + showXAxis: false, + showYAxis: false, + showScalarBar: false, + showTitle: false, }, getters: { UI_AUTO_SAVE_DIALOG(state) { @@ -75,6 +80,21 @@ export default { UI_AUTO_SAVE_DIALOG_ENABLED(state) { return state.autoSavedViewDialogEnabled; }, + UI_USE_RUN_GLOBALS(state) { + return state.useRunGlobals; + }, + UI_SHOW_X_AXIS(state) { + return state.showXAxis; + }, + UI_SHOW_Y_AXIS(state) { + return state.showYAxis; + }, + UI_SHOW_SCALAR_BAR(state) { + return state.showScalarBar; + }, + UI_SHOW_TITLE(state) { + return state.showTitle; + }, }, mutations: { UI_AUTO_SAVE_DIALOG_SET(state, val) { @@ -122,6 +142,21 @@ export default { UI_AUTO_SAVE_DIALOG_ENABLED_SET(state, val) { state.autoSavedViewDialogEnabled = val; }, + UI_USE_RUN_GLOBALS_SET(state, val) { + state.useRunGlobals = val; + }, + UI_SHOW_X_AXIS_SET(state, val) { + state.showXAxis = val; + }, + UI_SHOW_Y_AXIS_SET(state, val) { + state.showYAxis = val; + }, + UI_SHOW_SCALAR_BAR_SET(state, val) { + state.showScalarBar = val; + }, + UI_SHOW_TITLE(state, val) { + state.showTitle = val; + }, }, actions: { UI_TOGGLE_PLAY_PAUSE({ state }) { @@ -136,5 +171,20 @@ export default { UI_TOGGLE_SHOW_SETTINGS({ state }) { state.showSettings = !state.showSettings; }, + UI_TOGGLE_RUN_GLOBALS({ state }) { + state.useRunGlobals = !state.useRunGlobals; + }, + UI_TOGGLE_X_AXIS({ state }) { + state.showXAxis = !state.showXAxis; + }, + UI_TOGGLE_Y_AXIS({ state }) { + state.showYAxis = !state.showYAxis; + }, + UI_TOGGLE_SCALAR_BAR({ state }) { + state.showScalarBar = !state.showScalarBar; + }, + UI_TOGGLE_TITLE({ state }) { + state.showTitle = !state.showTitle; + }, }, }; From 061235f54639a323b25c2078d1dc8704d971601e Mon Sep 17 00:00:00 2001 From: Brianna Major Date: Wed, 9 Aug 2023 16:52:51 -0400 Subject: [PATCH 02/21] Add toggle buttons for plot settings Signed-off-by: Brianna Major --- .../widgets/SettingsPanel/script.js | 25 ++++++ .../widgets/SettingsPanel/template.html | 82 +++++++++++++++++-- 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/client/src/components/widgets/SettingsPanel/script.js b/client/src/components/widgets/SettingsPanel/script.js index 6ae8bba8..24dcd8eb 100644 --- a/client/src/components/widgets/SettingsPanel/script.js +++ b/client/src/components/widgets/SettingsPanel/script.js @@ -17,6 +17,11 @@ export default { zoomSync: true, selectTimeStep: false, autoSavePrompt: true, + runGlobals: true, + xAxis: false, + yAxis: false, + scalarBar: false, + title: false, }; }, @@ -37,6 +42,21 @@ export default { autoSavePrompt(status) { this.setAutoSaveDialogEnabled(status); }, + runGlobals() { + this.toggleRunGlobals(); + }, + xAxis() { + this.toggleXAxis(); + }, + yAxis() { + this.toggleYAxis(); + }, + scalarBar() { + this.toggleScalarBar(); + }, + title() { + this.toggleTitle(); + }, }, methods: { @@ -45,6 +65,11 @@ export default { toggleSelectTimeStep: "UI_TOGGLE_TIME_STEP", fetchAllViews: "VIEWS_FETCH_ALL_AVAILABLE", toggleShowSettings: "UI_TOGGLE_SHOW_SETTINGS", + toggleRunGlobals: "UI_TOGGLE_RUN_GLOBALS", + toggleXAxis: "UI_TOGGLE_X_AXIS", + toggleYAxis: "UI_TOGGLE_Y_AXIS", + toggleScalarBar: "UI_TOGGLE_SCALAR_BAR", + toggleTitle: "UI_TOGGLE_TITLE", }), ...mapMutations({ setPaused: "UI_PAUSE_GALLERY_SET", diff --git a/client/src/components/widgets/SettingsPanel/template.html b/client/src/components/widgets/SettingsPanel/template.html index 6171d163..a6284def 100644 --- a/client/src/components/widgets/SettingsPanel/template.html +++ b/client/src/components/widgets/SettingsPanel/template.html @@ -27,7 +27,7 @@ - +