-
Notifications
You must be signed in to change notification settings - Fork 103
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
Adds some GT table formatting functionalities #8662
Conversation
updated my master
null checking in sdgplots
more null checks
@Patowhiz delighted that even a new draft is there. I don't know whether I should be testing yet? When I try to go in it says: It does then go in. I sort of expected the Format button to work, because that was where you were were working when in the UK. It doesn't seem to? I also hope that Ana's work on the themes will soon be put back. Tell me and @lilyclements when you are ready for us to look properly. |
@rdstern you can now format title, subtitle, foot and source notes. As outlined in the package documentation, 'advanced' text formats are only supported for html output format. That means some text formats will be ignored if you export the table in other formats other than html. This is probably because the package uses @rdstern in regards to themes, I simply returned what was already implemented, I didn't delve into refactoring the code nor the design. Test for it's regression only not any additions. The new additions are only available through Describe > Tables... dialog. Once merged they can be adapted to other tables that need the new features. I have deleted lots of now redundant code in this dialog. The aim was not to refactor it but rather show how gt table dialogs can now use the features added. Test for any regression in this dialog. Kindly note that the PR doesn't fix all the items in the issues mentioned. We can keep building on top of what is currently here. |
@lilyclements this has arrived just as I am boarding for the return to England. Very exciting, and I note that @Patowhiz seems to have been "burning the midnight oil" to update this pull request. Please can you check too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Patowhiz very nice indeed so far.
a) I like the idea of the control for the footers. But how do I use the Column and Row expressions?
b) The Themes > Select Theme doesn't work yet, but it is a trivial fix to do. All the themes listed come from the gtExtras package. So you just have to add gtExtras:: in front of that element and they all work fine.
I'll check on the Manual themes next time.
There's more tabs to come, but @N-thony do you want to check too? As soon as these parts are working I would like to include this sub-dialog in the other commands and merge.
@rdstern thanks for testing this. In regards to columns and row expressions, like I said in the above comments, I'm still not sure how best to design a UI for making it easy for users to add the columns and row expressions. As outlined in the same comment, the documentation shows that footers can be used to make references to table cells. You do this by passing R expressions as parameters as shown in the example code below
The The cells_body function also allows us to style those cells. We could add |
@Patowhiz I like the new controls and think you have gone a long way - broken the back? - of this task. Odd that the 1 at the bottom isn't on the same row as the footer? Here is the current Footer for the table above: The Column and Row fields need a pull-down to help with the options. My first suggestion (to keep the options and the pull-downs simple) is as follows: i) For the second instance of the control the checkbox has the label n) For the third it is called General. The headers as for Multiple. The pull-down gives the different functions. You just choose one for each cell, and then complete that cell. You may think of something much better. I am keen that you can have the single option without needing to know coding? The general themes now works fine. I haven't checked the more complicated theme elements yet. I hope the next update could also include the remaining tabs. They would be disabled, but we would know what's coming. I assume Nanoplots could be a tab? |
@Patowhiz this is looking great - really exciting stuff! |
@rdstern I was able to have 2 footer grids; header and cells. I managed to implement the header grid, which now has title and subtitle drop down. Note, you should only set the header footer when you supply the title or the subtitle values. To implement a feature that allowed users to select the table columns, I would have to produce the |
@rdstern I have also disabled alignment for now because I'm yet to find away of styling the footer superscript label to be consistent with alignment style. The footer superscript label is added by the gt package which by default styles the parent tag. I'm contemplating enabling it for contents that don't have a footer link. |
This is looking nice, so far. Here is a table with some footnotes a) Am I limited to numbers in these controls, so which row, or column it is. There could then be pull-downs? d) The format option, above seems pretty comprehensive. Where is Bold? f) I look forward to the stub tab - I wonder whether that includes the summary variable, so we could choose to omit that column? g) Then there is a lot to look forward to, on the remaining tabs. For example I need to be able to tailor the decimal places, choose whether NA could be replaced by blanks and so on. I assume there may need to be a Column, Row and Cell tab, but maybe not. I was wondering, on the footer tab, whether giving just the row, or just the column, could place the footer at the side, or top. But it just gave the footer with no anchor and then deleted that ro in your grid. h) And I am excited about the nano-plots. i) And how do I get nice banded tables - the sort that are so prominent in Excel? You mentioned in UK that you were aiming for a set of tabs that would be better than those for the graphs. We have a lot to look forward to. It still needs a bit of a blitz though. |
Bold is under the weight option. Would you be okay with me replacing "None" with "Default"? We currently lack a way to directly determine the current settings of the Roger: Fine, of course. I define the Header as the title and subtitle only, not the columns. You can see parts of a gt table here. Roger: I think that corresponds to my point b above ? "How do I get a footnote attached to the header row. I assumed row 1, but it seems not? When I tried 0 it gave an error." The header footnote grid is designed to work with the title and subtitle. They are the only options in the grid. As I mentioned earlier, the title or subtitle must exist in the gt object, or you'll encounter an error. To avoid this, could we place this functionality under the header tab? Regarding pull-downs for columns and rows, during my exploration of the package, most functionalities assume that the user will format the output iteratively. The inputs for the output are expected to come from the Roger: When I examine the code for the examples, I assume you are right, namely there is a lot of pre-processing (often including dplyr) and that stage finishes with a gt object. Then almost all the functions act on this object. I thought this was why you wanted to just do the second stage in the new dialog/sub-dialog. I assumed your dialog/sub-dialog would simply generate those different bits of R code - like the other dialogs. I must be missing something crucial? Would you be open to expanding items g, h, and i in separate issues? You could explain the sample outputs you have in mind, and we can discuss the relevant implementation needed to achieve them. Roger: I was kinda hoping that you would be doing the first draft of that? Especially after almost 6 months on this task. |
Updated the GtTable branch from master
Fixes partly issue #8554 #8541
Replaces PR #8615