-
Notifications
You must be signed in to change notification settings - Fork 56
use PrettyTables instead of rolling our own #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: kc/basic_maintaince
Are you sure you want to change the base?
Conversation
Hi @KristofferC!
Not currently, but I think I can implement it! We can specify one column and the algorithm will try to shrink that first by setting its maximum size before cutting the right part. I will try to do this before releasing v3!
Yes, these features like merge column labels are only available in v3. It is unreleased but there is only one feature missing to fully support DataFrames.jl printing as it is today. I am almost sure I will be able to tag v3 this weekend if nothing goes wrong.
By default, PrettyTables.jl asks for the terminal to print merged labels with underlines. That's why you cannot see them when you copy the text. Do you want a feature to allow the algorithm to draw a line only on the bottom of merged cells?
Yes! All column labels besides the first line are drawn in gray to match the previous behavior. If you want to change, just add something like: |
Seems like a reasonable direction to go in. I played with adding what could be an optional column and some experimental color coding here #193 I mention that just to factor in potential ideas like that in case this would restrict those kind of features at all. (not that they're approved or really being actively developed) |
Thanks for all the answers @ronisbr. There is no rush with this PR so take whatever time you need with v3 :). @IanButterworth, I don't think this should be any hindrance for stuff like that, if anything, it would make new features like that easier since one won't have to mess with my hacky table printing code. |
Hi @KristofferC ! I added an option to the text backend called ![]() ![]() Can you please test and tell me if it is working as you want or if I need to make any modifications? |
Will do, I am on a tenting trip right now so will take a couple of days for me to be able to test. |
It works quite nice!
Although perhaps I would want to be able to set a minimum width of it, if I make it quite small I get:
which at that point I rather see a bit of the section column and have it truncate on the right for the rest. |
Awesome! I just added the option |
Works great!
|
Awesome! I just need to implement one last feature (somewhat complicated) and v3 is ready to go! |
This outsources the table printing to PrettyTables.jl. I initially used an LLM to do the first implementation and then fixed things up manually. I want to do some further improvements to the display and allow for more customization so using an external table renderer seems like a good idea. Right now (with PrettyTables), the output looks like:
compared to the previous:
One thing I liked about the previous implementation is that if the width of the terminal gets too small, it starts making the sections smaller:
With PrettyTables it instead starts to truncate the rightmost columns:
@ronisbr, is there a possibility of choising a specific column that gets narrowed instead of narrowing the table to the right? Also, right now I was using (what I think is) the v3 API but that is not released yet, right?