Git Product home page Git Product logo

Comments (10)

gaborcsardi avatar gaborcsardi commented on May 30, 2024

You mean in rule? You can, already, but we can provide some shortcuts:

❯ cat(rule(center = "TITLE", line = "\u2581"))
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ TITLE ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
❯ cat(rule(center = "TITLE", line = "\u2582"))
▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ TITLE ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂
❯ cat(rule(center = "TITLE", line = "\u2583"))
▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃ TITLE ▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃
❯ cat(rule(center = "TITLE", line = "\u2584"))
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ TITLE ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
❯ cat(rule(center = "TITLE", line = "\u2585"))
▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅ TITLE ▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅
❯ cat(rule(center = "TITLE", line = "\u2586"))
▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ TITLE ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆
❯ cat(rule(center = "TITLE", line = "\u2587"))
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ TITLE ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
❯ cat(rule(center = "TITLE", line = "\u2588"))
█████████████████████████████████████ TITLE ████████████████████████████████████

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

Btw. for these we need fallbacks if UTF-8 characters are not available....

from cli.

hadley avatar hadley commented on May 30, 2024

I meant a helper that would map from [0, 1] to a bar

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

Oh, OK, makes sense.

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

But I suppose you don't want to create the sparklines with this package?

from cli.

hadley avatar hadley commented on May 30, 2024

That feels out-of-scope to me. I'd say boxes should have a function that takes a numeric vector with values between 0 and 1 and returns a single string.

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

Unfortunately these blocks are not available in the default font in RGui.... so I'll have some replacements...

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

This exists already, actually:

spark::spark(runif(50))
▂▃▇▃▂▅▂▁▄▃▃▃▆▂▇▂██▆▂▄▆▃▅▂▃▂▆▁▆▆▁█▇█▄▁▁▂▂▆▇▇▅▆▂▄▃▂█

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

I will brush up spark a bit...

from cli.

gaborcsardi avatar gaborcsardi commented on May 30, 2024

spark should be good now, once the clisymbols update is on CRAN, I'll submit it.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.