Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsey-taylor committed Nov 27, 2023
2 parents da41f38 + 8fa4b5c commit 0aace58
Show file tree
Hide file tree
Showing 61 changed files with 446 additions and 230 deletions.
4 changes: 2 additions & 2 deletions vacs-map-app/scripts/generate-minimaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ const generateMapSvg = (crop, model, data, world, Africa, AfricanCountries, Afri

const columnName = `yieldratio_${crop}_${model}`;

const background = '#585855';
const land = "#444444";
const background = '#3B4650';
const land = "#343434";
const borders = background;
const shore = background;
const africanCountries = "#262626";
Expand Down
8 changes: 4 additions & 4 deletions vacs-map-app/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import { onMounted } from 'vue'
import { RouterView } from 'vue-router'
import { useCropYieldsStore } from '@/stores/cropYields'
import { useCropInformationStore } from './stores/cropInformation';
import { useCropInformationStore } from './stores/cropInformation'
const cropYieldsStore = useCropYieldsStore()
const cropInformationStore = useCropInformationStore();
const cropInformationStore = useCropInformationStore()
onMounted(() => {
cropYieldsStore.load();
cropInformationStore.load();
cropYieldsStore.load()
cropInformationStore.load()
})
</script>

Expand Down
32 changes: 16 additions & 16 deletions vacs-map-app/src/MapExplorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
</template>

<script setup>
import { computed } from 'vue';
import { storeToRefs } from 'pinia';
import MapContainerColor from '@/components/MapContainerColor.vue';
import MapContainerColorAcrossScenarios from './components/MapContainerColorAcrossScenarios.vue';
import MapContainerColorRadius from '@/components/MapContainerColorRadius.vue';
import MapContainerNotFilled from '@/components/MapContainerNotFilled.vue';
import MapContainerNotFilledTwoLayers from '@/components/MapContainerNotFilledTwoLayers.vue';
import MapContainerColorAfricanUnion from '@/components/MapContainerColorAfricanUnion.vue';
import MapContainerColorSandSoil from '@/components/MapContainerColorSandSoil.vue';
import MapContainerColorSoil from '@/components/MapContainerColorSoil.vue';
import MapContainerColorSand from '@/components/MapContainerColorSand.vue';
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import MapContainerColor from '@/components/MapContainerColor.vue'
import MapContainerColorAcrossScenarios from './components/MapContainerColorAcrossScenarios.vue'
import MapContainerColorRadius from '@/components/MapContainerColorRadius.vue'
import MapContainerNotFilled from '@/components/MapContainerNotFilled.vue'
import MapContainerNotFilledTwoLayers from '@/components/MapContainerNotFilledTwoLayers.vue'
import MapContainerColorAfricanUnion from '@/components/MapContainerColorAfricanUnion.vue'
import MapContainerColorSandSoil from '@/components/MapContainerColorSandSoil.vue'
import MapContainerColorSoil from '@/components/MapContainerColorSoil.vue'
import MapContainerColorSand from '@/components/MapContainerColorSand.vue'
import MapContainerColorPopulation from '@/components/MapContainerColorPopulation.vue';
import { useMapExploreStore } from '@/stores/mapExplore';
import LayoutOverview from './components/layouts/LayoutOverview.vue';
import ExploreSidebar from './components/ExploreSidebar.vue';
import { useMapExploreStore } from '@/stores/mapExplore'
import LayoutOverview from './components/layouts/LayoutOverview.vue'
import ExploreSidebar from './components/ExploreSidebar.vue'
const availableMaps = [
{
Expand All @@ -40,7 +40,7 @@ const availableMaps = [
{
id: 'color-across-scenarios',
name: 'color across scenarios',
component: MapContainerColorAcrossScenarios,
component: MapContainerColorAcrossScenarios
},
{
id: 'color-and-radius-1',
Expand Down Expand Up @@ -88,7 +88,7 @@ const mapExploreStore = useMapExploreStore()
const { selectedMap } = storeToRefs(mapExploreStore)
if (!selectedMap.value) {
selectedMap.value = availableMaps[1].id;
selectedMap.value = availableMaps[1].id
}
const selectedMapComponent = computed(() => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vacs-map-app/src/assets/img/minimaps/tef_future_ssp126.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vacs-map-app/src/assets/img/minimaps/tef_future_ssp370.svg

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

33 changes: 14 additions & 19 deletions vacs-map-app/src/components/CropCards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,26 @@ import { useFiltersStore } from '@/stores/filters'
import { useCropInformationStore } from '../stores/cropInformation'
import CardWrapper from './CardWrapper.vue'
const router = useRouter();
const filtersStore = useFiltersStore();
const cropInformationStore = useCropInformationStore();
const {
selectedCrop,
selectedModel,
selectedCropGroup,
cropSortBy,
cropSortOrder,
} = storeToRefs(filtersStore)
const { data: cropInformation } = storeToRefs(cropInformationStore);
const router = useRouter()
const filtersStore = useFiltersStore()
const cropInformationStore = useCropInformationStore()
const { selectedCrop, selectedModel, selectedCropGroup, cropSortBy, cropSortOrder } =
storeToRefs(filtersStore)
const { data: cropInformation } = storeToRefs(cropInformationStore)
const filteredCrops = computed(() => {
if (!selectedCropGroup.value) return cropInformation.value;
return cropInformation.value.filter(d => d.crop_group === selectedCropGroup.value);
if (!selectedCropGroup.value) return cropInformation.value
return cropInformation.value.filter((d) => d.crop_group === selectedCropGroup.value)
})
const sortedCrops = computed(() => {
if (!cropSortBy.value) return filteredCrops.value;
return [...filteredCrops.value].sort(
(a, b) => d3[cropSortOrder.value](
a.indicators.nutritional[cropSortBy.value],
if (!cropSortBy.value) return filteredCrops.value
return [...filteredCrops.value].sort((a, b) =>
d3[cropSortOrder.value](
a.indicators.nutritional[cropSortBy.value],
b.indicators.nutritional[cropSortBy.value]
)
);
)
})
const navigate = (crop) => {
Expand All @@ -57,7 +52,7 @@ const navigate = (crop) => {
}
const getUrl = (crop) => {
return new URL(`../assets/img/minimaps/${crop}_${selectedModel.value}.svg`, import.meta.url).href;
return new URL(`../assets/img/minimaps/${crop}_${selectedModel.value}.svg`, import.meta.url).href
}
</script>
Expand Down
32 changes: 15 additions & 17 deletions vacs-map-app/src/components/CropFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>

<div class="crop-groups">
<div
<div
:class="{
selected: selectedCropGroup === ''
}"
Expand All @@ -37,21 +37,17 @@
<div class="sort-by">
<div class="sort-order">
<div class="sort-order-option">
<input type="radio" v-model="cropSortOrder" id="descending" value="descending">
<input type="radio" v-model="cropSortOrder" id="descending" value="descending" />
<label for="descending">High to low</label>
</div>
<div class="sort-order-option">
<input type="radio" v-model="cropSortOrder" id="ascending" value="ascending">
<input type="radio" v-model="cropSortOrder" id="ascending" value="ascending" />
<label for="ascending">Low to high</label>
</div>
</div>

<select v-model="cropSortBy">
<option
v-for="option in cropSortByOptions"
:key="option"
:value="option"
>
<option v-for="option in cropSortByOptions" :key="option" :value="option">
{{ option }}
</option>
</select>
Expand All @@ -64,16 +60,16 @@ import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { useFiltersStore } from '@/stores/filters'
const filtersStore = useFiltersStore();
const {
availableModels,
selectedModel,
availableCropGroups,
const filtersStore = useFiltersStore()
const {
availableModels,
selectedModel,
availableCropGroups,
selectedCropGroup,
cropSortByOptions,
cropSortBy,
cropSortOrder,
} = storeToRefs(filtersStore);
cropSortOrder
} = storeToRefs(filtersStore)
const futureScenarios = computed(() => {
return availableModels.value.filter((d) => d.startsWith('future'))
Expand All @@ -86,7 +82,8 @@ const futureScenarios = computed(() => {
gap: 2rem;
}
.scenarios, .crop-groups {
.scenarios,
.crop-groups {
display: flex;
flex-direction: row;
gap: 1rem;
Expand Down Expand Up @@ -117,7 +114,8 @@ const futureScenarios = computed(() => {
gap: 0.25rem;
}
.sort-order label, .sort-order input {
.sort-order label,
.sort-order input {
cursor: pointer;
}
</style>
Loading

0 comments on commit 0aace58

Please sign in to comment.