Closed Nakilon closed 1 year ago
Hi! @Nakilon
I was not able to reproduce this in my environment. But I can guess why it happened.
irb(main):007:0> UnicodePlot.lineplot!(plot, x, y_cos, name: "cos(x)")
irb(main):008:0> plot.render
┌────────────────────────────────────────┐
1 │⠉⠑⢄⢀⠔⠉⠉⠙⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠜⠉⠉⠑⢄⢀⠔⠉⠉⠉⢢⠀⠀⠀⠀⠀⠀│ sin(x)
│⠀⠀⢈⢎⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⢈⢎⠀⠀⠀⠀⠀⠣⡀⠀⠀⠀⠀│ cos(x)
│⠀⢠⠋⠘⡄⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⢀⠎⠈⢆⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀│
│⠀⡇⠀⠀⠘⡆⠀⠀⠀⠀⠈⢢⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⡎⠀⠀⠈⢆⠀⠀⠀⠀⠀⢣⠀⠀⠀│
│⡜⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠈⢆⠀⠀⠀⠀⠀⠀⡎⠀⠀⠀⠀⠀⡸⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⢇⠀⠀│
│⠉⠉⠉⠉⠉⠉⢫⠉⠉⠉⠉⠉⠙⡍⠉⠉⠉⠉⡝⠉⠉⠉⠉⠉⡹⠉⠉⠉⠉⠉⠉⠙⡍⠉⠉⠉⠉⠉⠉⠉│
│⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠸⡀⠀⠀⡼⠀⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠈⢆⠀⠀⠀⠀⠀⢣⡀⡰⠁⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⡱⡁⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠣⡀⠀⠀⠀⠀│
-1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠣⣀⣀⣀⠔⠁⠑⢄⣀⣀⡰⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⣄⡀⠀⠀│
└────────────────────────────────────────┘
0 10
=> nil
irb(main):009:0> "⠀".ord # copy & paste space from dot plot
=> 10240
irb(main):010:0> " ".ord # space
=> 32
See the character code.
The spaces in the dot plot are not normal spaces, but 0x2800 - Braille Pattern Blank.
https://unicode-table.com/en/2800/
Perhaps you are using a programming-friendly font with visible Braille spaces to distinguish between normal spaces and special characters.
Sorry if I'm wrong.
By the way, is 3HD7.pdb a protein? https://www.rcsb.org/structure/3hd7
Not sure what you mean by "can't reproduce". I see dots in your comment
while there are no dots in terminal screenshot in repo README. Yeah, macOS Terminal uses some good font that is probably not used by default either by Chrome or by pastebin services. So it's probably not the gem issue but then I wonder what pastebin service uses the correct font so I could share the unicode_plot output looking well.
Yeah, helping a friend of mine who is a biologist. They are doing it all in Python...
I looked into the unicode_plot code. Braille Pattern Blank is here. https://github.com/red-data-tools/unicode_plot.rb/blob/caa4c5e055c44c2e48c317656ed0096f9a54b566/lib/unicode_plot/canvas/braille_canvas.rb#L27
This will be assigned to fill_char. https://github.com/red-data-tools/unicode_plot.rb/blob/caa4c5e055c44c2e48c317656ed0096f9a54b566/lib/unicode_plot/canvas.rb#L17
I tried replacing Braille Pattern Blank with a normal space, but that doesn't seem to work. It shows up like this.
@Nakilon Thanks for the reply. Actually, this is what it looks like on my display.
Yeah, helping a friend of mine who is a biologist. They are doing it all in Python...
Great!
Wow, that's unexpected. It's also without dots in Firefox and Safari. The only custom thing in my Chrome is zoom factor but changing it has no effect, hm.
UPD: the only related screenshot so far, but not helpful: https://stackoverflow.com/a/53137764/322020
@Nakilon Is your computer Mac?
I can see this issue. I use Chrome on MacBook Pro.
I investigated what was going on in my environment, then I found some information.
First, the Braille glyphs were rendered with Apple Braille font.
Second, Apple Braille font has five variations of Braille patterns:
In this screenshot of the Font Book window, the variations are implemented as the font style, such as bold and italic. I suspected that the Braille variation can be changed by specifying font-style
or font-weight
CSS property, and then I performed a simple experiment:
As a result, I got the following:
But, I don't know why the Regular style is not selected.
I found that this issue does not occur on Safari.
@Nakilon Is your computer Mac?
Yes, it probably was macOS when I posted it.
Currently on Windows it's even more awful )
First I tried to paste the dot plot to https://gist.github.com/ but the background was all dotted. Not clean like I see it in Terminal:
Then I tried another pastebin service but it looks the same:
Is there any way to make it look clean?
P.S.: same result when using the
aha
(ansi to html converter) utility.