Mercurial > gemma
comparison client/src/lib/mixins.js @ 4153:7c44af0b9370
client: Waterleveldiagram
Since there is no convention for the nameing of reference waterlevels
we have to do some guesswork. Levels containing /HDC/ are considered hdc
and ldc accordingly are determined by /LDC/.
For now, we assume having only a max of one LDC and one HDC.
If there are multiple instances of LDC and HDC, LDCs are red and HDCs are green.
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Fri, 02 Aug 2019 12:59:23 +0200 |
parents | 7959f62d3051 |
children | 552ea22ed266 |
comparison
equal
deleted
inserted
replaced
4152:78ec61acf72e | 4153:7c44af0b9370 |
---|---|
42 }, | 42 }, |
43 methods: { | 43 methods: { |
44 sortTable(sorting) { | 44 sortTable(sorting) { |
45 this.sortColumn = sorting.sortColumn; | 45 this.sortColumn = sorting.sortColumn; |
46 this.sortDirection = sorting.sortDirection; | 46 this.sortDirection = sorting.sortDirection; |
47 } | |
48 } | |
49 }; | |
50 /** | |
51 * Since the names of LDC and HDC aren't normalized, we have to do guesswork | |
52 * best fit is key with HDC or LDC in it | |
53 */ | |
54 export const refwaterlevels = { | |
55 methods: { | |
56 determineLDCHDC(refWaterLevels) { | |
57 let HDC = | |
58 refWaterLevels[Object.keys(refWaterLevels).find(e => /HDC/.test(e))]; | |
59 let LDC = | |
60 refWaterLevels[Object.keys(refWaterLevels).find(e => /LDC/.test(e))]; | |
61 return { LDC, HDC }; | |
47 } | 62 } |
48 } | 63 } |
49 }; | 64 }; |
50 | 65 |
51 export const diagram = { | 66 export const diagram = { |