Skip to content

Don't use BrailleCanvas for vertical histogram by default#440

Merged
t-bltg merged 1 commit into
JuliaPlots:mainfrom
topolarity:ct/fix-histogram-braille
Jun 14, 2026
Merged

Don't use BrailleCanvas for vertical histogram by default#440
t-bltg merged 1 commit into
JuliaPlots:mainfrom
topolarity:ct/fix-histogram-braille

Conversation

@topolarity

Copy link
Copy Markdown
Contributor

The vertical histogram uses Unicode Block Elements (U+2580–U+259F) for most of its diagram, but it inherits its "blank space" Braille (U+2800) character from the active canvas.

In the terminal this works fine since everything is monospace, but in browsers this often causes visual mis-alignment since, e.g., on macOS the default fonts give Braille characters a different spacing.

Before:

       ┌          ┐
   130  █⠀⠀⠀⠀⠀⠀⠀⠀▇
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █⠀⠀⠀⠀⠀⠀⠀⠀█
        █▄⠀⠀⠀⠀⠀⠀▄█
        ██▂⠀⠀⠀⠀▃██
        ███▇▆▅▇███
        ██████████
        ██████████
        ██████████
     0  ██████████
       └          ┘
       ⠀0⠀⠀⠀⠀⠀⠀⠀⠀2⠀
       μ ± σ: 1.0 ± 0.71

After:

       ┌          ┐
   130  █        ▇
        █        █
        █        █
        █        █
        █        █
        █        █
        █        █
        █        █
        █▄      ▄█
        ██▂    ▃██
        ███▇▆▅▇███
        ██████████
        ██████████
        ██████████
     0  ██████████
       └          ┘
        0        2
       μ ± σ: 1.0 ± 0.71

The remaining mis-alignment issues in the browser are due to Github, Slack, etc. using a font-family that causes some glyphs to be filled in by one font and others to be provided by another. We can't do much about that, but at least we can fix this

@topolarity
topolarity force-pushed the ct/fix-histogram-braille branch from d5650d0 to cf80984 Compare June 8, 2026 22:24
The vertical histogram uses Unicode Block Elements (U+2580–U+259F)
for most of its diagram, but it inherits its "blank space" Braille
(U+2800) character from the active canvas.

In the terminal this works fine since everything is monospace, but in
browsers this often causes visual mis-alignment since, e.g., on macOS
the default fonts give Braille characters a different spacing.
@topolarity
topolarity force-pushed the ct/fix-histogram-braille branch from cf80984 to c9ce848 Compare June 9, 2026 00:39
@topolarity

Copy link
Copy Markdown
Contributor Author

pre failures are because the hash implementation in Julia 1.13, and Contours.jl seeds its algorithm with the first(...) entry of a dict (the contour lines changed, so the plot did as well)

Not related to this PR anyway

@t-bltg

t-bltg commented Jun 14, 2026

Copy link
Copy Markdown
Member

Oh I see you are right, vertical histogram have slightly diverged from the original implementation of horizontal histograms which are using BlockCanvases.

I have to cleanup the implementation at some point but your fix is very much valid.

@t-bltg
t-bltg merged commit 594cbd9 into JuliaPlots:main Jun 14, 2026
9 of 10 checks passed
@t-bltg t-bltg mentioned this pull request Jun 14, 2026
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

Successfully merging this pull request may close these issues.

2 participants