Salta al contenuto
0
  • Categorie
  • Recenti
  • Tag
  • Popolare
  • Mondo
  • Utenti
  • Gruppi
  • Categorie
  • Recenti
  • Tag
  • Popolare
  • Mondo
  • Utenti
  • Gruppi
Collassa

Forum Federato

Di Piero Bosio
  1. Home
  2. Categorie
  3. Senza categoria
  4. I want to use the unicode (partial) block symbols (https://strangeweb.page/@jochie/115118219770375106) to draw graphs:

I want to use the unicode (partial) block symbols (https://strangeweb.page/@jochie/115118219770375106) to draw graphs:

Pianificato Fissato Bloccato Spostato Senza categoria
unicodegraphprogramming
6 Post 2 Autori 9 Visualizzazioni
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Topic risposta
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
    Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
    Jochie 👨🏻‍💻🏳️‍🌈
    scritto su ultima modifica di
    #1

    I want to use the unicode (partial) block symbols (https://strangeweb.page/@jochie/115118219770375106) to draw graphs:

    chars = [' ','▏','▎','▍','▌','▋','▊','▉','█']

    The idea is that I can "scale” the horizontal bars (7/8, 6/8, 5/8, …) if/when at least one of the values gets a bit high, like this:

    1️⃣ 0
    2️⃣ 0
    3️⃣ ▉▉▉▉▉▉▉▌ 12
    4️⃣ ▉▉▉▉▉▉▉▉▏ 13
    5️⃣ ▉▉ 3
    6️⃣ 0

    In my editor/client it’s fine, but some fonts show
    U+258C “▌” as taller than the others, which is a bit annoying!

    Any suggestions/alternatives?

    #unicode #graph #programming

    Oblomovundefined 1 Risposta Ultima Risposta
    2
    • rag. Gustavino Bevilacquaundefined rag. Gustavino Bevilacqua ha condiviso questa discussione
      Oblomovundefined Oblomov ha condiviso questa discussione
    • Jochie 👨🏻‍💻🏳️‍🌈undefined Jochie 👨🏻‍💻🏳️‍🌈

      I want to use the unicode (partial) block symbols (https://strangeweb.page/@jochie/115118219770375106) to draw graphs:

      chars = [' ','▏','▎','▍','▌','▋','▊','▉','█']

      The idea is that I can "scale” the horizontal bars (7/8, 6/8, 5/8, …) if/when at least one of the values gets a bit high, like this:

      1️⃣ 0
      2️⃣ 0
      3️⃣ ▉▉▉▉▉▉▉▌ 12
      4️⃣ ▉▉▉▉▉▉▉▉▏ 13
      5️⃣ ▉▉ 3
      6️⃣ 0

      In my editor/client it’s fine, but some fonts show
      U+258C “▌” as taller than the others, which is a bit annoying!

      Any suggestions/alternatives?

      #unicode #graph #programming

      Oblomovundefined Questo utente è esterno a questo forum
      Oblomovundefined Questo utente è esterno a questo forum
      Oblomov
      scritto su ultima modifica di oblomov@sociale.network
      #2

      @jochie oh that's an interesting idea, I did something similar for sparklines using the vertical blocks
      https://wok.oblomov.eu/tecnologia/sparkling-wok/
      https://wok.oblomov.eu/tecnologia/sparkling-wok-2/
      but recently I've replaced them with SVGs.

      From my experience, the question is: which Unicode codepoints are you using *exactly*, both full and partial?

      Jochie 👨🏻‍💻🏳️‍🌈undefined 1 Risposta Ultima Risposta
      • Oblomovundefined Oblomov

        @jochie oh that's an interesting idea, I did something similar for sparklines using the vertical blocks
        https://wok.oblomov.eu/tecnologia/sparkling-wok/
        https://wok.oblomov.eu/tecnologia/sparkling-wok-2/
        but recently I've replaced them with SVGs.

        From my experience, the question is: which Unicode codepoints are you using *exactly*, both full and partial?

        Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
        Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
        Jochie 👨🏻‍💻🏳️‍🌈
        scritto su ultima modifica di
        #3

        @oblomov I like those sparklines 😁

        As far as I can tell (checked again just now), I'm using these: 2588 for the full block, and 2589..258F for the (left) 1/8..7/8 partials.

        https://www.unicode.org/charts/nameslist/n_2580.html

        Oblomovundefined 1 Risposta Ultima Risposta
        • Jochie 👨🏻‍💻🏳️‍🌈undefined Jochie 👨🏻‍💻🏳️‍🌈

          @oblomov I like those sparklines 😁

          As far as I can tell (checked again just now), I'm using these: 2588 for the full block, and 2589..258F for the (left) 1/8..7/8 partials.

          https://www.unicode.org/charts/nameslist/n_2580.html

          Oblomovundefined Questo utente è esterno a questo forum
          Oblomovundefined Questo utente è esterno a questo forum
          Oblomov
          scritto su ultima modifica di
          #4

          @jochie
          > I like those sparklines 😁

          me too 8-D

          > I'm using these: 2588 for the full block, and 2589..258F for the (left) 1/8..7/8 partials.

          Weird. The screenshot looks like your editor is substituting U+25A0 for the full block, or maybe the font doesn't have it (see also the centering wrt to the text), but then why would the “extra” on point 4 (the one with value 13) look correct? What font is your editor using?

          Jochie 👨🏻‍💻🏳️‍🌈undefined 1 Risposta Ultima Risposta
          • Oblomovundefined Oblomov

            @jochie
            > I like those sparklines 😁

            me too 8-D

            > I'm using these: 2588 for the full block, and 2589..258F for the (left) 1/8..7/8 partials.

            Weird. The screenshot looks like your editor is substituting U+25A0 for the full block, or maybe the font doesn't have it (see also the centering wrt to the text), but then why would the “extra” on point 4 (the one with value 13) look correct? What font is your editor using?

            Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
            Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
            Jochie 👨🏻‍💻🏳️‍🌈
            scritto su ultima modifica di
            #5

            @oblomov That screenshot that I think you're referring to is actually the Discord app in the Firefox browser.

            Plot twist!

            You were on to something. While writing my response I noticed that I had a bug in my code and was unintentionally using the "left 7/8 block” U+2589 where I thought I was using the full block.

            Back to the drawing board (hah) for me, and more 🤦‍♂️ feelings with regards to fonts and unicode. 😁

            Jochie 👨🏻‍💻🏳️‍🌈undefined 1 Risposta Ultima Risposta
            1
            • Jochie 👨🏻‍💻🏳️‍🌈undefined Jochie 👨🏻‍💻🏳️‍🌈

              @oblomov That screenshot that I think you're referring to is actually the Discord app in the Firefox browser.

              Plot twist!

              You were on to something. While writing my response I noticed that I had a bug in my code and was unintentionally using the "left 7/8 block” U+2589 where I thought I was using the full block.

              Back to the drawing board (hah) for me, and more 🤦‍♂️ feelings with regards to fonts and unicode. 😁

              Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
              Jochie 👨🏻‍💻🏳️‍🌈undefined Questo utente è esterno a questo forum
              Jochie 👨🏻‍💻🏳️‍🌈
              scritto su ultima modifica di
              #6

              @oblomov And for completeness, the answer the other question. I _was_ using Monaco in my editor (Emacs) but for the partial blocks it was falling back to Andale-Mono.

              Going back to the default which gets me Menlo for partial blocks and full block, and consistent heights.

              Adding that to the long list of things to consider when picking my next (coding) font. 😅

              1 Risposta Ultima Risposta
              1
              Rispondi
              • Topic risposta
              Effettua l'accesso per rispondere
              • Da Vecchi a Nuovi
              • Da Nuovi a Vecchi
              • Più Voti


              • Accedi

              • Accedi o registrati per effettuare la ricerca.
              • Primo post
                Ultimo post