Mercurial > gemma
diff client/src/lib/classifications.js @ 4266:fbe2f1aa2757
styles: refactor color coding accuracy colors
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 27 Aug 2019 14:22:45 +0200 |
parents | 2596a028dc3a |
children | e4d6c6339cb4 |
line wrap: on
line diff
--- a/client/src/lib/classifications.js Tue Aug 27 11:46:51 2019 +0200 +++ b/client/src/lib/classifications.js Tue Aug 27 14:22:45 2019 +0200 @@ -60,11 +60,11 @@ // at least configured amount of measurements in last 14 days const valuesAtLeast = store.state.application.config.gm_min_values_14d; if (gmN !== undefined && gmN !== null && gmN >= valuesAtLeast) { - return "lime"; + return "OK"; } - return "yellow"; + return "WARNING"; } - return "red"; + return "DANGER"; }, forecastAccuracy(feature) { let gauge = getGauge(feature); @@ -72,14 +72,14 @@ let fa1d = gauge.get("forecast_accuracy_1d"); if (typeof fa3d == "number" && typeof fa1d == "number") { if (fa1d > store.state.application.config.gm_forecast_offset_24h) { - return "red"; + return "DANGER"; } else if (fa3d > store.state.application.config.gm_forecast_offset_72h) { - return "yellow"; + return "WARNING"; } else { - return "lime"; + return "OK"; } } - return "white"; + return "NEUTRAL"; }, forecastVsReality(feature) { let gauge = getGauge(feature); @@ -91,18 +91,18 @@ nsc.coeffs[0].value < store.state.application.config.gm_forecast_vs_reality_nsc_24h ) - return "red"; + return "DANGER"; // 72h < configured value if ( nsc.coeffs[2].samples && nsc.coeffs[2].value < store.state.application.config.gm_forecast_vs_reality_nsc_72h ) - return "yellow"; + return "WARNING"; // both > configured value - return "lime"; + return "OK"; } // no data available - return "white"; + return "NEUTRAL"; } };