Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokwee committed Mar 17, 2023
2 parents 835698c + 6bde44a commit e38a6ff
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 8 deletions.
1 change: 0 additions & 1 deletion components/app/R/OPTIONS
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ WATERMARK = TRUE
TIMEOUT = 0
#TIMEOUT = 2400
HONCHO_URL = http://localhost:8000
PLOTLY_EDITOR = https://shiny-plotly-editor.cpsievert.me

#BOARDS_ENABLED = welcome,load,upload,view,clustersamples,clusterfeatures,wgcna,diffexpr,corr,enrich,pathway,wordcloud,drug,isect,sig,bio,cmap,comp,tcga,cell
#BOARDS_ENABLED = load,dataview
6 changes: 6 additions & 0 deletions components/app/R/www/editor/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"main.css": "static/css/main.fadcc9c8.css",
"main.css.map": "static/css/main.fadcc9c8.css.map",
"main.js": "static/js/main.c2f639fa.js",
"main.js.map": "static/js/main.c2f639fa.js.map"
}
Binary file added components/app/R/www/editor/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions components/app/R/www/editor/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link href="https://fonts.googleapis.com/css?family=Dosis:500,700|Open+Sans:400,400i,600,700" rel="stylesheet"><link rel="shortcut icon" href="./favicon.ico"><title>Demo App</title><link href="../static/css/main.fadcc9c8.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="../static/js/main.c2f639fa.js"></script></body></html>
1 change: 1 addition & 0 deletions components/app/R/www/editor/service-worker.js

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

2 changes: 2 additions & 0 deletions components/app/R/www/editor/static/css/main.fadcc9c8.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions components/app/R/www/editor/static/js/main.c2f639fa.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions components/app/R/www/editor/static/js/main.c2f639fa.js.map

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions components/base/R/ui-PlotModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ PlotModuleServer <- function(
cd <- session$clientData
sprintf(
"%s/?plotURL=%s//%s:%s%s%s",
PLOTLY_EDITOR,
"editor/index.html",
cd$url_protocol,
cd$url_hostname,
cd$url_port,
Expand All @@ -344,8 +344,7 @@ PlotModuleServer <- function(
httpResponse(
status = 200,
content_type = 'application/json',
content = data,
headers = list("Access-Control-Allow-Origin" = PLOTLY_EDITOR)
content = data
)
}
)
Expand Down Expand Up @@ -388,7 +387,7 @@ PlotModuleServer <- function(
download.png <- shiny::downloadHandler(
filename = "plot.png",
content = function(file) {

pdf.width <- input$pdf_width
pdf.height <- input$pdf_height
resx <- 4 ## upresolution
Expand Down Expand Up @@ -439,7 +438,7 @@ PlotModuleServer <- function(
mtext("Error. PNG not available.",line=-8)
dev.off()
}

## finally copy to final exported file
dbg("[downloadHandler.PNG] copy PNGFILE",PNGFILE,"to download file",file )
file.copy(PNGFILE, file, overwrite=TRUE)
Expand Down Expand Up @@ -511,11 +510,11 @@ PlotModuleServer <- function(
mtext("Error. PDF not available.",line=-8)
dev.off()
}

## finally copy to final exported file
dbg("[downloadHandler.PDF] copy PDFFILE",PDFFILE,"to download file",file )
file.copy(PDFFILE, file, overwrite=TRUE)

## ImageMagick or pdftk
if(TRUE && add.watermark) {
message("[plotModule] adding watermark to PDF...")
Expand Down Expand Up @@ -746,6 +745,8 @@ PlotModuleServer <- function(
# By default remove plotly logo from all plots
plot <- func() %>% plotly::config(displaylogo = FALSE) %>%
plotly::plotly_build()
plot <- plot %>%
plotly_default1()
# If there is already custom buttons, append the edit one
# (issue #2210 plotly/plotly.R)
if(inherits(plot$x$config$modeBarButtons, "list")){
Expand Down

0 comments on commit e38a6ff

Please sign in to comment.