Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Commit b18abc5

Browse files
committed
分离 outtype 和 outfmt 设定
1 parent 8775440 commit b18abc5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hisub.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ collect_params <- function(x) {
465465
message("\t data rows: ", elen)
466466
message("\t esize: ", esize)
467467
if (esize > 500 & elen > 1) {
468-
edata <- edata[c(1, sample(2:(elen + 1), round(250 * elen / esize)))]
468+
edata <- edata[c(1, sort(sample(2:(elen + 1), round(250 * elen / esize))))]
469469
message("\t reset esize")
470470
}
471471
example_textarea[[y$param_name]] <<- paste(edata, collapse = "\n")
@@ -580,8 +580,13 @@ shifter <- function(x, n = -1) {
580580
if (n == 0) x else c(tail(x, -n), head(x, n))
581581
}
582582

583+
584+
outfmt <- c("pdf", "png", "tiff", "plotly", "pptx")
585+
if (any(a$return$value$outfmt %in% outfmt)) {
586+
json_data$params$config$general$imageExportType <- a$return$value$outfmt[a$return$value$outfmt %in% outfmt]
587+
}
588+
583589
if (a$return$value$outtype != "directory") {
584-
json_data$params$config$general$imageExportType <- a$return$value$outfmt[a$return$value$outfmt %in% c("pdf", "png", "tiff", "plotly", "pptx")]
585590
json_data$params$config$general$size <- list(
586591
width = if (length(a$return$value$outsetting$width) == 1) a$return$value$outsetting$width else 6,
587592
height = if (length(a$return$value$outsetting$height) == 1) a$return$value$outsetting$height else 4

0 commit comments

Comments
 (0)