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

Made upspeedgraph and downspeed graph scale on a common axis #1991

Merged
merged 2 commits into from
Jul 21, 2024
Merged

Made upspeedgraph and downspeed graph scale on a common axis #1991

merged 2 commits into from
Jul 21, 2024

Conversation

donutAnees
Copy link
Contributor

Checklist

  • I have described the changes
  • All new code is licensed under GPLv3

Description

Before

In the current latest code of conky, downspeedgraph and upspeedgraph look the same because they're both individually scaled with respect to max value.

Screenshot 2024-07-20 at 10 59 35 PM

After

Screenshot 2024-07-21 at 3 15 48 AM Screenshot 2024-07-21 at 3 15 59 AM

This has now been fixed and both of them are scaled on a common axis. I have tested the code, and it does not influence any other graphs.

The changes made include

  1. Adding char speedgraph flag to the struct graph and struct special_node.
  2. Declaring a global double maxval to keep track of the current max value across the two graphs.
  3. Adding parameter char speedgraph to scan_graph method.
  4. And finally checking if the current value getting added is bigger than maxval, if so we make our scale = maxval, in the graph_append method.

Fixes #1820

@github-actions github-actions bot added sources PR modifies project sources tests Issue or PR related to project tests networking Issue or PR related to networking support rendering Issue or PR related to rendering disk io Issue or PR that suggests changes to disk I/O nvidia Issue or PR related to nvidia cards text Issue or PR related to `conky.text` variables labels Jul 20, 2024
Copy link

netlify bot commented Jul 20, 2024

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit a22ce03
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/669c38fa17b3e5000839bd1b

Copy link
Owner

@brndnmtthws brndnmtthws left a comment

Choose a reason for hiding this comment

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

This is great, thanks!

A bit weird that we mix bool, char, true/false, TRUE/FALSE but that's something for another PR.

@brndnmtthws brndnmtthws added the feature New feature PR or issue label Jul 21, 2024
@brndnmtthws brndnmtthws merged commit ed6d188 into brndnmtthws:main Jul 21, 2024
39 checks passed
@donutAnees donutAnees deleted the upspeed_downspeed_fix branch July 21, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disk io Issue or PR that suggests changes to disk I/O feature New feature PR or issue networking Issue or PR related to networking support nvidia Issue or PR related to nvidia cards rendering Issue or PR related to rendering sources PR modifies project sources tests Issue or PR related to project tests text Issue or PR related to `conky.text` variables
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: make downspeedgraph and upspeedgraph use same scaling
2 participants