amanusk / s-tui

Terminal-based CPU stress and monitoring utility
https://amanusk.github.io/s-tui/
GNU General Public License v2.0
4.28k stars 147 forks source link

Use Unicode Block Graphics U+2581-U+2588 for bar graphs #176

Open rbanffy opened 3 years ago

rbanffy commented 3 years ago

Is your feature request related to a problem? Please describe. The vertical resolution of the bar graphs is a character cell. It'd be 8x higher if using the block graphics between U+2581 and U+2588. Alternatively, horizontal and vertical resolutions can be doubled with 2x2 mosaics from U+2599 to U+259F. Optionally, depending on termina/font support, we could triple vertical resolution with the 2x3 mosaics introduced in Unicode 13

Describe the solution you'd like Graphs would have a higher resolution

amanusk commented 3 years ago

Sounds super useful. Could you be so kind to make a Pull Request for this?

rbanffy commented 3 years ago

As soon as I figure out how the bars are drawn. Is this in this codebase or is it something that comes from urwid?

On Mon, Aug 9, 2021 at 4:12 PM Alex Manuskin @.***> wrote:

Sounds super useful. Could you be so kind to make a Pull Request for this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amanusk/s-tui/issues/176#issuecomment-895307824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABNDCUISQM64DO7HBBUCU3T37V5ZANCNFSM5BZWBDCA .

-- Ricardo Bánffy http://about.me/rbanffy

amanusk commented 3 years ago

Most of the parameters of urwid can be overridden, we do some of it in sturwid. I guess this can be as well. @giltsuker is the expert on this honestly

giltsuker commented 3 years ago

From what I can tell and remember a bit, In bar_graph_vector.py, after we call the constructor of the native BarGraph class, I think you can override the native characters of the urwid base class. override:

Note that they should be an array I think for the 2 types of colors we use. Probably some trial and error will be needed :)

rbanffy commented 3 years ago

Funny. You are not overriding the eights, but I saw the graph with full cells only... The eights should show. image