loony-bean / textplots-rs

Terminal plotting library for Rust
238 stars 24 forks source link

Consider using unicode character U+2800 for braille plots #42

Closed adri326 closed 1 year ago

adri326 commented 1 year ago

First of all, thank you for this library, it's really nice to be able to render graphs without leaving the terminal.

Blank rectangles in braille plots are currently filled in using the U+0020 (SPACE) character, which works fine in some terminals, but renders poorly in others. Examples include the chrome console and the chromeos terminal (see screenshot below).

Braille line plot rendered in the chromeos terminal, with Source Code Pro:

Braille line plot rendered in the chromeos terminal

Braille line plot rendered in the VSCode console, with Hasklig:

Braille line plot rendered in the VSCode console

I would recommend using the U+2800 (BRAILLE PATTERN BLANK) character instead, which would guarantee that the graphs look right even on poorly-implemented terminals.

Monkey-patched version of the first screenshot, with the output piped into grep (VSCode looked identical):

Braille line plot rendered in the chromeos terminal, with u+2800 monkey-patched