Skip to content

Commit

Permalink
Merge branch 'master' into batpigandme-web-image-doc
Browse files Browse the repository at this point in the history
* master: (59 commits)
  add fmt_markdown to _pkgdown.yml (rstudio#371)
  Use `tidy_grepl()` instead of `expect_match()`
  Use `tidy_grepl()` & `expect_true()`
  Add `dt_*()` methods for all major, internal data structures (rstudio#355)
  Update CLA text (rstudio#373)
  remove reliance on Github version of sass, which is now updated on CRAN (rstudio#366)
  Fix for invisible top borders in rendered HTML tables (rstudio#359)
  CSS modifications (rstudio#346)
  Incorporate alpha option to `cell_fill()` (rstudio#340)
  Enable option to set row group padding in `tab_options()` (rstudio#342)
  Modify `filter()` statement (rstudio#341)
  Allow use of integers in `pct()`/`px()` (rstudio#336)
  Fix for resolving row group cells (rstudio#335)
  Easier access to footnote mark options (rstudio#333)
  Export `as.tags.gt_tbl()` (rstudio#331)
  Several `rlang`-based fixes (rstudio#334)
  Add function to specify column widths: `cols_widths()` (rstudio#293)
  Add `rstudio/sass` to Remotes list (rstudio#326)
  Fix for `cell_borders()` (rstudio#323)
  Allow an empty table with zero rows to create an empty gt table (rstudio#283)
  ...
  • Loading branch information
rich-iannone committed Nov 11, 2019
2 parents 898d839 + 8f983ec commit 983b3ab
Show file tree
Hide file tree
Showing 435 changed files with 19,286 additions and 75,625 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ tests/examples
tests/manual_tests
^vignettes/videos$
^vignettes/images/apng$
^TODOS
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Once there is consensus that a PR based on the issue would be helpful, adhering
* The internal documentation uses [roxygen2](https://cran.r-project.org/web/packages/roxygen2/vignettes/roxygen2.html); if your contribution requires new or revised documentation ensure that the roxygen comments are added/modified (do not modify any `.Rd` files in the `man` folder).
* We use [testthat](https://cran.r-project.org/web/packages/testthat/) for code coverage; those contributions with test cases included are helpful easier to accept.
* Add a bullet to the top of `NEWS.md` below the current development version header describing any user-facing changes made; include your GitHub username, and links to relevant issue(s)/PR(s).
* Fill out and sign the [individual](https://rstudioblog.files.wordpress.com/2017/05/rstudio_individual_contributor_agreement.pdf) or [corporate](https://rstudioblog.files.wordpress.com/2017/05/rstudio_corporate_contributor_agreement.pdf) contributor agreement as appropriate; then send the signed copy to [email protected].
* Ensure that you have signed the contributor license agreement. It will appear as a "Check" on your PR and a comment from "CLAassistant" will also appear explaining whether you have yet to sign. After you sign, you can click the "Recheck" link in that comment and the check will flip to reflect that you've signed.
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
inst/doc
# History files
.Rhistory
.Rapp.history

# Docs folder from `pkgdown::build_site()`
docs/
inst/doc

# Session Data files
.RData

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# knitr and R markdown default cache directories
/*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md
.Rproj.user

# Other files
.DS_Store
test.rtf
66 changes: 54 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,61 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
# R for travis: documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages
cache:
packages: true
warnings_are_errors: false

# This library is required for installing the `rgl` pkg dependency
addons:
apt:
packages:
- libglu1-mesa-dev

r:
- oldrel
- release
- devel

notifications:
email:
on_success: change
on_failure: change

jobs:
include:
- r: oldrel
- r: release
- r: devel
- os: osx
r: release

r_binary_packages:
- covr
- stage: deploy
name: covr
r: release
cache:
packages: false
r_binary_packages:
- covr
script:
- Rscript -e "covr::codecov()"

after_success:
- Rscript -e 'covr::codecov()'
- stage: deploy
name: pkgdown
r: release
cache:
packages: false
if: |
branch IN (master, travis) AND \
type = push AND \
repo = rstudio/gt
r_binary_packages:
- pkgdown
- remotes
script:
- Rscript -e "remotes::install_local()"
- Rscript -e "pkgdown::build_site()"
- Rscript -e "remove.packages('gt')"
deploy:
provider: pages
local-dir: docs
skip-cleanup: true
keep-history: false
on:
all_branches: true
github-token:
secure: "GrujWLlpdgy59mI5ZiYnlT8p1LDpqoms/ROeBuFOhJ6tZa6lNYzG4tR2iGkJS5a9hykMbkDootmx95ktC/ovjvFrWXLb8Ql+XiWri1cb17G3SzcEz7m35RA6fKNsu9BVM1qhydBnSS6UtFGWkK/+4dqkT3/3b7XnO2WmF8MtFno9iPnBRybgIYjt5qrBNUZQPcvkjL6FV1x2X2O5lwrH4ND7ueM6wgs5BtxCQxhaBcu9gmDbjlnPsfCbqQvxVNuifguF9AzDPE97nylDyr9jeycehWkvHioFKjYhK/yWfANuXGOgYb0I+vCyxDfxIrOfc+IhUEGaSxqZ3H3fy3Mdc8Bd2+IhC6KbdpSJiB57N1OPIHj6I8a9YlELZN2EczDXUxfvppTlDYBAWUpfI2uPoBMskBTgPXP838u+jNrAcMERkNAIgb4VOPVnf+MbGei2gfSWXmFvH+z0EjwpPxhv0nP1+5TT2RsErwpEyrA8qO14uICx+/gKPZulMKeZApjWYtOyJRjeRYPFUwrLx8S52CeR1el5QyiuPke9oTxmg9gMuoVWGReoDvtOIaz6LbgUPy9/o+gHNPb70DLYii9h2thzJtMTr30jnpGsosIaBghpregaOvxEIyo5xJGRBn9z0R1n6VnRWjyIC/VTh0ljn1pvC26LVrQj7DKa8SMP6Jw="
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ Imports:
checkmate (>= 1.8.5),
commonmark (>= 1.7),
dplyr (>= 0.7.8),
fs (>= 1.2.6),
ggplot2 (>= 3.1.0),
glue (>= 1.3.0),
htmltools (>= 0.3.6),
magrittr (>= 1.5),
rlang (>= 0.3.0),
sass (>= 0.1.1),
scales (>= 1.0.0),
sass (>= 0.1.0),
stringr (>= 1.3.1),
tibble (>= 1.4.2),
tidyr (>= 0.8.2),
tidyselect (>= 0.2.5)
Remotes:
rstudio/sass
Suggests:
knitr,
paletteer,
Expand All @@ -48,5 +46,8 @@ Suggests:
rmarkdown,
rvest,
shiny,
tidyr,
webshot,
xml2
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
71 changes: 15 additions & 56 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Generated by roxygen2: do not edit by hand

S3method(as.data.frame,gt_tbl)
S3method(print,gt_tbl)
export("%>%")
export(adjust_luminance)
export(as_latex)
export(as_raw_html)
export(as_rtf)
export(cell_borders)
export(cell_fill)
export(cell_text)
export(cells_column_labels)
export(cells_column_spanners)
export(cells_data)
export(cells_grand_summary)
export(cells_group)
export(cells_stub)
export(cells_stubhead)
export(cells_styles)
export(cells_summary)
export(cells_title)
Expand All @@ -22,8 +29,9 @@ export(cols_merge_uncert)
export(cols_move)
export(cols_move_to_end)
export(cols_move_to_start)
export(cols_split_delim)
export(cols_width)
export(contains)
export(currency)
export(data_color)
export(ends_with)
export(escape_latex)
Expand All @@ -33,13 +41,15 @@ export(fmt)
export(fmt_currency)
export(fmt_date)
export(fmt_datetime)
export(fmt_markdown)
export(fmt_missing)
export(fmt_number)
export(fmt_passthrough)
export(fmt_percent)
export(fmt_scientific)
export(fmt_time)
export(ggplot_image)
export(grand_summary_rows)
export(gt)
export(gt_latex_dependencies)
export(gt_output)
Expand All @@ -55,8 +65,10 @@ export(local_image)
export(matches)
export(md)
export(one_of)
export(opt_footnote_marks)
export(pct)
export(px)
export(random_id)
export(render_gt)
export(row_group_order)
export(starts_with)
Expand All @@ -67,75 +79,22 @@ export(tab_options)
export(tab_row_group)
export(tab_source_note)
export(tab_spanner)
export(tab_stubhead_label)
export(tab_spanner_delim)
export(tab_stubhead)
export(tab_style)
export(test_image)
export(text_transform)
export(vars)
export(web_image)
import(checkmate)
import(rlang)
import(sass)
import(tidyselect)
importFrom(checkmate,test_class)
importFrom(commonmark,markdown_html)
importFrom(commonmark,markdown_latex)
importFrom(commonmark,markdown_text)
importFrom(dplyr,arrange)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,distinct)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,full_join)
importFrom(dplyr,group_by)
importFrom(dplyr,group_vars)
importFrom(dplyr,inner_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_at)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,slice)
importFrom(dplyr,summarize)
importFrom(dplyr,summarize_all)
importFrom(dplyr,tibble)
importFrom(dplyr,tribble)
importFrom(dplyr,ungroup)
importFrom(dplyr,vars)
importFrom(ggplot2,ggsave)
importFrom(glue,glue)
importFrom(grDevices,col2rgb)
importFrom(grDevices,convertColor)
importFrom(grDevices,hcl)
importFrom(htmltools,HTML)
importFrom(htmltools,as.tags)
importFrom(htmltools,doRenderTags)
importFrom(htmltools,findDependencies)
importFrom(htmltools,htmlEscape)
importFrom(htmltools,resolveDependencies)
importFrom(htmltools,save_html)
importFrom(htmltools,tagList)
importFrom(htmltools,tags)
importFrom(magrittr,"%>%")
importFrom(scales,col_factor)
importFrom(scales,col_numeric)
importFrom(stats,setNames)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_match)
importFrom(stringr,str_remove)
importFrom(stringr,str_replace)
importFrom(stringr,str_replace_all)
importFrom(stringr,str_split)
importFrom(stringr,str_trim)
importFrom(tibble,rownames_to_column)
importFrom(tidyr,fill)
importFrom(tidyselect,contains)
importFrom(tidyselect,ends_with)
importFrom(tidyselect,everything)
importFrom(tidyselect,matches)
importFrom(tidyselect,one_of)
importFrom(tidyselect,starts_with)
importFrom(tools,file_ext)
importFrom(utils,globalVariables)
30 changes: 30 additions & 0 deletions R/as_data_frame.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#' @export
as.data.frame.gt_tbl <- function(x, ...) {

data <- x

data_built <-
data %>%
build_data(context = "html")

ret <-
data_built %>%
dt_body_get() %>%
as.data.frame(stringsAsFactors = FALSE)

has_rowname <-
data_built %>%
dt_stub_components() %>%
dt_stub_components_has_rowname()

if (has_rowname) {
rowname_vals <-
data_built %>%
dt_stub_df_get() %>%
dplyr::pull(rowname)

rownames(ret) <- rowname_vals
}

ret
}
Loading

0 comments on commit 983b3ab

Please sign in to comment.