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
Hiding columns? #146
Comments
visiblecols refers to the columns visible in the frame, so that only those are redrawn. That's why it's recalculated on every redraw. It's not to do with hiding specific columns. I would not change those values. I need to comment some of these variables.. |
Hi, i think you can update the model of the table by removing this column
in your data frame (if you are doing this with pandas)
…On Sat, Aug 17, 2019 at 6:39 AM Arbitrager ***@***.***> wrote:
I have been hiding columns by setting the column size to zero:
self.columnwidths[c] = 0
But this often winds up with the hidden column headers showing up anyway,
which looks ugly even if I stick it at the end of the table.
Looking at the code, it looks like you can set which columns are visible
by setting visiblecols variable. However on closer inspection, I see that
visiblecols is reset anytime you call redraw.
startvisiblecol, endvisiblecol = self.getVisibleCols(x1, x2)
self.visiblecols = list(range(startvisiblecol, endvisiblecol))
Anyway, is there any clean way to either set the visible column range or
else have the column headers not show up for columns with a zero width?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#146?email_source=notifications&email_token=AJGP5G6VGFSWFRZ4S567JODQE7POBA5CNFSM4IMPEZQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HFY3WIQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJGP5G354VD25JCIALXNUGDQE7POBANCNFSM4IMPEZQQ>
.
|
@JayLi2018 That would remove the column altogether. I think he just wants to hide it. |
Yeah basically I have some columns in the df that are needed for various functions but it would be prettier if the user never saw them. A simple example is where I want to show a numeric column with formatting, but I may need the numeric version for other reasons. What I do is create a column with the formatted version of the letters AND a column with the original number. Like I say, setting column width to zero kind of works. but this winds up happening: |
Yes the column header is drawn separately so you'd have to handle that aswell. Making hidden columns work is possible but a bit trickier than I thought at first. |
I think the best way to ultimately handle this is to have two df's, one for display and the other for calculations. |
I have been hiding columns by setting the column size to zero:
self.columnwidths[c] = 0
But this often winds up with the hidden column headers showing up anyway, which looks ugly even if I stick it at the end of the table.
Looking at the code, it looks like you can set which columns are visible by setting
visiblecols
variable. However on closer inspection, I see thatvisiblecols
is reset anytime you callredraw
.Anyway, is there any clean way to either set the visible column range or else have the column headers not show up for columns with a zero width?
The text was updated successfully, but these errors were encountered: