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

refactor(barchart): reduce some calculations #430

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

karthago1
Copy link
Contributor

@karthago1 karthago1 commented Aug 25, 2023

Calculating label_offset is unnecessary, if we just render the group label after rendering the bars. We can just reuse bar_y.

this commit is getting rid of let label_offset = bars.len() as u16 * (self.bar_width + self.bar_gap) - self.bar_gap;

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Merging #430 (194802f) into main (ad4d6e7) will increase coverage by 1.97%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
+ Coverage   87.97%   89.95%   +1.97%     
==========================================
  Files          40       40              
  Lines       10279    10876     +597     
==========================================
+ Hits         9043     9783     +740     
+ Misses       1236     1093     -143     
Files Changed Coverage Δ
src/widgets/barchart/mod.rs 92.68% <100.00%> (-0.02%) ⬇️

... and 7 files with indirect coverage changes

@karthago1 karthago1 force-pushed the hich/barchart branch 2 times, most recently from aede4eb to ebfa888 Compare August 26, 2023 07:19
Calculating the label_offset is unnecessary, if we just render the
group label after rendering the bars. We can just reuse bar_y.

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
@joshka joshka added this pull request to the merge queue Aug 27, 2023
@joshka
Copy link
Member

joshka commented Aug 27, 2023

Thanks for the PR

Merged via the queue into ratatui-org:main with commit fc727df Aug 27, 2023
30 checks passed
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.

None yet

2 participants