Skip to content

Commit

Permalink
Added .exportOutput method
Browse files Browse the repository at this point in the history
  • Loading branch information
seraidarian committed Jun 25, 2024
1 parent 4ca1239 commit d346615
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions R/class-AbundanceDensityPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@ setMethod(".renderOutput", "AbundanceDensityPlot",
callNextMethod()
})

#' @export
#' @importFrom grDevices pdf dev.off
setMethod(".exportOutput", "AbundanceDensityPlot",
function(x, se, all_memory, all_contents) {

contents <- .generateOutput(x, se, all_memory=all_memory, all_contents=all_contents)
newpath <- paste0(.getEncodedName(x), ".pdf")

pdf(newpath, width=slot(x, .organizationHeight)/75, height=slot(x, .organizationWidth)*2)
print(contents$plot)
dev.off()

newpath
})

#' @importFrom methods callNextMethod
setMethod(".hideInterface", "AbundanceDensityPlot", function(x, field) {

Expand Down
15 changes: 15 additions & 0 deletions R/class-AbundancePlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,21 @@ setMethod(".renderOutput", "AbundancePlot",
callNextMethod()
})

#' @export
#' @importFrom grDevices pdf dev.off
setMethod(".exportOutput", "AbundancePlot",
function(x, se, all_memory, all_contents) {

contents <- .generateOutput(x, se, all_memory=all_memory, all_contents=all_contents)
newpath <- paste0(.getEncodedName(x), ".pdf")

pdf(newpath, width=slot(x, .organizationHeight)/75, height=slot(x, .organizationWidth)*2)
print(contents$plot)
dev.off()

newpath
})

#' @importFrom methods callNextMethod
setMethod(".hideInterface", "AbundancePlot", function(x, field) {
if( field %in% c("SelectionHistory", "RowSelectionRestrict",
Expand Down
15 changes: 15 additions & 0 deletions R/class-RDAPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ setMethod(".renderOutput", "RDAPlot",
callNextMethod()
})

#' @export
#' @importFrom grDevices pdf dev.off
setMethod(".exportOutput", "RDAPlot",
function(x, se, all_memory, all_contents) {

contents <- .generateOutput(x, se, all_memory=all_memory, all_contents=all_contents)
newpath <- paste0(.getEncodedName(x), ".pdf")

pdf(newpath, width=slot(x, .organizationHeight)/75, height=slot(x, .organizationWidth)*2)
print(contents$plot)
dev.off()

newpath
})

#' @importFrom methods callNextMethod
setMethod(".hideInterface", "RDAPlot", function(x, field) {

Expand Down
15 changes: 15 additions & 0 deletions R/class-RowTreePlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,21 @@ setMethod(".renderOutput", "RowTreePlot",
callNextMethod()
})

#' @export
#' @importFrom grDevices pdf dev.off
setMethod(".exportOutput", "RowTreePlot",
function(x, se, all_memory, all_contents) {

contents <- .generateOutput(x, se, all_memory=all_memory, all_contents=all_contents)
newpath <- paste0(.getEncodedName(x), ".pdf")

pdf(newpath, width=slot(x, .organizationHeight)/75, height=slot(x, .organizationWidth)*2)
print(contents$plot)
dev.off()

newpath
})

#' @importFrom methods callNextMethod
setMethod(".hideInterface", "RowTreePlot", function(x, field) {

Expand Down

0 comments on commit d346615

Please sign in to comment.