Comments (10)
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.
Btw. for these we need fallbacks if UTF-8 characters are not available....
from cli.
I meant a helper that would map from [0, 1] to a bar
from cli.
Oh, OK, makes sense.
from cli.
But I suppose you don't want to create the sparklines with this package?
from cli.
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.
Unfortunately these blocks are not available in the default font in RGui.... so I'll have some replacements...
from cli.
This exists already, actually:
spark::spark(runif(50))
▂▃▇▃▂▅▂▁▄▃▃▃▆▂▇▂██▆▂▄▆▃▅▂▃▂▆▁▆▆▁█▇█▄▁▁▂▂▆▇▇▅▆▂▄▃▂█
from cli.
I will brush up spark
a bit...
from cli.
spark
should be good now, once the clisymbols
update is on CRAN, I'll submit it.
from cli.
Related Issues (20)
- cli_vec: vec-trunc not working HOT 2
- Progress bar for `furrr::future_map` and `future.apply::future_lapply` functions HOT 1
- cli update from CRAN HOT 2
- cli::pb_current_name HOT 1
- FR: Add subtle style inline markup
- Add a "default" option to hyperlink detection
- Release cli 3.6.2
- Changing color for bullets
- Bad formatting when passing bare lubdridate dates HOT 4
- `cli_warning` and `cli_inform` don't expose individual bullet points in condition object. HOT 3
- Internal error with `ansi_strwrap`when string contains `\r\n\r` in `cli_abort()` message HOT 1
- Never seeing the first progress message from `cli_progress_along()`
- Suggestion: `cli_abort_if_not()` HOT 3
- More control over indentation for `cli_bullets()`
- Quote `{.field FIELD}` when there's no color
- Adding "last" argument to `cli_abort`
- R_CLI_HYPERLINK_MODE should add a third leading slash on Windows
- Feature request: positive/negative "pluralization" HOT 1
- Fix formatting for call objects HOT 3
- `vec-last` ignored when only 2 elements are provided HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.