diff --git a/factgenie/datasets/openweather.py b/factgenie/datasets/openweather.py index 8bda7d03..eaf939df 100644 --- a/factgenie/datasets/openweather.py +++ b/factgenie/datasets/openweather.py @@ -15,7 +15,7 @@ def postprocess_data(self, examples): forecasts = examples["forecasts"] examples = [] - # https://openweathermap.org/api/hourly-forecast, using metric system + # using metric system units = { "temp": "°C", "wind": "m/s", @@ -29,7 +29,7 @@ def postprocess_data(self, examples): lst_filtered = [] timezone_shift_sec = city["timezone"] - for key in ["sunrise", "sunset", "population", "timezone"]: + for key in ["sunrise", "sunset", "population", "timezone", "coord", "id"]: city.pop(key, None) for i, f in enumerate(forecast["list"]): @@ -38,9 +38,11 @@ def postprocess_data(self, examples): continue f = {k: v for k, v in f.items() if k not in ["dt", "pop", "sys", "visibility"]} - # remove the main -> temp_kf key + # remove extra keys f["main"] = { - k: v for k, v in f["main"].items() if k not in ["temp_kf", "humidity", "sea_level", "grnd_level"] + k: v + for k, v in f["main"].items() + if k not in ["temp_kf", "humidity", "sea_level", "grnd_level", "temp_max", "temp_min"] } # convert "dt_txt" to timestamp @@ -49,8 +51,8 @@ def postprocess_data(self, examples): # shift timezone local_datetime += timezone_shift_sec # convert back to "2023-11-28 09:00:00" - local_datetime = datetime.fromtimestamp(local_datetime).strftime("%Y-%m-%d %H:%M:%S") - f["dt_txt"] = local_datetime + f["dt_txt"] = datetime.fromtimestamp(local_datetime).strftime("%Y-%m-%d %H:%M:%S") + f["day_of_week"] = datetime.fromtimestamp(local_datetime).strftime("%A") lst_filtered.append(f) diff --git a/factgenie/static/css/custom.css b/factgenie/static/css/custom.css index 4a65407e..069feb28 100755 --- a/factgenie/static/css/custom.css +++ b/factgenie/static/css/custom.css @@ -1014,4 +1014,13 @@ a:hover { .out-placeholder { line-height: 2; +} + +.inline-icon { + margin-right: 0.2em; + margin-top: 0; + margin-bottom: -0.1em; + /* margin-bottom: 2px; */ + height: 0.8em; + vertical-align: baseline; } \ No newline at end of file diff --git a/factgenie/static/js/lib/meteogram.js b/factgenie/static/js/lib/meteogram.js index c18e797f..0ad83aaf 100644 --- a/factgenie/static/js/lib/meteogram.js +++ b/factgenie/static/js/lib/meteogram.js @@ -246,7 +246,7 @@ Meteogram.prototype.getChartOptions = function (cityName) { plotOptions: { series: { - pointPlacement: 'between', + pointPlacement: 0.1, animation: false } },