Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request to enable display of barometric pressure #49

Merged
merged 3 commits into from
Jan 18, 2023

Conversation

stavefan
Copy link
Contributor

@stavefan stavefan commented Jan 5, 2023

Modification of code and readme that permits display of the barometric pressure.

@mtatsuma
Copy link
Owner

mtatsuma commented Jan 9, 2023

Thank you for your PR.

Could you provide a sample picture that the pressure is enabled?

I'm concerned about the visibility because the pressure graph may overwrap the other graph (e.g. rain and temperature).

@stavefan
Copy link
Contributor Author

stavefan commented Jan 9, 2023

Attached is a screenshot

pressure

@@ -784,7 +864,10 @@ Module.register("MMM-WeatherChart", {
y2_max =
Math.max(maxRain, maxSnow, this.config.rainMinHeight) *
(2 + (iconTopMargin + iconBelowMargin + tempRainMargin) * 2),
y2_min = 0;
y2_min = 0,
yPressure_Min = this.getMin(pressures),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename yPressure_Min, yPressure_Max to y3_min, y3_max.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

@@ -45,6 +46,7 @@ Module.register("MMM-WeatherChart", {
colorMax: "rgba(255, 255, 255, 1)",
colorRain: "rgba(255, 255, 255, 1)",
colorSnow: "rgba(255, 255, 255, 1)",
colorPressure: "rgba(255, 255, 0, 0.8)",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud you set the default color to white?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

datasets.push({
label: "Pressure",
borderColor: this.config.colorPressure,
pointBackgroundColor: this.config.colorPressure,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud you set borderDash so that the line style is selectable by users? The pressure line should be easily distinguishable because the pressure line overwrap with the other lines.

For example:

borderDash: this.config.pressureBorderDash

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

y2_min = 0;
y2_min = 0,
y3_max = maxPressure + 20,
y3_min = minPressure - 20;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y3_max and y3_min should be carefully calculated to make an appropriate margin. If it's difficult, I'll try to fix after the PR is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

},
},
data: pressures,
yAxisID: "y3",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide the y3 axis at the far left side.

y1, y2 axis is hide by the below code.
https://github.com/mtatsuma/MMM-WeatherChart/blob/master/MMM-WeatherChart.js#L880-L884

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

… 2) Change color pressure to white 3)Added pressure border dash for line, 4) Changed calculations for y3 min and max extents, 5) Hid scale for y3
Copy link
Owner

@mtatsuma mtatsuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the modifitions.

@mtatsuma
Copy link
Owner

I'll create a new release after I test it on my environment.

@mtatsuma mtatsuma merged commit d1203fb into mtatsuma:master Jan 18, 2023
@stavefan stavefan deleted the pressure branch January 18, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants