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

fix/other: fix bug with network y-axis labels and cache height calculations #1670

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Feb 7, 2025

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

This PR has two changes:

  1. Fix a bug where we were using the wrong value when creating network y-axis labels; this was a mistake from refactor: points rework (v1) #1663, where I used the upper limit (value * 1.5) as the value to create labels. Oops.
  2. Cache previous results of height calculation; this means we don't have to always scan the full range of points each time we want to find the max height for the adjusting y-axis. Instead:
    • If the cache is empty, scan the full range; store the best point, the right edge scanned, and the time range
    • If the cache is not empty, and the point is inside the current range, scan from the right edge to the cached right edge
    • If the cache is not empty but the point is outside the range, scan the full thing as it's invalid
    • If the cache is not empty but the time range is different, we do the easy thing and just scan the entire thing again too

Issue

If applicable, what issue does this address?

Closes: #

Testing

If relevant, please state how this was tested. All changes must be tested to work:

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 3.22581% with 30 lines in your changes missing coverage. Please review.

Project coverage is 42.13%. Comparing base (8ac03b5) to head (a11285e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/canvas/widgets/network_graph.rs 0.00% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1670      +/-   ##
==========================================
- Coverage   42.25%   42.13%   -0.12%     
==========================================
  Files         110      110              
  Lines       17458    17478      +20     
==========================================
- Hits         7377     7365      -12     
- Misses      10081    10113      +32     
Flag Coverage Δ
macos-14 37.79% <3.22%> (-0.05%) ⬇️
ubuntu-latest 43.91% <3.22%> (-0.13%) ⬇️
windows-2019 37.68% <3.22%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClementTsang ClementTsang merged commit a82d857 into main Feb 7, 2025
37 checks passed
@ClementTsang ClementTsang deleted the smaller_network_height_check branch February 7, 2025 01:29
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.

1 participant