-
{{ title }}
+
+
+ {{ title }}
+
+
{{ subtitle }}
+
+ {{ cropGroup }} reference crop
+
{{ indicator.key }}
{}
@@ -84,8 +100,18 @@ const props = defineProps({
default: () => {}
}
})
-const { title, description, handleClick, indicator, isActive, isDynamic, showMoreInfo, boldTitle } =
- toRefs(props)
+const {
+ title,
+ description,
+ handleClick,
+ indicator,
+ isActive,
+ isDynamic,
+ showMoreInfo,
+ boldTitle,
+ referenceCrop,
+ cropGroup
+} = toRefs(props)
const colorStore = useColorStore()
const { stopLight: stopLightScheme, colorblindFriendly } = storeToRefs(colorStore)
@@ -170,30 +196,41 @@ const useDarkIndicatorText = computed(() => {
padding-top: 0;
}
-.title {
+.title-row {
font-family: var(--font-family-h2);
height: var(--title-height);
font-size: 1.125rem;
display: flex;
gap: 0.5rem;
- align-items: center;
+ align-items: baseline;
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
-.title img {
+.title-row img {
margin-left: auto;
}
+.title-row.bold {
+ font-family: var(--font-family-header);
+ font-size: 1.375rem;
+}
+
+.title {
+ height: 100%;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+}
+
.subtitle {
font-size: 0.875rem;
font-family: var(--font-family-h3);
}
-.title.bold {
- font-family: var(--font-family-header);
- font-size: 1.375rem;
+.reference-crop-message {
+ color: var(--dark-gray);
}
.indicator {
diff --git a/vacs-map-app/src/components/ContentModal.vue b/vacs-map-app/src/components/ContentModal.vue
index 3673ff8..10be85c 100644
--- a/vacs-map-app/src/components/ContentModal.vue
+++ b/vacs-map-app/src/components/ContentModal.vue
@@ -80,7 +80,7 @@ onClickOutside(contentInnerRef, () => emit('close'))
.header {
font-family: var(--font-family-h2);
font-size: 1.875rem;
- padding-bottom: 0.25rem;
+ padding-bottom: 0.75rem;
line-height: 110%;
}
diff --git a/vacs-map-app/src/components/CropCards.vue b/vacs-map-app/src/components/CropCards.vue
index 5dfe564..901d18c 100644
--- a/vacs-map-app/src/components/CropCards.vue
+++ b/vacs-map-app/src/components/CropCards.vue
@@ -7,6 +7,8 @@
:title="crop.label"
:bold-title="true"
:description="crop.description"
+ :reference-crop="!!crop.benchmark"
+ :crop-group="crop.crop_group"
:handle-click="() => navigate(crop.id)"
:indicator="{
key: cropSortBy,
diff --git a/vacs-map-app/src/components/CropGroupStackedBarChart.vue b/vacs-map-app/src/components/CropGroupStackedBarChart.vue
index 3d3937b..5dd4698 100644
--- a/vacs-map-app/src/components/CropGroupStackedBarChart.vue
+++ b/vacs-map-app/src/components/CropGroupStackedBarChart.vue
@@ -4,6 +4,10 @@
v-for="bar in bars"
:key="bar.id"
class="crop-bar"
+ :class="{
+ highlighted: hoveredCrop === bar.id,
+ unhighlighted: hoveredCrop && hoveredCrop !== bar.id
+ }"
:style="{
width: `${bar.gridShare}%`,
background: bar.fill
@@ -29,9 +33,9 @@ const mapExploreStore = useMapExploreStore()
const { selectedCrop, selectedModel } = storeToRefs(filtersStore)
const { data: cropInformation } = storeToRefs(cropInformationStore)
-const { ordinal: ordinalScheme, noData: noDataFill } = storeToRefs(colorStore)
+const { ordinal: ordinalScheme, noData: noDataFill, getCropColor } = storeToRefs(colorStore)
const { data: cropYieldsData } = storeToRefs(cropYieldsStore)
-const { showCropGroupMap, cropGroupMetric } = storeToRefs(mapExploreStore)
+const { showCropGroupMap, cropGroupMetric, hoveredCrop } = storeToRefs(mapExploreStore)
const selectedCropInfo = computed(() => {
return cropInformation?.value?.find((d) => d.id === selectedCrop.value)
@@ -65,7 +69,7 @@ const bars = computed(() => {
return {
id: crop.id,
label: crop.label,
- fill: ordinalScheme.value[i],
+ fill: colorStore.getCropColor(crop.id),
gridShare
}
})
@@ -98,4 +102,8 @@ const bars = computed(() => {
.crop-bar {
height: 100%;
}
+
+.unhighlighted {
+ opacity: 20%;
+}
diff --git a/vacs-map-app/src/components/ExploreSidebar.vue b/vacs-map-app/src/components/ExploreSidebar.vue
index ed84d9e..815ff25 100644
--- a/vacs-map-app/src/components/ExploreSidebar.vue
+++ b/vacs-map-app/src/components/ExploreSidebar.vue
@@ -29,15 +29,7 @@