Skip to content

Commit

Permalink
clean dependencies and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Dec 22, 2021
1 parent 3bef08e commit 16d05cd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 70 deletions.
15 changes: 1 addition & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,7 @@ Authors@R:
email = "[email protected]"),
person(given = "Fanny",
family = "Meyer",
role = "aut"),
person(given = "Anatolii",
family = "Saienko",
comment = "Author of dom-to-image JavaScript library",
role = "cph"),
person(given = "Eli",
family = "Grey",
comment = "Author of FileSaver JavaScript library",
role = "cph"),
person(given = "James",
family = "Hall",
comment = "Author of jsPDF JavaScript library",
role = "cph"))
role = "aut"))
Description: Add a button in web page ('Shiny' or 'RMarkdown') to take a screenshot of a specified element.
License: GPL-3
Encoding: UTF-8
Expand All @@ -30,7 +18,6 @@ Imports:
htmltools,
jsonlite,
shiny,
shinybusy,
tools
Suggests:
knitr,
Expand Down
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
export(capture)
export(capture_pdf)
export(html_dependency_capture)
export(html_dependency_domtoimage)
export(html_dependency_filesaver)
export(html_dependency_jspdf)
export(loading)
export(lookbook)
importFrom(htmltools,htmlDependency)
importFrom(htmltools,tagList)
importFrom(htmltools,tags)
importFrom(jsonlite,toJSON)
importFrom(shiny,absolutePanel)
importFrom(shinybusy,html_dependency_notiflix)
importFrom(tools,file_ext)
importFrom(utils,packageVersion)
38 changes: 2 additions & 36 deletions R/dependencies.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

#' HTML dependencies used by capture
#'
#' @param type Type of dependency to use.
#'
#' @return an [htmltools::htmlDependency()].
#' @export
Expand All @@ -19,39 +21,3 @@ html_dependency_capture <- function(type = c("image", "pdf", "lookbook")) {
script = sprintf("capture-%s.js", type)
)
}

#' @rdname html-dependencies
#' @export
html_dependency_domtoimage <- function() {
htmlDependency(
name = "dom-to-image",
version = "2.6.0",
src = list(file = "assets"),
package = "capture",
script = "dom-to-image/dom-to-image.min.js"
)
}

#' @rdname html-dependencies
#' @export
html_dependency_filesaver <- function() {
htmlDependency(
name = "FileSaver",
version = "2.0.4",
src = list(file = "assets"),
package = "capture",
script = "FileSaver/FileSaver.min.js"
)
}

#' @rdname html-dependencies
#' @export
html_dependency_jspdf <- function() {
htmlDependency(
name = "jsPDF",
version = "2.1.1",
src = list(file = "assets"),
package = "capture",
script = "jsPDF/jspdf.umd.min.js"
)
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# capture

> Add a button in Shiny application or R Markdown document to take a screenshot (PNG or PDF) of a specified element. It uses [dom-to-image](https://github.com/tsayen/dom-to-image) to convert DOM elements to PNG and [jsPDF](https://github.com/parallax/jsPDF) to generate PDF. Doesn't work in IE.
> Add a button in Shiny application or R Markdown document to take a screenshot (PNG or PDF) of a specified element. It uses [html-to-image](https://github.com/bubkoo/html-to-image) to convert DOM elements to PNG and [jsPDF](https://github.com/parallax/jsPDF) to generate PDF. Doesn't work in IE.
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
Expand Down
10 changes: 5 additions & 5 deletions man/capture.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions man/html-dependencies.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 16d05cd

Please sign in to comment.