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

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

Open
rbanffy opened this issue Aug 9, 2021 · 5 comments
Open

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

rbanffy opened this issue Aug 9, 2021 · 5 comments

Comments

@rbanffy
Copy link

rbanffy commented Aug 9, 2021

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
Copy link
Owner

amanusk commented Aug 9, 2021

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

@rbanffy
Copy link
Author

rbanffy commented Aug 9, 2021 via email

@amanusk
Copy link
Owner

amanusk commented Aug 12, 2021

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
Copy link
Collaborator

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:

  • self.eighths with the array for the top of the columns
  • self.char with the "base" char for the rest of the column

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
Copy link
Author

rbanffy commented Aug 12, 2021

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

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

No branches or pull requests

3 participants