Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions app/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const initConfig = () => {
const defaultConfig = {
simulation_round: 'ISIMIP3a',
sectors: [],
experiments: [],
groups: [],
group3: false
}
Expand Down
433 changes: 244 additions & 189 deletions app/src/components/tables/ExperimentsTable.js

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions app/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const actions = {
changeSector: function(value) {
return { type: 'changeSector', value }
},
toggleExperiments: function(value) {
return { type: 'toggleExperiments', value }
},
toggleGroup: function(value) {
return { type: 'toggleGroup', value }
},
Expand All @@ -31,11 +34,24 @@ function reducer(state, action) {
}
}
}
case 'toggleExperiments': {
if (state.config.experiments.find((value) => value === action.value)) {
return {
...state,
config: { ...state.config, experiments: state.config.experiments.filter((value) => value !== action.value) }
}
} else {
return {
...state,
config: { ...state.config, experiments: [...state.config.experiments, action.value] }
}
}
}
case 'toggleGroup': {
if (state.config.groups.find((group) => group === action.value)) {
if (state.config.groups.find((value) => value === action.value)) {
return {
...state,
config: { ...state.config, groups: state.config.groups.filter((group) => group !== action.value) }
config: { ...state.config, groups: state.config.groups.filter((value) => value !== action.value) }
}
} else {
return {
Expand Down
6 changes: 6 additions & 0 deletions app/src/utils/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const getConfig = () => {
config.sectors = sectors
}

const experiments = ls.get('experiments') ? JSON.parse(ls.get('experiments')) : []
if (definitions.experiments.some((experiment) => experiments.includes(experiment.specifier))) {
config.experiments = experiments
}

const groups = ls.get('groups') ? JSON.parse(ls.get('groups')) : []
if (definitions.group.some((group) => groups.includes(group.specifier))) {
config.groups = groups
Expand All @@ -28,6 +33,7 @@ const getConfig = () => {
const updateConfig = (config) => {
ls.set('simulation_round', config.simulation_round)
ls.set('sectors', JSON.stringify(config.sectors))
ls.set('experiments', JSON.stringify(config.experiments))
ls.set('groups', JSON.stringify(config.groups))
ls.set('group3', JSON.stringify(config.group3))
}
Expand Down
17 changes: 17 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ a.toggle-group {
display: block;
float: right;
}
.experiments-toggle {
font-weight: bold;
}
.experiments-toggle a.toggle-group {
float: none;
}
a.toggle-group {
position: relative;
margin-right: 15px;
Expand Down Expand Up @@ -125,6 +131,14 @@ button.toggle-table {
button.toggle-table:focus {
outline: 0;
}
tr.separator td {
padding: 1px 0 0 0;
background-color: #dee2e6;
}
tr.sens-title td {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
td :last-child {
margin-bottom: 0;
}
Expand All @@ -144,6 +158,9 @@ td > ul > li > ul > li {
td p {
margin-bottom: 0.5rem;
}
td.background {
background-color: #efefef;
}
td.extra-border-bottom {
border-bottom-width: 3px;
}
Expand Down
21 changes: 21 additions & 0 deletions definitions/experiments/ISIMIP3a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
- forestry

- specifier: obsclim_histsoc_1901co2
parent: obsclim_histsoc_default
title: CO₂ sensitivity
subtitles:
- obsclim_histsoc_1901co2
Expand Down Expand Up @@ -210,6 +211,7 @@
- water_regional

- specifier: obsclim_2015soc_1901co2
parent: obsclim_2015soc_default
title: CO₂ sensitivity
subtitles:
- obsclim_2015soc_1901co2
Expand All @@ -236,6 +238,7 @@
- water_regional

- specifier: obsclim_1901soc_1901co2
parent: obsclim_1901soc_default
title: CO₂ sensitivity
subtitles:
- obsclim_1901soc_1901co2
Expand All @@ -255,6 +258,7 @@
- water_global

- specifier: obsclim_histsoc_nowatermgt
parent: obsclim_histsoc_default
title: Water management sensitivity
subtitles:
- obsclim_histsoc_nowatermgt
Expand All @@ -271,6 +275,7 @@
- water_regional

- specifier: obsclim_2015soc_nowatermgt
parent: obsclim_2015soc_default
title: Water management sensitivity
subtitles:
- obsclim_2015soc_nowatermgt
Expand All @@ -287,6 +292,7 @@
- water_regional

- specifier: obsclim_histsoc_1901irr
parent: obsclim_histsoc_default
title: Irrigation sensitivity
subtitles:
- obsclim_histsoc_1901irr
Expand All @@ -302,6 +308,7 @@
- water_regional

- specifier: obsclim_histsoc_nofire
parent: obsclim_histsoc_default
title: No-fire sensitivity
subtitles:
- obsclim_histsoc_nofire
Expand All @@ -319,6 +326,7 @@
- permafrost

- specifier: counterclim_histsoc_obsco2
parent: obsclim_histsoc_default
title: Counterfactual climate and CO₂ sensitivity
subtitles:
- counterclim_histsoc_obsco2
Expand All @@ -334,6 +342,7 @@
- forestry

- specifier: obsclim_histsoc_30arcsec
parent: obsclim_histsoc_default
title: High-resolution sensitivity 1km
subtitles:
- obsclim_histsoc_30arcsec
Expand All @@ -355,6 +364,7 @@
- water_regional

- specifier: obsclim_histsoc_90arcsec
parent: obsclim_histsoc_default
title: High-resolution sensitivity 3km
subtitles:
- obsclim_histsoc_90arcsec
Expand All @@ -376,6 +386,7 @@
- water_regional

- specifier: obsclim_histsoc_300arcsec
parent: obsclim_histsoc_default
title: High-resolution sensitivity 10km
subtitles:
- obsclim_histsoc_300arcsec
Expand All @@ -399,6 +410,7 @@
- water_regional

- specifier: obsclim_histsoc_1800arcsec
parent: obsclim_histsoc_default
title: High-resolution sensitivity 60km
subtitles:
- obsclim_histsoc_1800arcsec
Expand Down Expand Up @@ -436,6 +448,7 @@
- marine-fishery_regional

- specifier: obsclim_histsoc_1955-riverine-input
parent: obsclim_histsoc_default
title: Riverine influx sensitivity
subtitles:
- obsclim_histsoc_1955-riverine-input
Expand All @@ -451,6 +464,7 @@
- marine-fishery_regional

- specifier: fishmip-nat-fixed-river-nutrients
parent: obsclim_nat_default_fishmip
title: Riverine influx sensitivity
subtitles:
- fishmip-nat-fixed-river-nutrients
Expand All @@ -466,6 +480,7 @@
- marine-fishery_regional

- specifier: obsclim_histsoc_60arcmin
parent: obsclim_histsoc_default
title: Resolution sensitivity
subtitles:
- obsclim_histsoc_60arcmin
Expand All @@ -481,6 +496,7 @@
- marine-fishery_regional

- specifier: obsclim_nat_60arcmin
parent: obsclim_nat_default_fishmip
title: Resolution sensitivity
subtitles:
- obsclim_nat_60arcmin
Expand All @@ -496,6 +512,7 @@
- marine-fishery_regional

- specifier: obsclim_histsoc_1955-riverine-input+60arcmin
parent: obsclim_histsoc_default
title: Riverine influx and resolution sensitivity
subtitles:
- obsclim_histsoc_1955-riverine-input+60arcmin
Expand All @@ -511,6 +528,7 @@
- marine-fishery_regional

- specifier: obsclim_nat_1955-riverine-input+60arcmin
parent: obsclim_nat_default_fishmip
title: Riverine influx and resolution sensitivity
subtitles:
- obsclim_nat_1955-riverine-input+60arcmin
Expand All @@ -526,6 +544,7 @@
- marine-fishery_regional

- specifier: obsclim_nat_1901co2
parent: obsclim_nat_default
historical:
climate: obsclim
climate_sens: 1901co2
Expand All @@ -538,6 +557,7 @@
- biomes

- specifier: obsclim_nat_nofire
parent: obsclim_nat_default
historical:
climate: obsclim
soc: nat
Expand All @@ -550,6 +570,7 @@
- biomes

- specifier: counterclim_nat_obsco2
parent: counterclim_nat_default
historical:
climate: counterclim
climate_sens: obsco2
Expand Down
Loading