tpapp / julia-repl

Run an inferior Julia REPL in a terminal inside Emacs
Other
170 stars 35 forks source link

DataFrames aren't aligned properly and ? for missing values not displayed #85

Closed prosoitos closed 4 years ago

prosoitos commented 4 years ago

Emacs 26.3 Julia 1.3.1 julia-repl-20200310.1145


This is a minor issue which has more to do with aesthetics than anything else. DataFrames don't seem to align properly.

Compare:

Emacs julia-repl

2020-03-18_16:49:50

with:

Julia REPL

2020-03-18_16:49:14

prosoitos commented 4 years ago

Also, I just realized that the ? which signals the presence of missing values in a column does not show in Emacs (look at the headings of columns 2 and 4):

Emacs julia-repl

2020-03-18_16:56:28

Julia REPL

2020-03-18_16:55:30

ghost commented 4 years ago

Emacs 26.3 Julia 1.4.2 julia-repl-1.2.0 (melpa-stable)

GUI and Terminal output are identical.


julia> using DataFrames

julia> df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"])
4×2 DataFrame
│ Row │ A     │ B      │
│     │ Int32 │ String │
├─────┼───────┼────────┤
│ 1   │ 1     │ M      │
│ 2   │ 2     │ F      │
│ 3   │ 3     │ F      │
│ 4   │ 4     │ M      │

julia> DataFrame(a = 1:2, b = [1.0, missing],                                                         
       c = categorical('a':'b'), d = [1//2, missing])                                                 
2×4 DataFrame                                                                                         
│ Row │ a     │ b        │ c    │ d         │                                                         
│     │ Int32 │ Float64? │ Cat… │ Rationa…? │                                                         
├─────┼───────┼──────────┼──────┼───────────┤                                                         
│ 1   │ 1     │ 1.0      │ 'a'  │ 1//2      │                                                         
│ 2   │ 2     │ missing  │ 'b'  │ missing   │                                                         

julia> 
tpapp commented 4 years ago

I think this is an issue the font width hinting. Eg can replicate this with Iosevka's default font, but this does not show up with Iosevka Fixed. Could also be the fallback font. This can be investigated with eg M-x describe-char.

If this shows up in an Emacs running in a terminal, then this may be a julia-repl issue, but otherwise it is just something that should be fixed by using a different font.

prosoitos commented 4 years ago

Oh, interesting. OK. Thanks for the tip!!

I guess I should close this issue then?

prosoitos commented 4 years ago

If this shows up in an Emacs running in a terminal, then this may be a julia-repl issue, but otherwise it is just something that should be fixed by using a different font.

I wasn't running Emacs in the terminal. So it must be the font problem.

tpapp commented 4 years ago

Yes, I think it is a font problem. Closing, but feel free to ask here if you think it has to do with julia-repl and I will reopen.