Skip to content

Commit

Permalink
fixed historical observed 1961-1990 average calculation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilson8767 committed Jan 4, 2022
1 parent cc35e94 commit 32016ac
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ Note that outside the contiguous US, some of these variables may be shown differ


## Changelog
(3.2.2):
- Fixed 1961-1990 historical observed average calculation issue.
- Minor style / font-sizing changes.

(3.2.1):
- Rotated hover legend items.
- Fixed 'font' option.
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h3>Please enter a state or county to begin</h3>
<!-- <label for="decadal" class="btn">Decadal Avg</label>-->
<!-- <input type="checkbox" name="rolling" id="rolling">-->
<!-- <label for="rolling" class="btn"><input type="number" value="10" min="0" max="30" step="1" id="rolling_years" name="rolling_years">-yr Moving Avg</label>-->
<div style="margin-left: auto; display: flex; flex-direction: row;">
<div style="margin-left: auto; flex; display: flex; flex-direction: row;">
<button class="btn" id="download-button" title="Download Data"><i
class="fa fa-download"
aria-label="Download Data"></i></button>
Expand Down
2 changes: 1 addition & 1 deletion dist/climate_by_location.climate_by_forest.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8585,7 +8585,7 @@
chart_data['hist_obs_year'].push(round(hist_obs_data[i][0], precision));
chart_data['hist_obs'].push(round(hist_obs_data[i][1], precision));

if (1961 <= hist_obs_data[i][0] <= 1990) {
if (1961 <= hist_obs_data[i][0] && hist_obs_data[i][0] <= 1990) {
chart_data['hist_obs_base'].push(round(hist_obs_data[i][1], precision));
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/climate_by_location.climate_explorer.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8136,7 +8136,7 @@
chart_data['hist_obs_year'].push(hist_obs_data[i][0]);
chart_data['hist_obs'].push(round(hist_obs_data[i][1], precision));

if (1961 <= hist_obs_data[i][0] <= 1990) {
if (1961 <= hist_obs_data[i][0] && hist_obs_data[i][0] <= 1990) {
chart_data['hist_obs_base'].push(round(hist_obs_data[i][1], precision));
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/climate_by_location.complete.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8328,7 +8328,7 @@
chart_data['hist_obs_year'].push(hist_obs_data[i][0]);
chart_data['hist_obs'].push(round(hist_obs_data[i][1], precision));

if (1961 <= hist_obs_data[i][0] <= 1990) {
if (1961 <= hist_obs_data[i][0] && hist_obs_data[i][0] <= 1990) {
chart_data['hist_obs_base'].push(round(hist_obs_data[i][1], precision));
}
}
Expand Down Expand Up @@ -10184,7 +10184,7 @@
chart_data['hist_obs_year'].push(round(hist_obs_data[i][0], precision));
chart_data['hist_obs'].push(round(hist_obs_data[i][1], precision));

if (1961 <= hist_obs_data[i][0] <= 1990) {
if (1961 <= hist_obs_data[i][0] && hist_obs_data[i][0] <= 1990) {
chart_data['hist_obs_base'].push(round(hist_obs_data[i][1], precision));
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "climate-by-location",
"version": "3.2.1",
"version": "3.2.2",
"description": "Interactive climate graphs",
"main": "dist/climate-by-location.climate_explorer.bundle.min.js",
"maintainers": [
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export default class ClimateByLocationWidget {
}
if (Number.isFinite(x_range_min) && Number.isFinite(x_range_max)) {
window.setTimeout(() => {
this.element.dispatchEvent(new CustomEvent('x_axis_range_change', {detail: [x_range_min, x_range_max, get(this.options, ['x_axis_range', 0], x_range_min), get(this.options, ['x_axis_range', 1], x_range_max)]}));
this.element.dispatchEvent(new CustomEvent('x_axis_range_change', {detail: [x_range_min, x_range_max, get(this.options, ['x_axis_range', 0], x_range_min), get(this.options, ['x_axis_range', 1], x_range_max)]}));
this.element.dispatchEvent(new CustomEvent('y_axis_range_change', {detail: [y_range_min, y_range_max, get(this.options, ['y_axis_range', 0], y_range_min), get(this.options, ['y_axis_range', 1], y_range_max)]}));
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/conus_decade.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export default class ConusDecadeView extends View {
for (let i = 0; i < hist_obs_data.length; i++) {
chart_data['hist_obs_year'].push(hist_obs_data[i][0]);
chart_data['hist_obs'].push(round(hist_obs_data[i][1], precision));
if (1961 <= hist_obs_data[i][0] <= 1990) {
if (1961 <= hist_obs_data[i][0] && hist_obs_data[i][0] <= 1990) {
chart_data['hist_obs_base'].push(round(hist_obs_data[i][1], precision));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/conus_year.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export default class ConusYearView extends View {
for (let i = 0; i < hist_obs_data.length; i++) {
chart_data['hist_obs_year'].push(round(hist_obs_data[i][0], precision));
chart_data['hist_obs'].push(round(hist_obs_data[i][1], precision));
if (1961 <= hist_obs_data[i][0] <= 1990) {
if (1961 <= hist_obs_data[i][0] && hist_obs_data[i][0] <= 1990) {
chart_data['hist_obs_base'].push(round(hist_obs_data[i][1], precision));
}
}
Expand Down

0 comments on commit 32016ac

Please sign in to comment.