25
25
class =" pt-0 pb-0"
26
26
id =" data-panel"
27
27
:class =" $vuetify.breakpoint.xsOnly ? 'mx-0' : ''" >
28
- <v-row v-if =" indicatorObject" class =" d-flex ma-0" >
28
+ <div v-if =" indicatorObject" class =" d-flex ma-0" >
29
29
<v-col
30
30
:cols =" 12"
31
31
class =" pa-0"
50
50
<SelectionInfoBar class =" pb-2"
51
51
:selectableLayerConfigs =" selectableLayerConfigs" />
52
52
</template >
53
- <div v-if =" showCustomAreaCard && (mergedConfigsData[0].customAreaIndicator &&
53
+ <div v-if =" showCustomAreaCard" ref =" chart-div" >
54
+ <div v-if =" (mergedConfigsData[0].customAreaIndicator &&
54
55
!hasSelectionEnabled) && !customAreaIndicator" class =" justify-center align-center" >
55
56
<p class =" justify-self-start px-2 py-0" >
56
57
<v-icon color =" black" >mdi-shape-polygon-plus</v-icon >
57
58
Draw a polygon in order to start analysis
58
59
</p >
59
60
</div >
60
- <div v-else-if =" showCustomAreaCard "
61
+ <div v-else-if =" showingChart "
61
62
class =" pb-2 col"
62
63
>
63
64
<v-card
64
- class =" pb-2 col chartareapanel"
65
- ref =" mapPanel"
66
- >
65
+ class =" pb-2 col chartareapanel" >
67
66
<v-card-title
68
67
v-if =" customAreaIndicator"
69
68
style =" padding-top : 10px ; padding-bottom : 0px ;" >
93
92
color =" secondary"
94
93
></v-progress-circular >
95
94
</div >
96
- <v-row
97
- v-if =" (customAreaIndicator && !customAreaIndicator.isEmpty)
98
- && (!showMap || !customAreaIndicator.isEmpty)
99
- && $route.name !== 'demo'"
100
- class =" mt-6"
101
- >
102
- <v-col cols =" 12" sm =" 5" ></v-col >
103
- <v-col
104
- cols =" 12"
105
- sm =" 7"
106
- ref =" customButtonRow"
107
- style =" margin-top : 10px ;"
108
- >
109
- <div :class =" $vuetify.breakpoint.xsOnly ? 'text-center' : 'text-right'" >
110
- <v-btn
111
- color =" primary"
112
- text
113
- small
114
- :href =" dataCustomHrefCSV"
115
- :download =" customAOIDownloadFilename"
116
- target =" _blank"
117
- v-if ="
118
- customAreaIndicator
119
- "
120
- >
121
- <v-icon left >mdi-download</v-icon >
122
- download csv
123
- </v-btn >
124
- <add-to-dashboard-button
125
- v-if =" customAreaIndicator
126
- && (appConfig.id !== 'gtif' || $route.query.customDashboard)"
127
- :indicatorObject =" customAreaIndicator"
128
- :featureObject =" featureObject"
129
- >
130
- </add-to-dashboard-button >
131
- </div >
132
- </v-col >
133
- </v-row >
134
- <v-row
95
+ <div
135
96
v-else-if =" showCustomAreaCard"
136
- : class =" customAreaIndicator ? 'mt-6' : 'mt-0' "
97
+ class =" ma-0 pa-2 "
137
98
>
138
- <v-col
139
- cols =" 12"
140
- sm =" 5"
141
- class =" d-flex align-center"
142
- :class =" $vuetify.breakpoint.xsOnly ? 'justify-center' : 'justify-space-between'"
143
- >
144
- <small v-if =" indicatorObject && indicatorObject.updateFrequency" >
145
- <span
146
- v-if =" indicatorObject.updateFrequency === 'Retired'"
147
- >This indicator is no longer updated</span >
148
- <span
149
- v-else-if =" indicatorObject.updateFrequency === 'EndSeason'"
150
- >Due to end of season, this indicator is no longer updated</span >
151
- <span v-else >This data is updated: {{ indicatorObject.updateFrequency }}</span >
152
- </small >
153
- <small v-else > </small >
154
- </v-col >
155
99
<v-col
156
100
v-if =" $route.name !== 'demo'"
157
101
cols =" 12"
158
- sm =" 7"
159
- ref =" buttonRow"
160
102
>
161
- <div :class =" $vuetify.breakpoint.xsOnly ? 'text-center' : 'text-right'" >
162
- <v-btn
163
- color =" primary"
164
- text
165
- small
166
- :href =" dataHrefCSV"
167
- :download =" downloadFileName"
168
- target =" _blank"
169
- v-if =" dataObject && dataObject.time
170
- && !showMap"
171
- >
172
- <v-icon left >mdi-download</v-icon >
173
- download csv
174
- </v-btn >
175
- <iframe-button
176
- :indicatorObject =" indicatorObject"
177
- :featureObject =" featureObject"
178
- v-if =" !customAreaIndicator"
179
- />
180
- <v-btn
181
- color =" primary"
182
- text
183
- small
184
- style =" margin-top :50px ;"
185
- :href =" dataCustomHrefCSV"
186
- :download =" customAOIDownloadFilename"
187
- target =" _blank"
188
- v-if ="
189
- customAreaIndicator &&
190
- !showMap
191
- "
192
- >
193
- <v-icon left >mdi-download</v-icon >
194
- download csv
195
- </v-btn >
196
- <add-to-dashboard-button
197
- v-else-if =" !showMap && (appConfig.id !== 'gtif' || $route.query.customDashboard)"
198
- :indicatorObject =" indicatorObject"
199
- :featureObject =" featureObject"
200
- />
201
- </div >
103
+ <v-btn
104
+ color =" primary"
105
+ text
106
+ small
107
+ :href =" dataHrefCSV"
108
+ :download =" downloadFileName"
109
+ target =" _blank"
110
+ v-if =" dataObject && dataObject.time
111
+ && !showMap"
112
+ >
113
+ <v-icon left >mdi-download</v-icon >
114
+ download csv
115
+ </v-btn >
116
+ <iframe-button
117
+ :indicatorObject =" indicatorObject"
118
+ :featureObject =" featureObject"
119
+ v-if =" indicatorObject && featureObject && !customAreaIndicator"
120
+ />
121
+ <v-btn
122
+ color =" primary"
123
+ text
124
+ small
125
+ :href =" dataCustomHrefCSV"
126
+ :download =" customAOIDownloadFilename"
127
+ target =" _blank"
128
+ v-if =" customAreaIndicator"
129
+ >
130
+ <v-icon left >mdi-download</v-icon >
131
+ download csv area
132
+ </v-btn >
133
+ <add-to-dashboard-button
134
+ v-if =" (indicatorObject && featureObject && !customAreaIndicator) && (appConfig.id !== 'gtif' || $route.query.customDashboard)"
135
+ :indicatorObject =" indicatorObject"
136
+ :featureObject =" featureObject"
137
+ />
202
138
</v-col >
203
- </v-row >
139
+ </div >
140
+ </div >
204
141
<data-mockup-view v-if =" appConfig.id === 'gtif'"
205
142
:indicatorObject =" indicatorObject"
206
143
:adminLayer =" $store.state.features.adminBorderLayerSelected"
247
184
>
248
185
</FeatureQueryParams >
249
186
</v-col >
250
- <v-col
251
- :cols =" 12"
252
- class =" py-0"
253
- :class =" $vuetify.breakpoint.smAndUp ? 'scrollContainer' : ''"
254
- v-if =" indicatorObject && externalData"
255
- >
256
- <v-row
257
- class =" mt-0 fill-height pb-2"
258
- >
259
- <v-col
260
- cols =" 12"
261
- class =" pb-0"
262
- >
263
- <v-btn
264
- :href = " externalData.url"
265
- target =" _blank"
266
- color =" primary"
267
- ref =" externalDataBtn"
268
- large
269
- block
270
- class =" my-1"
271
- ><span ><v-icon left >mdi-open-in-new</v-icon >{{externalData.label}}</span >
272
- </v-btn >
273
- </v-col >
274
- </v-row >
275
- </v-col >
276
- </v-row >
187
+ </div >
277
188
<div v-if =" indicatorObject.features?.length && !featureObject" >
278
189
<p class =" pa-2" >
279
190
<v-icon color =" black" >mdi-chart-areaspline</v-icon >
@@ -387,7 +298,7 @@ export default {
387
298
' customAreaIndicator' ,
388
299
]),
389
300
showingChart () {
390
- return this .customAreaIndicator || this .customAreaIndicator || this . dataObject ? .time ;
301
+ return this .customAreaIndicator || this .dataObject ? .time ;
391
302
},
392
303
indicatorObject () {
393
304
return this .$store .state .indicators .selectedIndicator ;
@@ -414,7 +325,7 @@ export default {
414
325
dataHrefCSV () {
415
326
let dataHref = ' data:text/csv;charset=utf-8,' ;
416
327
const exportKeys = [
417
- ' time' , ' aoi ' , ' measurement' ,
328
+ ' time' , ' siteName ' , ' measurement' ,
418
329
' indicatorValue' , ' referenceTime' , ' eoSensor' , ' colorCode' , ' inputData' ,
419
330
];
420
331
const header = ` ${ exportKeys .join ()} \n ` ;
@@ -423,12 +334,7 @@ export default {
423
334
let row = ' ' ;
424
335
for (let kk = 0 ; kk < exportKeys .length ; kk++ ) {
425
336
const cKey = exportKeys[kk];
426
- let txtVal = ' ' ;
427
- if (cKey === ' aoi' ) {
428
- txtVal = ` "${ this .dataObject [cKey]} ",` ;
429
- } else {
430
- txtVal = ` "${ this .dataObject [cKey][i]} ",` ;
431
- }
337
+ const txtVal = ` "${ this .dataObject [cKey][i]} ",` ;
432
338
row += txtVal;
433
339
}
434
340
row = ` ${ row .slice (0 , - 1 )} \n ` ;
@@ -447,7 +353,7 @@ export default {
447
353
const wkt = new Wkt ();
448
354
const header = ` ${ exportKeys .join ()} \n ` ;
449
355
let csv = header;
450
- if (this .customAreaIndicator .time ) {
356
+ if (this .customAreaIndicator ? .time ) {
451
357
for (let i = 0 ; i < this .customAreaIndicator .time .length ; i++ ) {
452
358
let row = ' ' ;
453
359
for (let kk = 0 ; kk < exportKeys .length ; kk++ ) {
@@ -477,7 +383,7 @@ export default {
477
383
const currDate = DateTime .utc ().toFormat (' yyyy-LL-dd' );
478
384
const currInd = this .indicatorObject ;
479
385
const city = currInd .city || currInd .country || ' global' ;
480
- return ` ${ city} _${ currDate} _${ currInd .aoiID } -${ currInd .indicator } .csv` ;
386
+ return ` ${ city} _${ currDate} _${ currInd .siteName } -${ currInd .indicator } .csv` ;
481
387
},
482
388
customAOIDownloadFilename () {
483
389
const currDate = DateTime .utc ().toFormat (' yyyy-LL-dd' );
@@ -501,35 +407,6 @@ export default {
501
407
// customarea seems to be handled differently
502
408
return ! this .indicatorObject .features ? .length ;
503
409
},
504
- externalData () {
505
- const dataFromDefinition = this .indicatorObject .externalData ;
506
- const dataFromIndicator = this .dataObject ? this .dataObject .externalData : null ;
507
- if (dataFromDefinition) {
508
- return dataFromDefinition;
509
- }
510
- if (dataFromIndicator) {
511
- return dataFromIndicator;
512
- }
513
- return null ;
514
- },
515
- wrapperHeight () {
516
- if (this .mounted && this .$refs .wrapper != null ) {
517
- return this .$refs .wrapper .clientHeight ;
518
- }
519
- return 0 ;
520
- },
521
- buttonRowHeight () {
522
- if (this .mounted && this .$refs .buttonRow != null ) {
523
- return this .$refs .buttonRow .clientHeight ;
524
- }
525
- return 0 ;
526
- },
527
- mapPanelHeight () {
528
- if (this .mounted && this .$refs .mapPanel != null ) {
529
- return this .$refs .mapPanel .$el .clientHeight ;
530
- }
531
- return 0 ;
532
- },
533
410
mergedConfigsData () {
534
411
if (! this .indicatorObject ) {
535
412
return [];
@@ -592,16 +469,6 @@ export default {
592
469
},
593
470
},
594
471
watch: {
595
- showingChart () {
596
- if (this .showingChart ) {
597
- // we only want to open if it is closed
598
- if (! this .$parent .$parent .$el .classList .contains (' v-expansion-panel--active' )) {
599
- this .$parent .$parent .$parent .$refs .header .$emit (' click' , {
600
- currentTarget: this .$parent .$parent .$parent .$refs .header .$el ,
601
- });
602
- }
603
- }
604
- },
605
472
async selectedArea (area ) {
606
473
this .showRegenerateButton = this .customAreaIndicator && !! area;
607
474
this .refreshSpeciesInfo ();
0 commit comments