Skip to content

Commit f85899c

Browse files
committed
Merge branch 'main' into feature/234-site-design-updates
2 parents ececf8b + 41687a8 commit f85899c

36 files changed

+543
-185
lines changed

components/Charts/EmissionIntensityChart.vue

+10
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ export default {
164164
averageEmissionIntensity: {
165165
type: Number,
166166
default: 0
167+
},
168+
isEnergyType: {
169+
type: Boolean,
170+
default: false
167171
}
168172
},
169173
@@ -283,6 +287,12 @@ export default {
283287
if (this.tabletBreak) {
284288
this.chartHeight = 200
285289
}
290+
291+
if (this.isEnergyType) {
292+
this.$store.commit('chartOptionsEmissionIntensity/chartCurve', 'step')
293+
} else {
294+
this.$store.commit('chartOptionsEmissionIntensity/chartCurve', 'smooth')
295+
}
286296
},
287297
288298
methods: {

components/Charts/EmissionIntensityChartOptions.vue

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<chart-header :chart-shown="chartShown">
2+
<chart-header
3+
:chart-shown="chartShown"
4+
:has-hover-date="hoverDisplayDate.length > 0">
35
<template
46
v-slot:options
57
v-if="!readOnly">
@@ -20,7 +22,12 @@
2022

2123
<template v-slot:label-unit>
2224
<strong>Emission Intensity</strong>
23-
<small v-if="chartShown">kgCO₂e/MWh</small>
25+
<div
26+
v-show="chartShown"
27+
style="display: flex; gap: 5px; align-items: center;">
28+
<small v-if="is12MthRollingSum">(12-month rolling)</small>
29+
<small>kgCO₂e/MWh</small>
30+
</div>
2431
</template>
2532
<template
2633
v-slot:average-value
@@ -32,9 +39,7 @@
3239
{{ hoverDisplayDate }}
3340
</template>
3441
<template v-slot:hover-values>
35-
<span
36-
v-if="hoverValue"
37-
class="ft-value">
42+
<span v-if="hoverValue">
3843
<strong>{{ hoverValue | formatValue }} kgCO₂e/MWh</strong>
3944
</span>
4045
</template>
@@ -104,6 +109,11 @@ export default {
104109
showChartOptions: false
105110
}
106111
},
112+
computed: {
113+
...mapGetters({
114+
is12MthRollingSum: 'is12MthRollingSum'
115+
})
116+
},
107117
methods: {
108118
handleTypeClick(type) {
109119
this.$store.commit('chartOptionsEmissionIntensity/chartType', type)

components/Charts/EmissionsChart.vue

+10
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ export default {
273273
emissionsOptions: {
274274
type: Object,
275275
default: () => emissionsOptions
276+
},
277+
isEnergyType: {
278+
type: Boolean,
279+
default: false
276280
}
277281
},
278282
@@ -707,6 +711,12 @@ export default {
707711
this.$emit('changeDataset', this.changeSinceDataset)
708712
this.chartHeight = this.visHeight
709713
this.handleTypeClick()
714+
715+
if (this.isEnergyType) {
716+
this.$store.commit('chartOptionsEmissionsVolume/chartCurve', 'step')
717+
} else {
718+
this.$store.commit('chartOptionsEmissionsVolume/chartCurve', 'smooth')
719+
}
710720
},
711721
712722
methods: {

components/Charts/EmissionsChartOptions.vue

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<chart-header :chart-shown="chartShown">
2+
<chart-header
3+
:chart-shown="chartShown"
4+
:has-hover-date="hoverDisplayDate.length > 0">
35
<template
46
v-slot:options
57
v-if="!readOnly">
@@ -25,13 +27,20 @@
2527

2628
<template v-slot:label-unit>
2729
<strong>Emissions Volume</strong>
28-
<small v-if="chartShown && isPercentage"> {{ displayUnit }}</small>
29-
<small
30-
v-if="chartShown && !isPercentage"
31-
class="display-unit"
32-
@click.stop="handleUnitClick"
33-
>{{ displayUnit }}/{{ interval | intervalLabel }}</small
34-
>
30+
31+
<div
32+
v-show="chartShown"
33+
style="display: flex; gap: 1px; align-items: center;">
34+
<small v-if="is12MthRollingSum">(12-month rolling)</small>
35+
<small v-if="isPercentage"> {{ displayUnit }}</small>
36+
<small
37+
v-if="!isPercentage"
38+
class="display-unit"
39+
@click.stop="handleUnitClick"
40+
>
41+
{{ displayUnit }}/{{ interval | intervalLabel }}
42+
</small>
43+
</div>
3544
</template>
3645
<template
3746
v-slot:average-value
@@ -70,6 +79,7 @@
7079
</template>
7180

7281
<script>
82+
import {mapGetters} from 'vuex'
7383
import _cloneDeep from 'lodash.clonedeep'
7484
import ChartHeader from '@/components/Vis/ChartHeader'
7585
import ChartOptions from '@/components/Vis/ChartOptions'
@@ -183,6 +193,10 @@ export default {
183193
}
184194
},
185195
computed: {
196+
...mapGetters({
197+
is12MthRollingSum: 'is12MthRollingSum'
198+
}),
199+
186200
options() {
187201
let options = _cloneDeep(this.emissionsOptions)
188202
if (this.isTypeArea) {

0 commit comments

Comments
 (0)