Rich Terminal Interfaces with Ratatui

  Рет қаралды 32,878

chris biscardi

chris biscardi

Жыл бұрын

ratatui is a Rust library to build rich terminal user interfaces and dashboards. It is a fork of the original tui-rs project.
* github.com/ratatui-org/ratatui
* docs: docs.rs/ratatui/latest/ratatui/
* examples: github.com/ratatui-org/ratatu...

Пікірлер: 42
@lowellthoerner1209
@lowellthoerner1209 11 ай бұрын
If anyone has any questions about the library, I am one of the contributors and can answer some questions :)
@brianlogan4740
@brianlogan4740 10 ай бұрын
I have been attempting to dive into Rust for years now and mostly only accomplish keeping up with "This week in Rust", and cloning GitHub projects and running them. Is there a community preferably also involved with Ratatui that I could join to get some support and learn more?
@sponkurtus2597
@sponkurtus2597 7 ай бұрын
I have one, i currently making a ascii image shower, so in my terminal app, you can see the ascii image inside a block with borders, the problem is, if the terminal size is too small, the ascii image wont shot 100%, how can i make the ascii images responsive?
@lowellthoerner1209
@lowellthoerner1209 7 ай бұрын
@@sponkurtus2597 you would have to determine the viewport size with the rendering function, then adjust the size of the image appropriately before rendering it out.
@Iris-jw3ci
@Iris-jw3ci 3 ай бұрын
any idea how to use dbg!, print useful values, etc?
@lowellthoerner1209
@lowellthoerner1209 3 ай бұрын
@@Iris-jw3ci well you can’t directly use print macros because they would print to stdout/stderr. However, you could use a Paragraph widget to display arbitrary text upon calling a function, which you could format with the fmt macro.
@leifelliott1500
@leifelliott1500 Жыл бұрын
This library makes me want to create an old-school rpg, with the Canvas widget as the game map...
@pgjybbtqnrqehbkffbntwnhph2924
@pgjybbtqnrqehbkffbntwnhph2924 11 ай бұрын
Do it buddy and share the link 😊
@JosephDalrymple
@JosephDalrymple 11 ай бұрын
Do it!
@brianlogan4740
@brianlogan4740 10 ай бұрын
Ratatui is dope but you should also check out Bevy for the ECS for games. I believe they have terminal app examples as well.
@15MinuteWellness
@15MinuteWellness 6 ай бұрын
I was thinking really old school, text-based adventures, with this as a HUD showing the current scene, the characters possesions and status, and a place for descriptions, decisions, and conversations.
@one.----
@one.---- Жыл бұрын
I really appreciate these videos. You're hitting all the things on my list that I want to check out but haven't had the time.
@birraasmile9722
@birraasmile9722 Жыл бұрын
Thank you bro, we love you for your Rust topics.
@felixst-gelais6722
@felixst-gelais6722 Жыл бұрын
its always a good day when chris drops a video
@joseph0x45
@joseph0x45 Жыл бұрын
Nice, gonna be trying it out for sure
@micmine
@micmine 11 ай бұрын
Nice video. I liked that you have investigated to do an own demo.
@MoAliDevOps
@MoAliDevOps Жыл бұрын
Pretty nice to see my own project on your video (Jirust). Ratatui is pretty nice, fairly easy to use.
@jacekkurlit8403
@jacekkurlit8403 Жыл бұрын
This looks really dope
@TeamDman
@TeamDman Жыл бұрын
Holy cow thanks for the great vid!
@flyingsquirrel3271
@flyingsquirrel3271 Жыл бұрын
Looks nice! When I recently wanted to add a TUI to a command line tool I wrote, I also tried ratatui, but found cursive much easier to use though.
@chrisbiscardi
@chrisbiscardi Жыл бұрын
I'm glad you found a crate that worked for you!
@lagcisco
@lagcisco Жыл бұрын
good stuff man
@maxwebstudio
@maxwebstudio 7 ай бұрын
Awesome !!!!
@user-qr4jf4tv2x
@user-qr4jf4tv2x 10 ай бұрын
the only UI framework that has example that isn't as hard configuring
@wtfisgoingon535
@wtfisgoingon535 Ай бұрын
You don't need the arc/mutex here, just use a a classic struct/impl combo.
@martinbecker1069
@martinbecker1069 Жыл бұрын
Is Ratatui immediate or can you store the GUI tree for re-use?
@chrisbiscardi
@chrisbiscardi Жыл бұрын
yes it is immediate. It expects you to build every widget on every frame. They also note that the overhead of this is usually negligible compared to the overhead of the terminal emulator.
@lowellthoerner1209
@lowellthoerner1209 11 ай бұрын
Stateful widgets are an existing feature but are pretty limited at the moment. Generally, it uses immediate rendering.
@juxtar
@juxtar 29 күн бұрын
Hey could you please share the github repository for the Decibel Level visualiser, that looks cool.
@chrisbiscardi
@chrisbiscardi 29 күн бұрын
I actually had never uploaded it, but just went and found the directory today github.com/rust-adventure/yt-ratatui-audio-viz/tree/main There's some extra files and whatnot since I was starting to move towards using wgpu iirc, but the core program seen in the video still works. use cargo run.
@oredaze
@oredaze 6 ай бұрын
I must say the name is the best, so if this doesn't become the new ncurses I am going to be sad xD
@Phant80m
@Phant80m Жыл бұрын
W rataTUI
@cchance
@cchance Жыл бұрын
Silly question that drove me nuts why didn’t you just do -100 to fix the db chart so that higher would be… higher lol
@chrisbiscardi
@chrisbiscardi Жыл бұрын
I'm going to assume you mean +100 because -100 would make it even lower. I didn't do that because 100 is a totally arbitrary number. Why not 75, or 125? and it results in arbitrarily cutting off the data. The problem was that the dBFS level for an f32 sample is between -758 dBFS and 770 dBFS (you can read more about that here: www.sounddevices.com/32-bit-float-files-explained/ ), I had to fit that into a u64 to graph the sparkline. Doing .abs() loses the least amount of data without needing to pick an arbitrary cutoff. I could've also lerped to get a value from 0-1 but I didn't think about it for more than a second because it wasn't important to the project as long as I could represent any data that came in.
@cchance
@cchance Жыл бұрын
@@chrisbiscardi I meant subtract the value after absolute from whatever the minimum was for noise floor which i thought you said in video was -100, so 100-abs(-100) would have been 0, just felt like such a minor thing to miss out on fixing :) really great video nonetheless
@chrisbiscardi
@chrisbiscardi Жыл бұрын
@@cchance yeah, the way the audio interface I have works, is a self-noise level of -127dBu (which isn't necessarily the same as dBFS), and it contains what I'll refer to as "two sensors". It switches between them to capture the full range its capable of and is an 32-bit float recorder, so it doesn't have "gain" in the same way as a 24-bit recorder. This means it doesn't clip, but also means it can amplify up or down the signal in whatever manner without affecting the actual data. So I could get a different level signal coming into the computer if I was recording something much quieter or louder. That's why I went with something more like .abs(). Its more important for me to be able to not lose data, since this is just a debugging visualizer, than to have a low-to-high graph.
@babitasaha6655
@babitasaha6655 11 ай бұрын
which colour scheme are you using on your vscode?
@chrisbiscardi
@chrisbiscardi 11 ай бұрын
Nightowl
@babitasaha6655
@babitasaha6655 11 ай бұрын
@@chrisbiscardi thanks
Write Rustier Rust
12:13
chris biscardi
Рет қаралды 36 М.
I spent six months rewriting everything in Rust
15:11
chris biscardi
Рет қаралды 418 М.
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 10 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 37 МЛН
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 13 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 54 МЛН
A Tour of Iced 0.10
14:46
chris biscardi
Рет қаралды 22 М.
7 (more) AWESOME Linux CLI/Terminal Apps
14:21
TechHut
Рет қаралды 109 М.
Xilem: Let's Build High Performance Rust UI - Raph Levien
41:47
Rust Nederland (RustNL)
Рет қаралды 6 М.
Why You Shouldn’t Build Your Next App in Rust
9:18
warpdotdev
Рет қаралды 87 М.
What Makes A Good Cli Tool | Prime Explains
4:26
ThePrimeTime
Рет қаралды 60 М.
A Simpler Way to See Results
19:17
Logan Smith
Рет қаралды 102 М.
I made my own Text Editor (in Rust)
8:16
FaceDev
Рет қаралды 103 М.
Build your entire tech stack in Rust
7:22
Let's Get Rusty
Рет қаралды 206 М.
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 545 М.