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

tui: Use half-block characters for memory graph #504

Merged

Conversation

godlygeek
Copy link
Contributor

This is easier to read than our previous braille version, and looks nicer when rendered in a browser or VS Code. It's less granular, unfortunately. The braille version added a new dot for each ~6%, and this implementation adds a new half block for each ~11%.

This also fixes a longstanding bug: the graph was only showing half of the data points it should have been showing. Each data point would become the right braille column of one cell as well as the left braille column of the next cell, so we only had half the horizontal granularity we should have had.

@godlygeek godlygeek self-assigned this Nov 27, 2023
@godlygeek
Copy link
Contributor Author

godlygeek commented Nov 27, 2023

In fixing the bug that caused two data points like 50, 100 to show up as

⠀⢸
⠀⢸
⢸⣿
⢸⣿

instead of as

⢸
⢸
⣿
⣿

I also removed some caching inside of MemoryGraph. It seemed like overkill, considering we're only dealing with 100 data points and 200 Unicode characters. If you object to removing the caching, though, I can re-add it - the trick will be that we need to bounce between two previously rendered versions, one for even ticks and one for odd ticks.

I think that's probably overkill, but I don't think it's hard to add if you want it.

@godlygeek godlygeek force-pushed the tui_memory_graph_uses_half_blocks branch 2 times, most recently from 5ff0bc6 to 6fdde7c Compare November 27, 2023 20:26
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1cce4cb) 92.30% compared to head (bc029c3) 92.27%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #504      +/-   ##
==========================================
- Coverage   92.30%   92.27%   -0.03%     
==========================================
  Files          91       91              
  Lines       11033    11030       -3     
  Branches     1524     1526       +2     
==========================================
- Hits        10184    10178       -6     
- Misses        844      847       +3     
  Partials        5        5              
Flag Coverage Δ
cpp 85.83% <ø> (-0.09%) ⬇️
python_and_cython 95.47% <100.00%> (-0.01%) ⬇️

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.

This is easier to read than our previous braille version, and looks
nicer when rendered in a browser or VS Code. It's less granular,
unfortunately. The braille version added a new dot for each ~6%, and
this implementation adds a new half block for each ~11%.

This also fixes a longstanding bug: the graph was only showing half of
the data points it should have been showing. Each data point would
become the right braille column of one cell as well as the left braille
column of the next cell, so we only had half the horizontal granularity
we intended to have.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek godlygeek force-pushed the tui_memory_graph_uses_half_blocks branch from bc029c3 to fc3b971 Compare November 27, 2023 20:47
@pablogsal pablogsal merged commit 3f0447b into bloomberg:main Nov 28, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants