-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
library(shiny) | ||
library(capture) | ||
|
||
ui <- fluidPage( | ||
tags$h2("Capture PDF (scales) example"), | ||
capture_pdf( | ||
selector = "body", | ||
filename = "pdf-default-scale", | ||
icon("camera"), "Default scale", | ||
loading = loading() | ||
), | ||
capture_pdf( | ||
selector = "body", | ||
filename = "pdf-larger-scale", | ||
icon("camera"), "Larger scale", | ||
scale = 2.5, | ||
loading = loading() | ||
), | ||
capture_pdf( | ||
selector = "body", | ||
filename = "pdf-smaller-scale", | ||
icon("camera"), "Smaller scale", | ||
scale = 0.9, | ||
loading = loading() | ||
), | ||
tags$br(), | ||
fluidRow( | ||
column( | ||
width = 4, | ||
wellPanel( | ||
tags$b("Parameters :"), | ||
|
||
selectInput( | ||
inputId = "loi", | ||
label = "Law:", | ||
choices = c("normal", "uniform", "exponential") | ||
) | ||
) | ||
), | ||
column( | ||
width = 8, | ||
tags$div( | ||
id = "result-block", | ||
tags$b("Results :"), | ||
plotOutput(outputId = "plot"), | ||
uiOutput(outputId = "mean"), | ||
verbatimTextOutput(outputId = "raw") | ||
) | ||
) | ||
) | ||
) | ||
|
||
server <- function(input, output, session) { | ||
distrib_r <- reactive({ | ||
switch( | ||
input$loi, | ||
"normal" = rnorm(1000), | ||
"uniform" = runif(1000), | ||
"exponential" = rexp(1000) | ||
) | ||
}) | ||
|
||
output$plot <- renderPlot({ | ||
hist(distrib_r()) | ||
}) | ||
|
||
output$mean <- renderUI({ | ||
tags$p(tags$b("The mean is :"), round(mean(distrib_r()), 2)) | ||
}) | ||
|
||
output$raw <- renderPrint({ | ||
summary(distrib_r()) | ||
}) | ||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,56 +236,6 @@ | |
WebPRiffParser [email protected] | ||
*/ | ||
|
||
/** @license | ||
* | ||
* jsPDF - PDF Document creation from JavaScript | ||
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z | ||
* CommitID 00000000 | ||
* | ||
* Copyright (c) 2010-2021 James Hall <[email protected]>, https://github.com/MrRio/jsPDF | ||
* 2015-2021 yWorks GmbH, http://www.yworks.com | ||
* 2015-2021 Lukas Holländer <[email protected]>, https://github.com/HackbrettXXX | ||
* 2016-2018 Aras Abbasi <[email protected]> | ||
* 2010 Aaron Spike, https://github.com/acspike | ||
* 2012 Willow Systems Corporation, https://github.com/willowsystems | ||
* 2012 Pablo Hess, https://github.com/pablohess | ||
* 2012 Florian Jenett, https://github.com/fjenett | ||
* 2013 Warren Weckesser, https://github.com/warrenweckesser | ||
* 2013 Youssef Beddad, https://github.com/lifof | ||
* 2013 Lee Driscoll, https://github.com/lsdriscoll | ||
* 2013 Stefan Slonevskiy, https://github.com/stefslon | ||
* 2013 Jeremy Morel, https://github.com/jmorel | ||
* 2013 Christoph Hartmann, https://github.com/chris-rock | ||
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria | ||
* 2014 James Makes, https://github.com/dollaruw | ||
* 2014 Diego Casorran, https://github.com/diegocr | ||
* 2014 Steven Spungin, https://github.com/Flamenco | ||
* 2014 Kenneth Glassey, https://github.com/Gavvers | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* Contributor(s): | ||
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, | ||
* kim3er, mfo, alnorth, Flamenco | ||
*/ | ||
|
||
/** @license | ||
* Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems | ||
* | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters