├── vignettes
├── .gitignore
├── callbacks.Rmd
├── pagePiling.Rmd
├── multiScroll.Rmd
└── fullPage.Rmd
├── LICENSE
├── fullPage.gif
├── .gitignore
├── docs
├── favicon.ico
├── favicon-16x16.png
├── favicon-32x32.png
├── apple-touch-icon.png
├── apple-touch-icon-60x60.png
├── apple-touch-icon-76x76.png
├── apple-touch-icon-120x120.png
├── apple-touch-icon-152x152.png
├── apple-touch-icon-180x180.png
├── pkgdown.yml
├── link.svg
├── docsearch.js
├── pkgdown.js
├── pkgdown.css
├── LICENSE-text.html
├── articles
│ ├── index.html
│ └── callbacks.html
├── authors.html
├── news
│ └── index.html
├── index.html
└── reference
│ ├── sides.html
│ ├── theme.html
│ ├── container.html
│ └── mp.html
├── revdep
└── checks.rds
├── pkgdown
├── favicon
│ ├── favicon.ico
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── apple-touch-icon.png
│ ├── apple-touch-icon-120x120.png
│ ├── apple-touch-icon-152x152.png
│ ├── apple-touch-icon-180x180.png
│ ├── apple-touch-icon-60x60.png
│ └── apple-touch-icon-76x76.png
└── _pkgdown.yml
├── .travis.yml
├── CRAN-RELEASE
├── demo
├── 00Index
├── appGallery.R
├── multiPage.R
├── pagePiling.R
└── fullPage.R
├── NEWS.md
├── .Rbuildignore
├── R
├── zzz.R
├── fullTheme.R
├── fullContainer.R
├── multiSides.R
├── fullGrid.R
├── utils.R
├── fullPlot.R
├── pagePiling.R
├── fullButton.R
└── multiPage.R
├── cran-comments.md
├── fullPage.Rproj
├── DESCRIPTION
├── man
├── theme.Rd
├── sides.Rd
├── container.Rd
├── mp.Rd
├── fullGrid.Rd
├── fp.Rd
├── fullPlot.Rd
├── button.Rd
├── pagePiling.Rd
└── multiPage.Rd
├── inst
├── css
│ ├── styles.css
│ ├── jquery.multiscroll.min.css
│ ├── jquery.pagepiling.min.css
│ └── jquery.fullpage.min.css
├── jquery-3.2.1
│ └── jquery.easing.min.js
└── js
│ ├── jquery.pagepiling.min.js
│ └── jquery.multiscroll.min.js
├── NAMESPACE
├── index.Rmd
└── README.md
/vignettes/.gitignore:
--------------------------------------------------------------------------------
1 | *.html
2 | *.R
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | YEAR: 2017
2 | COPYRIGHT HOLDER: John Coene
3 |
--------------------------------------------------------------------------------
/fullPage.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/fullPage.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | inst/doc
2 | .Rproj.user
3 | .Rhistory
4 | .RData
5 | .vscode
6 | test.R
7 |
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/favicon.ico
--------------------------------------------------------------------------------
/revdep/checks.rds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/revdep/checks.rds
--------------------------------------------------------------------------------
/docs/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon.png
--------------------------------------------------------------------------------
/pkgdown/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/favicon.ico
--------------------------------------------------------------------------------
/docs/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/docs/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/docs/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/docs/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/docs/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/pkgdown/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/pkgdown/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
2 |
3 | language: R
4 | sudo: false
5 | cache: packages
6 |
--------------------------------------------------------------------------------
/CRAN-RELEASE:
--------------------------------------------------------------------------------
1 | This package was submitted to CRAN on 2020-03-14.
2 | Once it is accepted, delete this file and tag the release (commit 30fe8b0be9).
3 |
--------------------------------------------------------------------------------
/demo/00Index:
--------------------------------------------------------------------------------
1 | appGallery embed multiple Shiny Apps with fullPage
2 | fullPage FullPage.js for Shiny.
3 | pagePiling pagePiling.js for Shiny.
4 | multiPage multiScroll.js for Shiny.
5 |
--------------------------------------------------------------------------------
/NEWS.md:
--------------------------------------------------------------------------------
1 | # fullPage 0.1.1
2 |
3 | - Fix callbacks [#11](https://github.com/RinteRface/fullPage/issues/11)
4 | - Bump roxygen2
5 |
6 | # fullPage 0.0.1
7 |
8 | * Initial version
9 |
10 |
--------------------------------------------------------------------------------
/.Rbuildignore:
--------------------------------------------------------------------------------
1 | ^CRAN-RELEASE$
2 | ^.*\.Rproj$
3 | ^\.Rproj\.user$
4 | ^\.travis\.yml$
5 | ^CONDUCT\.md$
6 | ^cran-comments\.md$
7 | ^revdep$
8 | ^fullPage\.gif$
9 | pkgdown
10 | docs
11 | index.Rmd
12 | ^\.vscode$
13 | test.R
14 |
--------------------------------------------------------------------------------
/docs/pkgdown.yml:
--------------------------------------------------------------------------------
1 | pandoc: 1.19.2.4
2 | pkgdown: 1.3.0
3 | pkgdown_sha: 42971af1df065ab4e804ce3ee741192468c8bbd4
4 | articles:
5 | callbacks: callbacks.html
6 | fullPage: fullPage.html
7 | multiScroll: multiScroll.html
8 | pagePiling: pagePiling.html
9 |
10 |
--------------------------------------------------------------------------------
/R/zzz.R:
--------------------------------------------------------------------------------
1 | .onLoad <- function(libname, pkgname) {
2 | shiny::addResourcePath(
3 | "fp-css",
4 | system.file("css", package = "fullPage")
5 | )
6 | shiny::addResourcePath(
7 | "fp-jquery",
8 | system.file("jquery-3.2.1", package = "fullPage")
9 | )
10 | shiny::addResourcePath(
11 | "fp-js",
12 | system.file("js", package = "fullPage")
13 | )
14 | }
--------------------------------------------------------------------------------
/cran-comments.md:
--------------------------------------------------------------------------------
1 | ## Test environments
2 | * local OS X install, R 3.4.2
3 | * ubuntu 12.04 (on travis-ci), R 3.4.2
4 | * win-builder (devel and release)
5 |
6 | ## R CMD check results
7 |
8 | 0 errors | 0 warnings | 1 note
9 |
10 | * This is a new release.
11 |
12 | ## Reverse dependencies
13 |
14 | This is a new release, so there are no reverse dependencies.
15 |
16 | ---
17 |
--------------------------------------------------------------------------------
/fullPage.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: No
4 | SaveWorkspace: No
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
15 | AutoAppendNewline: Yes
16 | StripTrailingWhitespace: Yes
17 |
18 | BuildType: Package
19 | PackageUseDevtools: Yes
20 | PackageInstallArgs: --no-multiarch --with-keep.source
21 | PackageRoxygenize: rd,collate,namespace
22 |
--------------------------------------------------------------------------------
/docs/link.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
--------------------------------------------------------------------------------
/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: fullPage
2 | Title: Three Families of Functions for Three Different Single Page 'Shiny' Apps
3 | Version: 0.1.1
4 | Authors@R: c(
5 | person("John", "Coene", email = "jcoenep@gmail.com", role = c("aut", "cre")),
6 | person(family = "RinteRface", role = "cph"),
7 | person(family = "jQuery Foundation", role = "cph"),
8 | person("CJ", family = "Patoilo", role = "cph"),
9 | person("Alvaro", "Trigo", role = "cph"))
10 | Description: Includes functions to build three full scrolling single page applications with 'Shiny'.
11 | License: MIT + file LICENSE
12 | Date: 2020-03-14
13 | Encoding: UTF-8
14 | LazyData: true
15 | Imports: shiny, jsonlite
16 | RoxygenNote: 7.1.1
17 | URL: https://github.com/RinteRface/fullPage
18 | BugReports: https://github.com/RinteRface/fullPage/issues
19 | Suggests:
20 | testthat,
21 | knitr,
22 | rmarkdown,
23 | htmltools
24 | VignetteBuilder: knitr
25 |
--------------------------------------------------------------------------------
/man/theme.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/fullTheme.R
3 | \name{fullTheme}
4 | \alias{fullTheme}
5 | \alias{multiTheme}
6 | \alias{pageTheme}
7 | \title{Set theme}
8 | \usage{
9 | fullTheme(theme)
10 |
11 | multiTheme(theme)
12 |
13 | pageTheme(theme)
14 | }
15 | \arguments{
16 | \item{theme}{theme, see details.}
17 | }
18 | \description{
19 | Set a theme.
20 | }
21 | \details{
22 | Valid \code{theme}:
23 | \itemize{
24 | \item{\code{aqua}}
25 | \item{\code{black}}
26 | \item{\code{blue}}
27 | \item{\code{dark2}}
28 | \item{\code{fuchsia}}
29 | \item{\code{gray}}
30 | \item{\code{green}}
31 | \item{\code{lime}}
32 | \item{\code{maroon}}
33 | \item{\code{navy}}
34 | \item{\code{olive}}
35 | \item{\code{orange}}
36 | \item{\code{purple}}
37 | \item{\code{red}}
38 | \item{\code{silver}}
39 | \item{\code{teal}}
40 | \item{\code{yellow}}
41 | }
42 | }
43 | \author{
44 | John Coene, \email{jcoenep@gmail.com}
45 | }
46 |
--------------------------------------------------------------------------------
/R/fullTheme.R:
--------------------------------------------------------------------------------
1 | #' Set theme
2 | #'
3 | #' Set a theme.
4 | #'
5 | #' @param theme theme, see details.
6 | #'
7 | #' @details
8 | #' Valid \code{theme}:
9 | #' \itemize{
10 | #' \item{\code{aqua}}
11 | #' \item{\code{black}}
12 | #' \item{\code{blue}}
13 | #' \item{\code{dark2}}
14 | #' \item{\code{fuchsia}}
15 | #' \item{\code{gray}}
16 | #' \item{\code{green}}
17 | #' \item{\code{lime}}
18 | #' \item{\code{maroon}}
19 | #' \item{\code{navy}}
20 | #' \item{\code{olive}}
21 | #' \item{\code{orange}}
22 | #' \item{\code{purple}}
23 | #' \item{\code{red}}
24 | #' \item{\code{silver}}
25 | #' \item{\code{teal}}
26 | #' \item{\code{yellow}}
27 | #' }
28 | #'
29 | #' @author John Coene, \email{jcoenep@@gmail.com}
30 | #'
31 | #' @rdname theme
32 | #' @export
33 | fullTheme <- function(theme){
34 | .Deprecated("shinytheme", "shinythemes")
35 | }
36 |
37 | #' @rdname theme
38 | #' @export
39 | multiTheme <- fullTheme
40 |
41 | #' @rdname theme
42 | #' @export
43 | pageTheme <- fullTheme
44 |
--------------------------------------------------------------------------------
/inst/css/styles.css:
--------------------------------------------------------------------------------
1 | #tocMenu li {
2 | display:inline-block;
3 | margin: 10px;
4 | color: #000;
5 | background:#fff;
6 | background: rgba(255,255,255, 0.5);
7 | -webkit-border-radius: 4px;
8 | border-radius: 4px;
9 | }
10 | #tocMenu li.active{
11 | background:#666;
12 | background: rgba(0,0,0, 0.5);
13 | color: #fff;
14 | }
15 | #tocMenu li a{
16 | text-decoration:none;
17 | color: #000;
18 | }
19 | #tocMenu li.active a:hover{
20 | color: #000;
21 | }
22 | #tocMenu li:hover{
23 | background: rgba(255,255,255, 0.8);
24 | }
25 | #tocMenu li a,
26 | #tocMenu li.active a{
27 | padding: 9px 18px;
28 | display:block;
29 | }
30 | #tocMenu li.active a{
31 | color: #fff;
32 | }
33 | #tocMenu{
34 | text-align: left;
35 | position:fixed;
36 | top:0;
37 | left:0;
38 | height: 40px;
39 | z-index: 70;
40 | width: 100%;
41 | padding: 0;
42 | margin:0;
43 | }
44 | .in{
45 | position: absolute;
46 | top: 200px;
47 | left: 0;
48 | width: 100%;
49 | }
50 | .wrapper{
51 | position: relative;
52 | width: 100%; /* for IE 6 */
53 | }
54 |
--------------------------------------------------------------------------------
/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: do not edit by hand
2 |
3 | export(fullButton)
4 | export(fullButtonCustom)
5 | export(fullButtonDown)
6 | export(fullButtonLeft)
7 | export(fullButtonRight)
8 | export(fullButtonTo)
9 | export(fullButtonUp)
10 | export(fullColumn)
11 | export(fullContainer)
12 | export(fullPage)
13 | export(fullRow)
14 | export(fullSection)
15 | export(fullSectionImage)
16 | export(fullSectionPlot)
17 | export(fullSlide)
18 | export(fullSlideImage)
19 | export(fullSlidePlot)
20 | export(fullTheme)
21 | export(multiButton)
22 | export(multiButtonDown)
23 | export(multiButtonTo)
24 | export(multiButtonUp)
25 | export(multiColumn)
26 | export(multiContainer)
27 | export(multiLeft)
28 | export(multiPage)
29 | export(multiRight)
30 | export(multiRow)
31 | export(multiSection)
32 | export(multiSectionImage)
33 | export(multiSectionPlot)
34 | export(multiTheme)
35 | export(pageButton)
36 | export(pageButtonDown)
37 | export(pageButtonTo)
38 | export(pageButtonUp)
39 | export(pageColumn)
40 | export(pageContainer)
41 | export(pagePiling)
42 | export(pageRow)
43 | export(pageSection)
44 | export(pageSectionImage)
45 | export(pageSectionPlot)
46 | export(pageTheme)
47 |
--------------------------------------------------------------------------------
/pkgdown/_pkgdown.yml:
--------------------------------------------------------------------------------
1 | template:
2 | params:
3 | bootswatch: united
4 |
5 | navbar:
6 | title: "fullPage"
7 | left:
8 | - icon: fa-home
9 | href: index.html
10 | - icon: fa-balance-scale
11 | href: LICENSE.html
12 | - icon: fa-newspaper-o
13 | href: news/index.html
14 | - icon: fa-code
15 | href: "reference/"
16 | - text: "fullPage"
17 | href: "articles/fullPage.html"
18 | - text: "pagePiling"
19 | href: "articles/pagePiling.html"
20 | - text: "multiScroll"
21 | href: "articles/multiScroll.html"
22 | right:
23 | - text: Callbacks
24 | href: "articles/callbacks.html"
25 | - icon: fa-github fa-lg
26 | href: https://github.com/RinteRface/fullPage
27 |
28 | reference:
29 | - title: "Fullpage"
30 | desc: "Create a fullpage shiny app."
31 | contents:
32 | - starts_with("full")
33 | - title: "Multiscroll"
34 | desc: "Create a multiscroll shiny app."
35 | contents:
36 | - starts_with("multi")
37 | - title: "Pagepiling"
38 | desc: "Create a pagepile shiny app."
39 | contents:
40 | - starts_with("page")
41 |
42 | authors:
43 | John Coene:
44 | href: http://john-coene.com
45 | RinteRFace:
46 | href: http://rinterface.com
47 |
--------------------------------------------------------------------------------
/man/sides.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/multiSides.R
3 | \name{multiLeft}
4 | \alias{multiLeft}
5 | \alias{multiRight}
6 | \title{Create multi sections}
7 | \usage{
8 | multiLeft(..., align = NULL)
9 |
10 | multiRight(..., align = NULL)
11 | }
12 | \arguments{
13 | \item{...}{any element.}
14 |
15 | \item{align}{text alignment passed to \code{CSS}, takes \code{left}, \code{right} or \code{center}.}
16 | }
17 | \description{
18 | Create multi page sides; left and right.
19 | }
20 | \details{
21 | Only use one of each in \code{\link{multiPage}}.
22 | }
23 | \examples{
24 | if(interactive()){
25 | library(shiny)
26 |
27 | ui <- multiPage(
28 | multiLeft(
29 | multiSection(
30 | align = "right",
31 | h1("Left")
32 | ),
33 | multiSection(
34 | align = "center",
35 | h1("Left Again")
36 | )
37 | ),
38 | multiRight(
39 | multiSection(
40 | align = "left",
41 | h1("Right")
42 | ),
43 | multiSection(
44 | align = "center",
45 | h1("Right again")
46 | )
47 | )
48 | )
49 |
50 | server <- function(input, output){}
51 |
52 | shinyApp(ui, server)
53 | }
54 | }
55 | \author{
56 | John Coene, \email{jcoenep@gmail.com}
57 | }
58 |
--------------------------------------------------------------------------------
/vignettes/callbacks.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Callbacks"
3 | author: "John Coene"
4 | date: "`r Sys.Date()`"
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{Callbacks}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 | ```{r setup, include = FALSE}
13 | knitr::opts_chunk$set(
14 | collapse = TRUE,
15 | comment = "#>"
16 | )
17 | ```
18 |
19 | Callbacks let you pick up on events, i.e.: which slide is currently being viewed. For instance, it comes in handy to display animations at the right moment! Below are the callbacks available to each family of functions:
20 |
21 | **fullPage**
22 |
23 | - `input$fp_origin`: origin slide
24 | - `input$fp_destination`: destination slide
25 | - `input$fp_direction`: scroll direction
26 |
27 | **pagePiling & multiScroll**
28 |
29 | - `input$fp_anchor`: slide anchor
30 | - `input$fp_index`: slide index
31 |
32 | Demo:
33 |
34 | ```r
35 | library(shiny)
36 | library(fullPage)
37 |
38 | ui <- fullPage(
39 | fullSection(
40 | menu = "first",
41 | center = TRUE,
42 | h1("Callbacks")
43 | ),
44 | fullSection(
45 | menu = "second",
46 | center = TRUE,
47 | h3("Slide"),
48 | verbatimTextOutput("slide")
49 | )
50 | )
51 |
52 | server <- function(input, output){
53 |
54 | output$slide <- renderPrint({
55 | input$fp_origin # returns menu
56 | })
57 |
58 | }
59 |
60 | shinyApp(ui, server)
61 | ```
62 |
--------------------------------------------------------------------------------
/man/container.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/fullContainer.R
3 | \name{fullContainer}
4 | \alias{fullContainer}
5 | \alias{pageContainer}
6 | \alias{multiContainer}
7 | \title{Add containers}
8 | \usage{
9 | fullContainer(..., class = "")
10 |
11 | pageContainer(..., class = "")
12 |
13 | multiContainer(..., class = "")
14 | }
15 | \arguments{
16 | \item{...}{any element.}
17 |
18 | \item{class}{Class of element.}
19 | }
20 | \description{
21 | Add a container.
22 | }
23 | \details{
24 | Pass within your grid, sections or slides.
25 | }
26 | \examples{
27 | if(interactive()){
28 | library(shiny)
29 |
30 | ui <- fullPage(
31 | center = TRUE,
32 | fullSection(
33 | h1("Containers")
34 | ),
35 | fullSection(
36 | h1("Without container"),
37 | plotOutput("plot1")
38 | ),
39 | fullSection(
40 | fullContainer(
41 | h1("With container"),
42 | plotOutput("plot2"),
43 | pre(
44 | code(
45 | "fullContainer()"
46 | )
47 | )
48 | )
49 | )
50 | )
51 |
52 | server <- function(input, output){
53 | output$plot1 <- renderPlot({
54 | plot(mtcars$wt, mtcars$mpg)
55 | })
56 |
57 | output$plot2 <- renderPlot({
58 | plot(mtcars$wt, mtcars$mpg)
59 | })
60 | }
61 |
62 | shinyApp(ui, server)
63 | }
64 |
65 | }
66 | \author{
67 | John Coene, \email{jcoenep@gmail.com}
68 | }
69 |
--------------------------------------------------------------------------------
/demo/appGallery.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 | library(fullPage)
3 | library(rvest)
4 | library(htmltools)
5 | library(purrr)
6 | library(httr)
7 | library(parallel)
8 |
9 | base_url <- "https://shiny.rstudio.com/"
10 |
11 | shinyapps_url <- "https://gallery.shinyapps.io/"
12 |
13 | # get all apps
14 | apps <- read_html(paste0(base_url, "gallery/")) %>%
15 | html_nodes(css = ".gallery-app-item") %>%
16 | html_children() %>%
17 | html_nodes(css = "a") %>%
18 | html_attr("href")
19 |
20 | # only recover the app name
21 | appNames <- map(apps, gsub, pattern = "/gallery/", replacement = "")
22 | appNames <- map(appNames, gsub, pattern = ".html", replacement = "")
23 |
24 | # build urls
25 | urls <- lapply(seq_along(apps), FUN = function(i) {
26 | paste0(shinyapps_url, appNames[[i]])
27 | })
28 |
29 | # test for 404 error or other tp select only good urls (do it in parallel)
30 | # since httr::GET is very slow
31 | test_url <- mclapply(urls, GET, mc.cores = detectCores())
32 | good_url_index <- unlist(
33 | lapply(seq_along(test_url), FUN = function(i) {
34 | if (test_url[[i]]$status_code == 200) i else NULL
35 | })
36 | )
37 | good_urls <- urls[good_url_index]
38 |
39 |
40 | # unleash the daemon
41 | ui <- fullPage(
42 | lapply(
43 | X = seq_along(good_urls),
44 | FUN = function(i) {
45 | fullSection(
46 | menu = i,
47 | tags$iframe(src = good_urls[[i]], width = "100%", height = "100%")
48 | )
49 | }
50 | )
51 | )
52 |
53 | server <- function(input, output){}
54 |
55 | shinyApp(ui, server)
56 |
--------------------------------------------------------------------------------
/R/fullContainer.R:
--------------------------------------------------------------------------------
1 | #' Add containers
2 | #'
3 | #' Add a container.
4 | #'
5 | #' @param ... any element.
6 | #' @param class Class of element.
7 | #'
8 | #' @details Pass within your grid, sections or slides.
9 | #'
10 | #' @examples
11 | #' if(interactive()){
12 | #' library(shiny)
13 | #'
14 | #' ui <- fullPage(
15 | #' center = TRUE,
16 | #' fullSection(
17 | #' h1("Containers")
18 | #' ),
19 | #' fullSection(
20 | #' h1("Without container"),
21 | #' plotOutput("plot1")
22 | #' ),
23 | #' fullSection(
24 | #' fullContainer(
25 | #' h1("With container"),
26 | #' plotOutput("plot2"),
27 | #' pre(
28 | #' code(
29 | #' "fullContainer()"
30 | #' )
31 | #' )
32 | #' )
33 | #' )
34 | #' )
35 | #'
36 | #' server <- function(input, output){
37 | #' output$plot1 <- renderPlot({
38 | #' plot(mtcars$wt, mtcars$mpg)
39 | #' })
40 | #'
41 | #' output$plot2 <- renderPlot({
42 | #' plot(mtcars$wt, mtcars$mpg)
43 | #' })
44 | #' }
45 | #'
46 | #' shinyApp(ui, server)
47 | #' }
48 | #'
49 | #' @author John Coene, \email{jcoenep@@gmail.com}
50 | #'
51 | #' @rdname container
52 | #' @export
53 | fullContainer <- function(..., class = ""){
54 | cl <- paste("container", class)
55 | shiny::tags$div(
56 | class = cl,
57 | ...
58 | )
59 | }
60 |
61 | #' @rdname container
62 | #' @export
63 | pageContainer <- fullContainer
64 |
65 | #' @rdname container
66 | #' @export
67 | multiContainer <- fullContainer
68 |
--------------------------------------------------------------------------------
/inst/css/jquery.multiscroll.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * multiscroll.js 0.1.8 Beta
3 | * https://github.com/alvarotrigo/multiscroll.js
4 | * @license MIT licensed
5 | *
6 | * Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo
7 | */body,html{margin:0;padding:0;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ms-section{position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ms-section.ms-table{display:table;width:100%}.ms-tableCell{display:table-cell;vertical-align:middle;width:100%;height:100%}.ms-easing{-webkit-transition:all .7s ease-out;-moz-transition:all .7s ease-out;-o-transition:all .7s ease-out;transition:all .7s ease-out}#multiscroll-nav{position:fixed;z-index:100;margin-top:-32px;top:50%;opacity:1}#multiscroll-nav.right{right:17px}#multiscroll-nav.left{left:17px}#multiscroll-nav ul{margin:0;padding:0}#multiscroll-nav li{display:block;width:14px;height:13px;margin:7px;position:relative}#multiscroll-nav li a{display:block;position:relative;z-index:1;width:100%;height:100%;cursor:pointer;text-decoration:none}#multiscroll-nav li .active span{background:#333}#multiscroll-nav span{top:2px;left:2px;width:8px;height:8px;border:1px solid #000;background:rgba(0,0,0,0);-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;position:absolute;z-index:1}.multiscroll-tooltip{position:absolute;color:#fff;font-size:14px;font-family:arial,helvetica,sans-serif;top:-2px;white-space:nowrap;max-width:220px}.multiscroll-tooltip.right{right:20px}.multiscroll-tooltip.left{left:20px}.ms-responsive .ms-hide{display:none}
8 | /*# sourceMappingURL=jquery.multiscroll.min.css.map */
9 |
--------------------------------------------------------------------------------
/man/mp.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/multiPage.R
3 | \name{multiSection}
4 | \alias{multiSection}
5 | \alias{multiSectionImage}
6 | \title{Create multi sections}
7 | \usage{
8 | multiSection(..., menu = NULL, align = "none")
9 |
10 | multiSectionImage(..., img, side, menu = NULL, align = "none")
11 | }
12 | \arguments{
13 | \item{...}{any element.}
14 |
15 | \item{menu}{named vector of menu links.}
16 |
17 | \item{align}{text alignment, takes \code{left}, \code{right} or, \code{center}, defaults to \code{none}.}
18 |
19 | \item{img}{path to image.}
20 |
21 | \item{side}{image side.}
22 | }
23 | \description{
24 | Create multi sections.
25 | }
26 | \examples{
27 | if(interactive()){
28 | library(shiny)
29 |
30 | options <- list(
31 | sectionsColor = c("#f3f3f3", "#d3d3d3", "#000")
32 | )
33 |
34 | ui <- multiPage(
35 | opts = options,
36 | multiLeft(
37 | align = "right",
38 | multiSection(
39 | h1("multi")
40 | ),
41 | multiSection(
42 | h2("Section ")
43 | ),
44 | multiSection(
45 | h2("Image ")
46 | )
47 | ),
48 | multiRight(
49 | align = "left",
50 | multiSection(
51 | h1("page()")
52 | ),
53 | multiSection(
54 | h2(" 2")
55 | ),
56 | multiSectionImage(
57 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg",
58 | side = "right",
59 | h2("Background")
60 | )
61 | )
62 | )
63 |
64 | server <- function(input, output){}
65 |
66 | shinyApp(ui, server)
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/man/fullGrid.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/fullGrid.R
3 | \name{fullRow}
4 | \alias{fullRow}
5 | \alias{fullColumn}
6 | \alias{pageRow}
7 | \alias{pageColumn}
8 | \alias{multiRow}
9 | \alias{multiColumn}
10 | \title{Add grid elements}
11 | \usage{
12 | fullRow(...)
13 |
14 | fullColumn(..., width = 6)
15 |
16 | pageRow(...)
17 |
18 | pageColumn(..., width = 6)
19 |
20 | multiRow(...)
21 |
22 | multiColumn(..., width = 6)
23 | }
24 | \arguments{
25 | \item{...}{any element.}
26 |
27 | \item{width}{Width of column.}
28 | }
29 | \description{
30 | Add rows and columns.
31 | }
32 | \details{
33 | Wrap columns in row function, see examples.
34 | }
35 | \examples{
36 | if(interactive()){
37 | library(shiny)
38 |
39 | ui <- pagePiling(
40 | center = TRUE,
41 | sections.color = c("#f3f3f3", "#f4f4f4"),
42 | pageSection(
43 | h1("Grid")
44 | ),
45 | pageSection(
46 | h1("Columns"),
47 | pageRow(
48 | pageColumn(
49 | h2("First Column"),
50 | p("Resize your screen to see columns in action.")
51 | ),
52 | pageColumn(
53 | h2("Second Column"),
54 | numericInput("obs", "observations", value = 20)
55 | ),
56 | pageColumn(
57 | h2("Thirs Column"),
58 | plotOutput("plot")
59 | )
60 | )
61 | )
62 | )
63 |
64 | server <- function(input, output){
65 | output$plot <- renderPlot({
66 | par(bg = "#f4f4f4")
67 | hist(rnorm(input$obs, 10, 3))
68 | })
69 | }
70 |
71 | shinyApp(ui, server)
72 | }
73 |
74 | }
75 | \author{
76 | John Coene, \email{jcoenep@gmail.com}
77 | }
78 |
--------------------------------------------------------------------------------
/R/multiSides.R:
--------------------------------------------------------------------------------
1 | #' Create multi sections
2 | #'
3 | #' Create multi page sides; left and right.
4 | #'
5 | #' @param align text alignment passed to \code{CSS}, takes \code{left}, \code{right} or \code{center}.
6 | #' @param ... any element.
7 | #'
8 | #' @details Only use one of each in \code{\link{multiPage}}.
9 | #'
10 | #' @examples
11 | #' if(interactive()){
12 | #' library(shiny)
13 | #'
14 | #' ui <- multiPage(
15 | #' multiLeft(
16 | #' multiSection(
17 | #' align = "right",
18 | #' h1("Left")
19 | #' ),
20 | #' multiSection(
21 | #' align = "center",
22 | #' h1("Left Again")
23 | #' )
24 | #' ),
25 | #' multiRight(
26 | #' multiSection(
27 | #' align = "left",
28 | #' h1("Right")
29 | #' ),
30 | #' multiSection(
31 | #' align = "center",
32 | #' h1("Right again")
33 | #' )
34 | #' )
35 | #' )
36 | #'
37 | #' server <- function(input, output){}
38 | #'
39 | #' shinyApp(ui, server)
40 | #' }
41 | #' @author John Coene, \email{jcoenep@@gmail.com}
42 | #'
43 | #' @rdname sides
44 | #' @export
45 | multiLeft <- function(..., align = NULL){
46 | div <- shiny::tags$div(
47 | class = "ms-left",
48 | ...
49 | )
50 |
51 | if(!is.null(align))
52 | div <- shiny::tagAppendAttributes(div, style = paste0("text-align: ", align, ";"))
53 |
54 | div
55 | }
56 |
57 | #' @rdname sides
58 | #' @export
59 | multiRight <- function(..., align = NULL){
60 | div <- shiny::tags$div(
61 | class = "ms-right",
62 | ...
63 | )
64 |
65 | if(!is.null(align))
66 | div <- shiny::tagAppendAttributes(div, style = paste0("text-align: ", align, ";"))
67 |
68 | div
69 | }
70 |
--------------------------------------------------------------------------------
/index.Rmd:
--------------------------------------------------------------------------------
1 | # fullPage
2 | [](https://travis-ci.org/RinteRface/fullPage) [](https://cran.r-project.org/package=fullPage)
3 |
4 | > Many of the amazing works of [Álvaro Trigo](https://alvarotrigo.com/) for Shiny!
5 |
6 | ```{r setup, include=FALSE}
7 | library(htmltools)
8 | ```
9 |
10 | ```{r, echo=FALSE}
11 | p(
12 | tags$a(
13 | href = "https://shiny.john-coene.com/fullPage",
14 | target = "_blank",
15 | class = "btn btn-default",
16 | "fullPage demo"
17 | ),
18 | tags$a(
19 | href = "https://shiny.john-coene.com/pagePiling",
20 | target = "_blank",
21 | class = "btn btn-warning",
22 | "pagePiling demo"
23 | ),
24 | tags$a(
25 | href = "https://shiny.john-coene.com/multiScroll",
26 | target = "_blank",
27 | class = "btn btn-success",
28 | "multiScroll demo"
29 | )
30 | )
31 | ```
32 |
33 | ## Installation
34 |
35 | Install the _stable_ version from CRAN:
36 |
37 | ```r
38 | install.packages("fullPage")
39 | ```
40 |
41 | Install the _dev_ version from [Github](https://github.com/RinteRface/fullPage) with:
42 |
43 | ``` r
44 | # install.packages("remotes")
45 | remotes::install_github("RinteRface/fullPage")
46 | ```
47 |
48 | ## Features
49 |
50 | * [fullPage.js](https://github.com/alvarotrigo/fullPage.js/) -- functions starting with `full`.
51 | * [pagePiling.js](https://github.com/alvarotrigo/pagePiling.js/) -- functions starting with `page`.
52 | * [multiScroll.js](https://github.com/alvarotrigo/multiscroll.js) -- functions starting with `multi`.
53 |
54 | All ships with:
55 |
56 | * [Milligram](https://milligram.io/) *grid, button, typography, and themes.*
57 |
58 |
--------------------------------------------------------------------------------
/R/fullGrid.R:
--------------------------------------------------------------------------------
1 | #' Add grid elements
2 | #'
3 | #' Add rows and columns.
4 | #'
5 | #' @param ... any element.
6 | #' @param width Width of column.
7 | #'
8 | #' @details Wrap columns in row function, see examples.
9 | #'
10 | #' @examples
11 | #' if(interactive()){
12 | #' library(shiny)
13 | #'
14 | #' ui <- pagePiling(
15 | #' center = TRUE,
16 | #' sections.color = c("#f3f3f3", "#f4f4f4"),
17 | #' pageSection(
18 | #' h1("Grid")
19 | #' ),
20 | #' pageSection(
21 | #' h1("Columns"),
22 | #' pageRow(
23 | #' pageColumn(
24 | #' h2("First Column"),
25 | #' p("Resize your screen to see columns in action.")
26 | #' ),
27 | #' pageColumn(
28 | #' h2("Second Column"),
29 | #' numericInput("obs", "observations", value = 20)
30 | #' ),
31 | #' pageColumn(
32 | #' h2("Thirs Column"),
33 | #' plotOutput("plot")
34 | #' )
35 | #' )
36 | #' )
37 | #' )
38 | #'
39 | #' server <- function(input, output){
40 | #' output$plot <- renderPlot({
41 | #' par(bg = "#f4f4f4")
42 | #' hist(rnorm(input$obs, 10, 3))
43 | #' })
44 | #' }
45 | #'
46 | #' shinyApp(ui, server)
47 | #' }
48 | #'
49 | #' @author John Coene, \email{jcoenep@@gmail.com}
50 | #'
51 | #' @rdname fullGrid
52 | #' @export
53 | fullRow <- function(...){
54 | shiny::tags$div(
55 | class = "row",
56 | ...
57 | )
58 | }
59 |
60 | #' @rdname fullGrid
61 | #' @export
62 | fullColumn <- function(..., width = 6){
63 | shiny::tags$div(
64 | class = paste0("col-md-", width),
65 | ...
66 | )
67 | }
68 |
69 | #' @rdname fullGrid
70 | #' @export
71 | pageRow <- fullRow
72 |
73 | #' @rdname fullGrid
74 | #' @export
75 | pageColumn <- fullColumn
76 |
77 | #' @rdname fullGrid
78 | #' @export
79 | multiRow <- fullRow
80 |
81 | #' @rdname fullGrid
82 | #' @export
83 | multiColumn <- fullColumn
84 |
--------------------------------------------------------------------------------
/inst/css/jquery.pagepiling.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * pagepiling.js 1.5.4
3 | *
4 | * https://github.com/alvarotrigo/pagePiling.js
5 | * @license MIT licensed
6 | *
7 | * Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo
8 | */body,html{overflow:hidden;margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.pp-section{height:100%;position:absolute;width:100%}.pp-easing{-webkit-transition:all 1s cubic-bezier(.55,.085,0,.99);-moz-transition:all 1s cubic-bezier(.55,.085,0,.99);-o-transition:all 1s cubic-bezier(.55,.085,0,.99);transition:all 1s cubic-bezier(.55,.085,0,.99);-webkit-transition-timing-function:cubic-bezier(.55,.085,0,.99);-moz-transition-timing-function:cubic-bezier(.55,.085,0,.99);-o-transition-timing-function:cubic-bezier(.55,.085,0,.99);transition-timing-function:cubic-bezier(.55,.085,0,.99)}#pp-nav{position:fixed;z-index:100;margin-top:-32px;top:50%;opacity:1}#pp-nav.right{right:17px}#pp-nav.left{left:17px}.pp-section.pp-table{display:table}.pp-tableCell{display:table-cell;vertical-align:middle;width:100%;height:100%}.pp-slidesNav{position:absolute;z-index:4;left:50%;opacity:1}.pp-slidesNav.bottom{bottom:17px}.pp-slidesNav.top{top:17px}#pp-nav ul,.pp-slidesNav ul{margin:0;padding:0}#pp-nav li,.pp-slidesNav li{display:block;width:14px;height:13px;margin:7px;position:relative}.pp-slidesNav li{display:inline-block}#pp-nav li a,.pp-slidesNav li a{display:block;position:relative;z-index:1;width:100%;height:100%;cursor:pointer;text-decoration:none}#pp-nav li .active span,.pp-slidesNav .active span{background:#333}#pp-nav span,.pp-slidesNav span{top:2px;left:2px;width:8px;height:8px;border:1px solid #000;background:rgba(0,0,0,0);border-radius:50%;position:absolute;z-index:1}.pp-tooltip{position:absolute;top:-2px;color:#fff;font-size:14px;font-family:arial,helvetica,sans-serif;white-space:nowrap;max-width:220px}.pp-tooltip.right{right:20px}.pp-tooltip.left{left:20px}.pp-scrollable{overflow-y:scroll;height:100%}
9 | /*# sourceMappingURL=jquery.pagepiling.min.css.map */
10 |
--------------------------------------------------------------------------------
/vignettes/pagePiling.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "pagePiling"
3 | author: "John Coene"
4 | date: "`r Sys.Date()`"
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{pagePiling}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 | ```{r setup, include = FALSE}
13 | knitr::opts_chunk$set(
14 | collapse = TRUE,
15 | comment = "#>"
16 | )
17 | ```
18 |
19 | You can run a local demo of fullPage with `demo("pagePiling", package = "fullPage")`.
20 |
21 | `fullPage` consists of section (`pageSection`), all the functions of relevant to pagePiling start in `page_`.Always initialise the page with `pagePiling`.
22 |
23 | The code looks like:
24 |
25 | ```r
26 | library(shiny)
27 | library(fullPage)
28 |
29 | options <- list(
30 | loopBottom = TRUE
31 | )
32 |
33 | ui <- pagePiling(
34 | sections.color = c('#f2f2f2', '#2C3E50', '#39C'),
35 | opts = options,
36 | menu = c("Section 1" = "section1",
37 | "Piling" = "section2",
38 | "Plots" = "section3",
39 | "Layers" = "section4"),
40 | pageSection(
41 | center = TRUE,
42 | menu = "section1",
43 | h1("Page piling")
44 | ),
45 | pageSection(
46 | menu = "section2",
47 | center = TRUE,
48 | h1("Section 2")
49 | ),
50 | pageSectionPlot(
51 | "plot",
52 | center = TRUE,
53 | menu = "section3",
54 | h1("Plot background")
55 | ),
56 | pageSectionPlot(
57 | "plot2",
58 | center = TRUE,
59 | menu = "section4",
60 | pageContainer(
61 | h1("Layer anything"),
62 | sliderInput(
63 | "bins",
64 | "Data Points",
65 | min = 100,
66 | max = 500,
67 | step = 25,
68 | value = 200
69 | )
70 | )
71 | )
72 | )
73 |
74 | server <- function(input, output){
75 |
76 | output$plot <- renderPlot({
77 | par(bg = "grey60")
78 | plot(mtcars$wt, mtcars$mpg)
79 | })
80 |
81 | output$plot2 <- renderPlot({
82 | par(bg = "grey80")
83 | hist(rnorm(input$bins, 100, 250))
84 | })
85 | }
86 |
87 | shinyApp(ui, server)
88 | ```
--------------------------------------------------------------------------------
/man/fp.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/fullPage.R
3 | \name{fullSection}
4 | \alias{fullSection}
5 | \alias{fullSlide}
6 | \alias{fullSectionImage}
7 | \alias{fullSlideImage}
8 | \alias{pageSection}
9 | \alias{pageSectionImage}
10 | \title{Sections and Slides}
11 | \usage{
12 | fullSection(..., menu = NULL, center = FALSE, class = "")
13 |
14 | fullSlide(..., menu = NULL, center = FALSE)
15 |
16 | fullSectionImage(..., img, menu = NULL, center = FALSE)
17 |
18 | fullSlideImage(..., img, menu = NULL, center = FALSE)
19 |
20 | pageSection(..., menu = NULL, center = FALSE, class = "")
21 |
22 | pageSectionImage(..., img, menu = NULL, center = FALSE)
23 | }
24 | \arguments{
25 | \item{...}{any element.}
26 |
27 | \item{menu}{menu link.}
28 |
29 | \item{center}{whether to center text horizontally.}
30 |
31 | \item{class}{A CSS class.}
32 |
33 | \item{img}{path to image.}
34 | }
35 | \description{
36 | Add sections and slides.
37 | }
38 | \details{
39 | \code{fullSectionImage} and \code{fullSlideImage} do not work in RStudio viewer, open in browser.
40 | }
41 | \examples{
42 | if(interactive()){
43 |
44 | library(shiny)
45 |
46 | ui <- fullPage(
47 | center = TRUE,
48 | opts = list(
49 | sectionsColor = c("#f3f3f3", "#4BBFC3")
50 | ),
51 | fullSection(h1("First section"), center = TRUE),
52 | fullSection(
53 | menu = "captureThisSection"
54 | ),
55 | fullSection(
56 | fullSlide(h2("Slide 1")),
57 | fullSlideImage(
58 | img = paste0(
59 | "https://raw.githubusercontent.com/alvarotrigo/",
60 | "fullPage.js/master/examples/imgs/bg5.jpg"),
61 | h2("Image background")
62 | )
63 | ),
64 | fullSectionImage( # will not show in viewer, open in browser
65 | img = paste0(
66 | "https://raw.githubusercontent.com/alvarotrigo/",
67 | "fullPage.js/master/examples/imgs/bg2.jpg"),
68 | h1("Image background")
69 | )
70 | )
71 |
72 | server <- function(input, output){
73 | observeEvent(input$captureThisSectionInput, {
74 | print("Section # 2 loaded")
75 | })
76 | }
77 |
78 | shinyApp(ui, server)
79 | }
80 |
81 | }
82 | \author{
83 | John Coene, \email{jcoenep@gmail.com}
84 | }
85 |
--------------------------------------------------------------------------------
/R/utils.R:
--------------------------------------------------------------------------------
1 | build_opts_fp <- function(opts = NULL){
2 |
3 | opts <- jsonlite::toJSON(opts, auto_unbox = T)
4 |
5 | paste0("
6 | var options = ", opts, ";
7 | $.extend(options, {'afterLoad': function(origin, destination, direction){
8 | Shiny.setInputValue('fp_origin', origin, {priority: 'event'});
9 | Shiny.setInputValue('fp_destination', destination, {priority: 'event'});
10 | Shiny.setInputValue('fp_direction', direction, {priority: 'event'});
11 | }});
12 | $(document).on('shiny:connected', function(event) {$('#fp').fullpage(options);});
13 | ")
14 | }
15 |
16 | build_opts_pp <- function(opts = NULL){
17 |
18 | opts <- jsonlite::toJSON(opts, auto_unbox = T)
19 |
20 | paste0("
21 | var options = ", opts, ";
22 | $.extend(options, {'afterLoad': function(anchorLink, index){
23 | Shiny.setInputValue('fp_anchor', anchorLink, {priority: 'event'});
24 | Shiny.setInputValue('fp_index', index, {priority: 'event'});
25 | }});
26 | $(document).on('shiny:connected', function(event) {$('#fp').pagepiling(options)});
27 | ")
28 | }
29 |
30 | build_opts_mp <- function(opts = NULL){
31 | opts <- jsonlite::toJSON(opts, auto_unbox = T)
32 |
33 | paste0("
34 | var options = ", opts, ";
35 | $.extend(options, {'afterLoad': function(anchorLink, index){
36 | $(document).on('shiny:connected', function(event) {
37 | Shiny.onInputChange('fp_anchor', anchorLink);
38 | Shiny.onInputChange('fp_index', index);
39 | });
40 | }});
41 | $(document).ready(function() {$('#fp').multiscroll(options);});
42 | ")
43 | }
44 |
45 |
46 | build_section <- function(menu = NULL, center = FALSE, class, ...){
47 | div <- shiny::tags$div(
48 | class = class,
49 | ...
50 | )
51 |
52 | if(!is.null(menu))
53 | div <- shiny::tagAppendAttributes(div, `data-anchor` = menu)
54 |
55 | if(isTRUE(center))
56 | div <- shiny::tagAppendAttributes(div, style = "text-align: center;")
57 |
58 | div
59 | }
60 |
61 | rand <- function(){
62 | rand_id <- paste0(tolower(sample(c(LETTERS, 1:9), 26 + 9)), collapse = "")
63 | paste0(sample(letters,1),rand_id)
64 | }
65 |
--------------------------------------------------------------------------------
/docs/docsearch.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 |
3 | // register a handler to move the focus to the search bar
4 | // upon pressing shift + "/" (i.e. "?")
5 | $(document).on('keydown', function(e) {
6 | if (e.shiftKey && e.keyCode == 191) {
7 | e.preventDefault();
8 | $("#search-input").focus();
9 | }
10 | });
11 |
12 | $(document).ready(function() {
13 | // do keyword highlighting
14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */
15 | var mark = function() {
16 |
17 | var referrer = document.URL ;
18 | var paramKey = "q" ;
19 |
20 | if (referrer.indexOf("?") !== -1) {
21 | var qs = referrer.substr(referrer.indexOf('?') + 1);
22 | var qs_noanchor = qs.split('#')[0];
23 | var qsa = qs_noanchor.split('&');
24 | var keyword = "";
25 |
26 | for (var i = 0; i < qsa.length; i++) {
27 | var currentParam = qsa[i].split('=');
28 |
29 | if (currentParam.length !== 2) {
30 | continue;
31 | }
32 |
33 | if (currentParam[0] == paramKey) {
34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20"));
35 | }
36 | }
37 |
38 | if (keyword !== "") {
39 | $(".contents").unmark({
40 | done: function() {
41 | $(".contents").mark(keyword);
42 | }
43 | });
44 | }
45 | }
46 | };
47 |
48 | mark();
49 | });
50 | });
51 |
52 | /* Search term highlighting ------------------------------*/
53 |
54 | function matchedWords(hit) {
55 | var words = [];
56 |
57 | var hierarchy = hit._highlightResult.hierarchy;
58 | // loop to fetch from lvl0, lvl1, etc.
59 | for (var idx in hierarchy) {
60 | words = words.concat(hierarchy[idx].matchedWords);
61 | }
62 |
63 | var content = hit._highlightResult.content;
64 | if (content) {
65 | words = words.concat(content.matchedWords);
66 | }
67 |
68 | // return unique words
69 | var words_uniq = [...new Set(words)];
70 | return words_uniq;
71 | }
72 |
73 | function updateHitURL(hit) {
74 |
75 | var words = matchedWords(hit);
76 | var url = "";
77 |
78 | if (hit.anchor) {
79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor;
80 | } else {
81 | url = hit.url + '?q=' + escape(words.join(" "));
82 | }
83 |
84 | return url;
85 | }
86 |
--------------------------------------------------------------------------------
/man/fullPlot.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/fullPlot.R
3 | \name{fullSectionPlot}
4 | \alias{fullSectionPlot}
5 | \alias{fullSlidePlot}
6 | \alias{pageSectionPlot}
7 | \alias{multiSectionPlot}
8 | \title{Use plot as background}
9 | \usage{
10 | fullSectionPlot(
11 | outputId,
12 | ...,
13 | menu = NULL,
14 | center = FALSE,
15 | background = "rgba(255,255,255,0.5)"
16 | )
17 |
18 | fullSlidePlot(
19 | outputId,
20 | ...,
21 | menu = NULL,
22 | center = FALSE,
23 | background = "rgba(255,255,255,0.5)"
24 | )
25 |
26 | pageSectionPlot(
27 | outputId,
28 | ...,
29 | menu = NULL,
30 | center = FALSE,
31 | background = "rgba(255,255,255,0.5)"
32 | )
33 |
34 | multiSectionPlot(
35 | outputId,
36 | ...,
37 | menu = NULL,
38 | center = FALSE,
39 | background = "rgba(255,255,255,0.5)"
40 | )
41 | }
42 | \arguments{
43 | \item{outputId}{id passed to \code{\link[shiny]{plotOutput}}.}
44 |
45 | \item{...}{any children element.}
46 |
47 | \item{menu}{menu link.}
48 |
49 | \item{center}{whether to center text horizontally.}
50 |
51 | \item{background}{sets background to overlaying shiny inputs, set to \code{NULL} to remove.}
52 | }
53 | \description{
54 | Use a reactive plot as section or slide background.
55 | }
56 | \examples{
57 | if(interactive()){
58 |
59 | library(shiny)
60 |
61 | ui <- fullPage(
62 | opts = list(sectionsColor = c('#4BBFC3', '#7BAABE')),
63 | fullSection(h1("Full section plots"), center = TRUE),
64 | fullSectionPlot(
65 | "myPlot2",
66 | center = TRUE,
67 | fullContainer(
68 | h2("With a title")
69 | )
70 | ),
71 | fullSectionPlot(
72 | "myPlot",
73 | center = TRUE,
74 | fullContainer(
75 | h3("Layer anything you want"),
76 | selectInput(
77 | "select",
78 | "Choose y",
79 | choices = c("mpg", "drat", "wt")
80 | )
81 | )
82 | )
83 | )
84 |
85 | server <- function(input, output){
86 |
87 | output$myPlot <- renderPlot({
88 | plot(1:nrow(mtcars), mtcars[[input$select]])
89 | })
90 |
91 | output$myPlot2 <- renderPlot({
92 | plot(1:nrow(mtcars), mtcars[[input$select]])
93 | })
94 |
95 | }
96 |
97 | shinyApp(ui, server)
98 | }
99 | }
100 | \author{
101 | John Coene, \email{jcoenep@gmail.com}
102 | }
103 |
--------------------------------------------------------------------------------
/inst/jquery-3.2.1/jquery.easing.min.js:
--------------------------------------------------------------------------------
1 | (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],function($){return factory($)})}else if(typeof module==="object"&&typeof module.exports==="object"){exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){$.easing.jswing=$.easing.swing;var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1){return n1*x*x}else if(x<2/d1){return n1*(x-=1.5/d1)*x+.75}else if(x<2.5/d1){return n1*(x-=2.25/d1)*x+.9375}else{return n1*(x-=2.625/d1)*x+.984375}}$.extend($.easing,{def:"easeOutQuad",swing:function(x){return $.easing[$.easing.def](x)},easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x<.5?2*x*x:1-pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1-cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2*x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})});
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # fullPage
2 | [](https://travis-ci.org/RinteRface/fullPage) [](https://cran.r-project.org/package=fullPage)
3 |
4 | > Many of the amazing works of [Álvaro Trigo](https://alvarotrigo.com/) for Shiny!
5 |
6 | * [Install](#installation)
7 | * [Demos](#demos)
8 | * [Features](#features)
9 | * [Website](http://fullpage.rinterface.com/)
10 | * [Examples](#demos)
11 | * [Callbacks](#callbacks)
12 |
13 | 
14 |
15 | ## Installation
16 |
17 | ``` r
18 | # install.packages("remotes")
19 | remotes::install_github("RinteRface/fullPage")
20 | ```
21 |
22 | ## Features
23 |
24 | Includes the following frameworks:
25 |
26 | * [fullPage.js](https://github.com/alvarotrigo/fullPage.js/) -- functions starting with `full`.
27 | * [pagePiling.js](https://github.com/alvarotrigo/pagePiling.js/) -- functions starting with `page`.
28 | * [multiScroll.js](https://github.com/alvarotrigo/multiscroll.js) -- functions starting with `multi`.
29 |
30 | All ships with:
31 |
32 | * [Milligram](https://milligram.io/) *grid, button, typography, and themes.*
33 |
34 | ## Demos
35 |
36 | Online:
37 |
38 | * [fullPage.js](https://shiny.john-coene.com/fullPage)
39 | * [pagePiling.js](https://shiny.john-coene.com/pagePiling)
40 | * [multiScroll.js](https://shiny.john-coene.com/multiScroll)
41 |
42 |
43 | Locally:
44 |
45 | ```r
46 | demo("fullPage", package = "fullPage")
47 | demo("pagePiling", package = "fullPage")
48 | demo("multiPage", package = "fullPage")
49 | ```
50 |
51 | ## Callbacks
52 |
53 | **fullPage**
54 |
55 | - `input$slide_origin`: origin slide
56 | - `input$slide_destination`: destination slide
57 | - `input$slide_direction`: scroll direction
58 |
59 | **pagePiling & multiScroll**
60 |
61 | - `input$slide_anchor`: slide anchor
62 | - `input$slide_index`: slide index
63 |
64 | ```r
65 | library(shiny)
66 | library(fullPage)
67 |
68 | ui <- fullPage(
69 | fullSection(
70 | menu = "first",
71 | center = TRUE,
72 | h1("Callbacks")
73 | ),
74 | fullSection(
75 | menu = "second",
76 | center = TRUE,
77 | h3("Slice"),
78 | verbatimTextOutput("slide")
79 | )
80 | )
81 |
82 | server <- function(input, output){
83 |
84 | output$slide <- renderPrint({
85 | input$slide_origin # returns menu
86 | })
87 |
88 | }
89 |
90 | shinyApp(ui, server)
91 | ```
92 |
--------------------------------------------------------------------------------
/vignettes/multiScroll.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "multiScroll"
3 | author: "John Coene"
4 | date: "`r Sys.Date()`"
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{multiScroll}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 | ```{r setup, include = FALSE}
13 | knitr::opts_chunk$set(
14 | collapse = TRUE,
15 | comment = "#>"
16 | )
17 | ```
18 |
19 | You can run a local demo of fullPage with `demo("multiScroll", package = "fullPage")`.
20 |
21 | `multiScroll` consists of section (`multiSection`), which consists of two "sides", right (`multiRight`) and left `multiLeft`, all the functions of relevant to multiScroll start in `multi_`. Always initialise the page with `multiPage`.
22 |
23 | The code looks like:
24 |
25 | ```r
26 | library(shiny)
27 | library(fullPage)
28 |
29 | options <- list(
30 | sectionsColor = c("#4BBFC3", "#7BAABE", "lightgray")
31 | )
32 |
33 | ui <- multiPage(
34 | opts = options,
35 | menu = c("Multi Scroll" = "multiscroll",
36 | "Plots" = "plots",
37 | "Full Section plots" = "fullplots"),
38 | multiLeft(
39 | multiSection(
40 | center = TRUE,
41 | menu = "multiscroll",
42 | h1("Multiple")
43 | ),
44 | multiSection(
45 | menu = "plots",
46 | multiContainer(
47 | h1("Plot ->"),
48 | numericInput(
49 | "max",
50 | "Maximum",
51 | min = 50,
52 | max = 250,
53 | value = 10
54 | )
55 | )
56 | ),
57 | multiSectionPlot(
58 | menu = "fullplots",
59 | "fullPlot"
60 | )
61 | ),
62 | multiRight(
63 | multiSection(
64 | center = TRUE,
65 | h1("scroll")
66 | ),
67 | multiSection(
68 | center = TRUE,
69 | plotOutput("plot")
70 | ),
71 | multiSection(
72 | multiContainer(
73 | center = TRUE,
74 | h1("<- Full Section plot"),
75 | sliderInput(
76 | "number",
77 | "Data points",
78 | min = 50,
79 | max = 250,
80 | value = 10
81 | )
82 | )
83 | )
84 | )
85 | )
86 |
87 | server <- function(input, output){
88 |
89 | output$plot <- renderPlot({
90 | hist(rnorm(100, 20, input$max))
91 | })
92 |
93 | output$fullPlot <- renderPlot({
94 | par(bg = "gray")
95 | hist(rnorm(input$number, 20, 250))
96 | })
97 | }
98 |
99 | shinyApp(ui, server)
100 | ```
--------------------------------------------------------------------------------
/demo/multiPage.R:
--------------------------------------------------------------------------------
1 | library(fullPage)
2 | library(shiny)
3 |
4 | options <- list(
5 | sectionsColor = c("#E0FFFA", "#CEFFF2", "#C0F9F0", "#90F9EA", "#000", "#394C54", "#E0FFFA")
6 | )
7 |
8 | ui <- multiPage(
9 | opts = options,
10 | multiTheme('aqua'),
11 | menu = c(
12 | "multiPage" = "multipage",
13 | "Split" = "split",
14 | "Grid" = "grid",
15 | "Plots" = "plot",
16 | "Images" = "images",
17 | "Buttons" = "buttons",
18 | "Sisters" = "sisters"
19 | ),
20 | multiLeft(
21 | align = "right",
22 | multiSection(
23 | menu = "multipage",
24 | h1("multiScroll.js")
25 | ),
26 | multiSection(
27 | menu = "split",
28 | center = TRUE,
29 | h1("Split")
30 | ),
31 | multiSection(
32 | center = TRUE,
33 | menu = "grid",
34 | multiRow(
35 | multiColumn("First Column"),
36 | multiColumn("Second Column")
37 | )
38 | ),
39 | multiSection(
40 | menu = "plot",
41 | center = TRUE,
42 | multiContainer(
43 | h1("Full Section Plot"),
44 | selectInput(
45 | "obs",
46 | "Select",
47 | c(10, 20 ,50 ,100 , 150)
48 | )
49 | )
50 | ),
51 | multiSection(
52 | menu = "images",
53 | h1("Image ")
54 | ),
55 | multiSection(
56 | menu = "buttons",
57 | center = TRUE,
58 | h1("Add buttons", style = "color: white;")
59 | ),
60 | multiSection(
61 | menu = "sisters",
62 | h1("More like this ->")
63 | )
64 | ),
65 | multiRight(
66 | align = "left",
67 | multiSection(
68 | h1("-Shiny")
69 | ),
70 | multiSection(
71 | plotOutput("plot1")
72 | ),
73 | multiSection(
74 | h1("<- Grid")
75 | ),
76 | multiSectionPlot("plot2"),
77 | multiSectionImage(
78 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg",
79 | side = "right",
80 | h1("Background")
81 | ),
82 | multiSection(
83 | center = TRUE,
84 | multiButtonDown("Next section", outline = TRUE)
85 | ),
86 | multiSection(
87 | center = TRUE,
88 | verbatimTextOutput("sistersDemo")
89 | )
90 | )
91 | )
92 |
93 | server <- function(input, output){
94 | output$plot1 <- renderPlot({
95 | par(bg = "#CEFFF2")
96 | plot(mtcars$mpg, mtcars$wt)
97 | })
98 |
99 | output$plot2 <- renderPlot({
100 | par(bg = "#90F9EA")
101 | hist(rnorm(input$obs, 10, 5))
102 | })
103 |
104 | output$sistersDemo <- renderText({
105 | '# See those
106 | demo("fullPage", package = "fullPage")
107 | demo("multiPage", package = "fullPage")'
108 | })
109 | }
110 |
111 | shinyApp(ui, server)
112 |
--------------------------------------------------------------------------------
/demo/pagePiling.R:
--------------------------------------------------------------------------------
1 | library(fullPage)
2 | library(shiny)
3 |
4 | ui <- pagePiling(
5 | center = TRUE,
6 | sections.color = c(
7 | "#4B97D2",
8 | "#FFE6F4",
9 | "#FFBDE1",
10 | "#FFBDE1",
11 | "#AEFFAC",
12 | "#C490F4",
13 | "#4B97D2"
14 | ),
15 | pageTheme("maroon"),
16 | menu = c(
17 | "Piling" = "intro",
18 | "Grid" = "grid",
19 | "Plots" = "backgrounds",
20 | "Images" = "image",
21 | "Themes" = "themes",
22 | "Buttons" = "buttons",
23 | "sisters" = "sisters"
24 | ),
25 | pageSection(
26 | menu = "intro",
27 | h1("pagePiling.js meets Shiny!", style = "color:#f3f3f3;")
28 | ),
29 | pageSection(
30 | menu = "grid",
31 | h1("Grid"),
32 | pageRow(
33 | pageColumn(
34 | h2("Columns"),
35 | p("plot on the right on larger screens"),
36 | p("And on below on mobile.")
37 | ),
38 | pageColumn(
39 | plotOutput("plot1")
40 | )
41 | )
42 | ),
43 | pageSectionPlot(
44 | "plot2",
45 | menu = "backgrounds",
46 | pageContainer(
47 | pageRow(
48 | pageColumn(),
49 | pageColumn(
50 | h1("Background Plot"),
51 | sliderInput(
52 | "slider",
53 | "Overlay input",
54 | min = 50,
55 | max = 250,
56 | value = 100
57 | )
58 | ),
59 | pageColumn()
60 | )
61 | )
62 | ),
63 | pageSectionImage( # will not show in viewer, open in browser
64 | menu = "image",
65 | img = paste0(
66 | "https://raw.githubusercontent.com/alvarotrigo/",
67 | "fullPage.js/master/examples/imgs/bg2.jpg"),
68 | h1("Image background")
69 | ),
70 | pageSection(
71 | menu = "themes",
72 | pageContainer(
73 | h1("16 themes"),
74 | verbatimTextOutput("themes")
75 | )
76 | ),
77 | pageSection(
78 | h1("Buttons", style = "color:#f3f3f3;"),
79 | pageButtonDown("Next Section")
80 | ),
81 | pageSection(
82 | menu = "sisters",
83 | pageContainer(
84 | h1("Sister functions", style = "color:#f3f3f3;"),
85 | verbatimTextOutput("sisters")
86 | )
87 | )
88 | )
89 |
90 | server <- function(input, output){
91 |
92 | output$plot1 <- renderPlot({
93 | par(bg = "#FFE6F4")
94 | plot(mtcars$wt, mtcars$mpg)
95 | })
96 |
97 | output$plot2 <- renderPlot({
98 | par(bg = "#FFBDE1")
99 | hist(rnorm(input$slider, mean = 25, sd = 5))
100 | })
101 |
102 | output$plot3 <- renderPlot({
103 | par(bg = "#FFADB2")
104 | plot(1:nrow(mtcars), mtcars$drat, type = "l")
105 | })
106 |
107 | output$sisters <- renderText({
108 | '# See those
109 | demo("fullPage", package = "fullPage")
110 | demo("multiPage", package = "fullPage")'
111 | })
112 |
113 | output$themes <- renderText({
114 | 'pageTheme()'
115 | })
116 | }
117 |
118 | shinyApp(ui, server)
119 |
--------------------------------------------------------------------------------
/man/button.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/fullButton.R
3 | \name{fullButton}
4 | \alias{fullButton}
5 | \alias{fullButtonTo}
6 | \alias{fullButtonUp}
7 | \alias{fullButtonDown}
8 | \alias{fullButtonRight}
9 | \alias{fullButtonLeft}
10 | \alias{fullButtonCustom}
11 | \alias{pageButton}
12 | \alias{multiButton}
13 | \alias{pageButtonUp}
14 | \alias{pageButtonDown}
15 | \alias{pageButtonTo}
16 | \alias{multiButtonUp}
17 | \alias{multiButtonDown}
18 | \alias{multiButtonTo}
19 | \title{Add buttons}
20 | \usage{
21 | fullButton(..., outline = FALSE, clear = FALSE)
22 |
23 | fullButtonTo(..., section, slide = 0, outline = FALSE, clear = FALSE)
24 |
25 | fullButtonUp(..., outline = FALSE, clear = FALSE)
26 |
27 | fullButtonDown(..., outline = FALSE, clear = FALSE)
28 |
29 | fullButtonRight(..., outline = FALSE, clear = FALSE)
30 |
31 | fullButtonLeft(..., outline = FALSE, clear = FALSE)
32 |
33 | fullButtonCustom(..., fun, outline = FALSE, clear = FALSE)
34 |
35 | pageButton(..., outline = FALSE, clear = FALSE)
36 |
37 | multiButton(..., outline = FALSE, clear = FALSE)
38 |
39 | pageButtonUp(..., outline = FALSE, clear = FALSE)
40 |
41 | pageButtonDown(..., outline = FALSE, clear = FALSE)
42 |
43 | pageButtonTo(..., section, outline = FALSE, clear = FALSE)
44 |
45 | multiButtonUp(..., outline = FALSE, clear = FALSE)
46 |
47 | multiButtonDown(..., outline = FALSE, clear = FALSE)
48 |
49 | multiButtonTo(..., section, outline = FALSE, clear = FALSE)
50 | }
51 | \arguments{
52 | \item{...}{any other element}
53 |
54 | \item{outline, clear}{set outline or clear button.}
55 |
56 | \item{section, slide}{target section and/or slide.}
57 |
58 | \item{fun}{Javascript function to pass to button.}
59 | }
60 | \description{
61 | Add buttons to your \code{\link{fullPage}}, \code{\link{pagePiling}} and \code{\link{multiPage}}.
62 | }
63 | \details{
64 | See example for \code{*Custom} button.
65 | }
66 | \examples{
67 | library(shiny)
68 |
69 | if(interactive()){
70 |
71 | ui <- fullPage(
72 |
73 | center = TRUE,
74 |
75 | fullSection(
76 | center = TRUE,
77 | h1("Buttons")
78 | ),
79 | fullSection(
80 | fullButton("Visit site", href = "https://john-coene.com")
81 | ),
82 | fullSection(
83 | fullButtonDown("Move Down", outline = TRUE)
84 | ),
85 | fullSection(
86 | fullButtonUp("Move up")
87 | ),
88 | fullSection(
89 | fullButtonTo("Move to first section", section = 1)
90 | ),
91 | fullSection(
92 | center = TRUE,
93 | fullSlide(
94 | fullButtonRight("Slide right", clear = TRUE)
95 | ),
96 | fullSlide(
97 | fullButtonLeft("Slide left", clear = TRUE)
98 | )
99 | ),
100 | fullSection(
101 | p("Disables keyboard scrolling"),
102 | fullButtonCustom("Custom button",
103 | fun = "$.fn.fullpage.setKeyboardScrolling(false, 'down, right');")
104 | )
105 | )
106 |
107 | server <- function(input, output){}
108 |
109 | shinyApp(ui, server)
110 | }
111 | }
112 | \author{
113 | John Coene, \email{jcoenep@gmail.com}
114 | }
115 |
--------------------------------------------------------------------------------
/demo/fullPage.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 | library(fullPage)
3 |
4 | options <- list(
5 | sectionsColor = c(
6 | "#C3F3EC",
7 | "#FE9199",
8 | "#FFADB2",
9 | "#FFCAB1",
10 | "#C3F3EC",
11 | "#FFFFFF",
12 | "#FE9199",
13 | "#FFADB2"
14 | )
15 | )
16 |
17 | ui <- fullPage(
18 | center = TRUE,
19 | opts = options,
20 | menu = c(
21 | "FullPage" = "intro",
22 | "Slides" = "slides",
23 | "Grid" = "grid",
24 | "Plots bg" = "plotbg",
25 | "Slides bg" = "slidebg",
26 | "Images" = "images",
27 | "Buttons" = "buttons",
28 | "Sisters" = "sisters"
29 | ),
30 | fullSection(
31 | menu = "intro",
32 | h1("fullPage.js meets Shiny.")
33 | ),
34 | fullSection(
35 | menu = "slides",
36 | fullSlide(
37 | h1("Slide 1")
38 | ),
39 | fullSlide(
40 | h1("Slide 2")
41 | )
42 | ),
43 | fullSection(
44 | menu = "grid",
45 | fullContainer(
46 | h1("Grid System"),
47 | fullRow(
48 | fullColumn(
49 | h2("Use Columns")
50 | ),
51 | fullColumn(
52 | plotOutput("plot1")
53 | )
54 | ),
55 | p("from Miligram*")
56 | )
57 | ),
58 | fullSectionPlot(
59 | "plot2",
60 | menu = "plotbg",
61 | fullContainer(
62 | h2("Background plots"),
63 | sliderInput(
64 | "input1",
65 | "Obs",
66 | min = 10,
67 | max = 500,
68 | step = 10,
69 | value = 250
70 | )
71 | )
72 | ),
73 | fullSection(
74 | menu = "slidebg",
75 | fullSlide(
76 | h2("Slide is here ->")
77 | ),
78 | fullSlidePlot(
79 | "plot3"
80 | ),
81 | fullSlideImage(
82 | img = paste0(
83 | "https://raw.githubusercontent.com/alvarotrigo/",
84 | "fullPage.js/master/examples/imgs/bg5.jpg"),
85 | h2("Image background")
86 | )
87 | ),
88 | fullSectionImage( # will not show in viewer, open in browser
89 | menu = "images",
90 | img = paste0(
91 | "https://raw.githubusercontent.com/alvarotrigo/",
92 | "fullPage.js/master/examples/imgs/bg2.jpg"),
93 | h1("Image background")
94 | ),
95 | fullSection(
96 | menu = "buttons",
97 | fullContainer(
98 | h1("Include buttons"),
99 | fullButtonDown("Next Section", outline = TRUE)
100 | )
101 | ),
102 | fullSection(
103 | menu = "sisters",
104 | fullContainer(
105 | h1("Sister functions"),
106 | verbatimTextOutput("sistersDemo")
107 | )
108 | )
109 | )
110 |
111 | server <- function(input, output){
112 |
113 | output$plot1 <- renderPlot({
114 | par(bg = "#FFADB2")
115 | plot(mtcars$wt, mtcars$mpg)
116 | })
117 |
118 | output$plot2 <- renderPlot({
119 | par(bg = "#F3F3F3")
120 | hist(rnorm(input$input1, mean = 25, sd = 5))
121 | })
122 |
123 | output$plot3 <- renderPlot({
124 | par(bg = "#FFADB2")
125 | plot(1:nrow(mtcars), mtcars$drat, type = "l")
126 | })
127 |
128 | output$sistersDemo <- renderText({
129 | '# See those
130 | demo("pagePiling", package = "fullPage")
131 | demo("multiPage", package = "fullPage")'
132 | })
133 | }
134 |
135 | shinyApp(ui, server)
136 |
--------------------------------------------------------------------------------
/inst/css/jquery.fullpage.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * fullPage 2.9.5
3 | * https://github.com/alvarotrigo/fullPage.js
4 | * MIT licensed
5 | *
6 | * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
7 | */.fp-enabled body,html.fp-enabled{margin:0;padding:0;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.fp-section{position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fp-slide{float:left}.fp-slide,.fp-slidesContainer{height:100%;display:block}.fp-slides{z-index:1;height:100%;overflow:hidden;position:relative;-webkit-transition:all .3s ease-out;transition:all .3s ease-out}.fp-section.fp-table,.fp-slide.fp-table{display:table;table-layout:fixed;width:100%}.fp-tableCell{display:table-cell;vertical-align:middle;width:100%;height:100%}.fp-slidesContainer{float:left;position:relative}.fp-controlArrow{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;position:absolute;z-index:4;top:50%;cursor:pointer;width:0;height:0;border-style:solid;margin-top:-38px;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.fp-controlArrow.fp-prev{left:15px;width:0;border-width:38.5px 34px 38.5px 0;border-color:transparent #fff transparent transparent}.fp-controlArrow.fp-next{right:15px;border-width:38.5px 0 38.5px 34px;border-color:transparent transparent transparent #fff}.fp-scrollable{overflow:hidden;position:relative}.fp-scroller{overflow:hidden}.iScrollIndicator{border:0!important}.fp-notransition{-webkit-transition:none!important;transition:none!important}#fp-nav{position:fixed;z-index:100;margin-top:-32px;top:50%;opacity:1;-webkit-transform:translate3d(0,0,0)}#fp-nav.right{right:17px}#fp-nav.left{left:17px}.fp-slidesNav{position:absolute;z-index:4;opacity:1;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0!important;right:0;margin:0 auto!important}.fp-slidesNav.bottom{bottom:17px}.fp-slidesNav.top{top:17px}#fp-nav ul,.fp-slidesNav ul{margin:0;padding:0}#fp-nav ul li,.fp-slidesNav ul li{display:block;width:14px;height:13px;margin:7px;position:relative}.fp-slidesNav ul li{display:inline-block}#fp-nav ul li a,.fp-slidesNav ul li a{display:block;position:relative;z-index:1;width:100%;height:100%;cursor:pointer;text-decoration:none}#fp-nav ul li a.active span,#fp-nav ul li:hover a.active span,.fp-slidesNav ul li a.active span,.fp-slidesNav ul li:hover a.active span{height:12px;width:12px;margin:-6px 0 0 -6px;border-radius:100%}#fp-nav ul li a span,.fp-slidesNav ul li a span{border-radius:50%;position:absolute;z-index:1;height:4px;width:4px;border:0;background:#333;left:50%;top:50%;margin:-2px 0 0 -2px;-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;transition:all .1s ease-in-out}#fp-nav ul li:hover a span,.fp-slidesNav ul li:hover a span{width:10px;height:10px;margin:-5px 0 0 -5px}#fp-nav ul li .fp-tooltip{position:absolute;top:-2px;color:#fff;font-size:14px;font-family:arial,helvetica,sans-serif;white-space:nowrap;max-width:220px;overflow:hidden;display:block;opacity:0;width:0;cursor:pointer}#fp-nav ul li:hover .fp-tooltip,#fp-nav.fp-show-active a.active+.fp-tooltip{-webkit-transition:opacity .2s ease-in;transition:opacity .2s ease-in;width:auto;opacity:1}#fp-nav ul li .fp-tooltip.right{right:20px}#fp-nav ul li .fp-tooltip.left{left:20px}.fp-auto-height .fp-slide,.fp-auto-height .fp-tableCell,.fp-auto-height.fp-section{height:auto!important}.fp-responsive .fp-auto-height-responsive .fp-slide,.fp-responsive .fp-auto-height-responsive .fp-tableCell,.fp-responsive .fp-auto-height-responsive.fp-section{height:auto!important}
8 | /*# sourceMappingURL=jquery.fullpage.min.css.map */
9 |
--------------------------------------------------------------------------------
/vignettes/fullPage.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "fullPage"
3 | author: "John Coene"
4 | date: "`r Sys.Date()`"
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{fullPage}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 | ```{r setup, include = FALSE}
13 | knitr::opts_chunk$set(
14 | collapse = TRUE,
15 | comment = "#>"
16 | )
17 | ```
18 |
19 | You can run a local demo of fullPage with `demo("fullPage", package = "fullPage")`.
20 |
21 | `fullPage` consists of section (`fullSection`) which may include slides (`fullSlide`), all the functions of relevant to fullPage start in `full_`.Always initialise the page with `fullPage`.
22 |
23 | The code looks like:
24 |
25 | ```r
26 | library(shiny)
27 | library(fullPage)
28 |
29 | options <- list(
30 | sectionsColor = c('#f2f2f2', '#4BBFC3', '#7BAABE'),
31 | parallax = TRUE
32 | )
33 |
34 | ui <- fullPage(
35 | menu = c("Full Page" = "link1",
36 | "Sections" = "link2",
37 | "Slides" = "section3",
38 | "backgrounds" = "section4",
39 | "Background Slides" = "section5"),
40 | opts = options,
41 | fullSection(
42 | center = TRUE,
43 | menu = "link1",
44 | tags$h1("fullPage.js meets Shiny")
45 | ),
46 | fullSection(
47 | menu = "link2",
48 | fullContainer(
49 | fullRow(
50 | fullColumn(
51 | h3("Column 1"),
52 | selectInput(
53 | "dd",
54 | "data points",
55 | choices = c(10, 20, 30)
56 | )
57 | ),
58 | fullColumn(
59 | plotOutput("hist")
60 | ),
61 | fullColumn(
62 | plotOutput("plot")
63 | )
64 | )
65 | )
66 | ),
67 | fullSection(
68 | menu = "section3",
69 | fullSlide(
70 | fullContainer(
71 | center = TRUE,
72 | h3("With container"),
73 | plotOutput("slideplot2"),
74 | shiny::verbatimTextOutput("containerCode")
75 | )
76 | ),
77 | fullSlide(
78 | center = TRUE,
79 | h3("Without container"),
80 | plotOutput("slideplot1")
81 | )
82 | ),
83 | fullSectionPlot(
84 | menu = "section4",
85 | center = TRUE,
86 | "fp",
87 | h3("Background plots"),
88 | fullContainer(
89 | sliderInput(
90 | "fpInput",
91 | label = "Input",
92 | min = 10,
93 | max = 100,
94 | value = 74
95 | )
96 | )
97 | ),
98 | fullSection(
99 | menu = "section5",
100 | fullSlidePlot(
101 | "slideSectionPlot1",
102 | center = TRUE,
103 | h1("Slide background plot")
104 | ),
105 | fullSlidePlot(
106 | "slideSectionPlot2"
107 | )
108 | )
109 | )
110 |
111 | server <- function(input, output){
112 |
113 | output$plot <- renderPlot({
114 | hist(rnorm(input$dd, 1, 10))
115 | })
116 |
117 | output$hist <- renderPlot({
118 | hist(rnorm(input$dd, 1, 10))
119 | })
120 |
121 | output$slideplot1 <- renderPlot({
122 | plot(mtcars$mpg, mtcars$drat)
123 | })
124 |
125 | output$slideplot2 <- renderPlot({
126 | plot(mtcars$wt, mtcars$mpg)
127 | })
128 |
129 | output$fp <- renderPlot({
130 | par(bg="gray")
131 | hist(rnorm(input$fpInput, 1, 10))
132 | })
133 |
134 | output$containerCode <- renderText({
135 | "fullSlide(
136 | fullContainer(...)
137 | )"
138 | })
139 |
140 | output$slideSectionPlot1 <- renderPlot({
141 | par(bg="gray")
142 | hist(rnorm(50, 1, 20))
143 | })
144 |
145 | output$slideSectionPlot2 <- renderPlot({
146 | par(bg="gray")
147 | hist(rnorm(50, 1, 25))
148 | })
149 | }
150 |
151 | shinyApp(ui, server)
152 | ```
--------------------------------------------------------------------------------
/docs/pkgdown.js:
--------------------------------------------------------------------------------
1 | /* http://gregfranko.com/blog/jquery-best-practices/ */
2 | (function($) {
3 | $(function() {
4 |
5 | $("#sidebar")
6 | .stick_in_parent({offset_top: 40})
7 | .on('sticky_kit:bottom', function(e) {
8 | $(this).parent().css('position', 'static');
9 | })
10 | .on('sticky_kit:unbottom', function(e) {
11 | $(this).parent().css('position', 'relative');
12 | });
13 |
14 | $('body').scrollspy({
15 | target: '#sidebar',
16 | offset: 60
17 | });
18 |
19 | $('[data-toggle="tooltip"]').tooltip();
20 |
21 | var cur_path = paths(location.pathname);
22 | var links = $("#navbar ul li a");
23 | var max_length = -1;
24 | var pos = -1;
25 | for (var i = 0; i < links.length; i++) {
26 | if (links[i].getAttribute("href") === "#")
27 | continue;
28 | // Ignore external links
29 | if (links[i].host !== location.host)
30 | continue;
31 |
32 | var nav_path = paths(links[i].pathname);
33 |
34 | var length = prefix_length(nav_path, cur_path);
35 | if (length > max_length) {
36 | max_length = length;
37 | pos = i;
38 | }
39 | }
40 |
41 | // Add class to parent
YEAR: 2017 142 | COPYRIGHT HOLDER: John Coene 143 |144 | 145 |
NEWS.md
140 | vignettes/callbacks.Rmd
108 | callbacks.RmdCallbacks let you pick up on events, i.e.: which slide is currently being viewed. For instance, it comes in handy to display animations at the right moment! Below are the callbacks available to each family of functions:
115 |fullPage
116 |input$fp_origin: origin slideinput$fp_destination: destination slideinput$fp_direction: scroll directionpagePiling & multiScroll
125 |input$fp_anchor: slide anchorinput$fp_index: slide indexDemo:
132 |library(shiny)
133 | library(fullPage)
134 |
135 | ui <- fullPage(
136 | fullSection(
137 | menu = "first",
138 | center = TRUE,
139 | h1("Callbacks")
140 | ),
141 | fullSection(
142 | menu = "second",
143 | center = TRUE,
144 | h3("Slide"),
145 | verbatimTextOutput("slide")
146 | )
147 | )
148 |
149 | server <- function(input, output){
150 |
151 | output$slide <- renderPrint({
152 | input$fp_origin # returns menu
153 | })
154 |
155 | }
156 |
157 | shinyApp(ui, server)111 |113 |Many of the amazing works of Álvaro Trigo for Shiny!
112 |
114 | fullPage demo 115 | pagePiling demo 116 | multiScroll demo 117 |
118 |Install the stable version from CRAN:
122 |install.packages("fullPage")Install the dev version from Github with:
124 |# install.packages("remotes")
125 | remotes::install_github("RinteRface/fullPage")full.page.multi.All ships with:
139 |Create multi page sides; left and right.
146 |multiLeft(..., align = NULL) 149 | 150 | multiRight(..., align = NULL)151 | 152 |
| ... | 157 |any element. |
158 |
|---|---|
| align | 161 |text alignment passed to |
162 |
Only use one of each in multiPage.
200 |if(interactive()){ 171 | library(shiny) 172 | 173 | ui <- multiPage( 174 | multiLeft( 175 | multiSection( 176 | align = "right", 177 | h1("Left") 178 | ), 179 | multiSection( 180 | align = "center", 181 | h1("Left Again") 182 | ) 183 | ), 184 | multiRight( 185 | multiSection( 186 | align = "left", 187 | h1("Right") 188 | ), 189 | multiSection( 190 | align = "center", 191 | h1("Right again") 192 | ) 193 | ) 194 | ) 195 | 196 | server <- function(input, output){} 197 | 198 | shinyApp(ui, server) 199 | }
Set a theme.
146 |fullTheme(theme) 149 | 150 | multiTheme(theme) 151 | 152 | pageTheme(theme)153 | 154 |
| theme | 159 |theme, see details. |
160 |
|---|
Valid theme:
aqua
black
blue
dark2
fuchsia
gray
green
lime
maroon
navy
olive
orange
purple
red
silver
teal
yellow
216 |if(interactive()){ 187 | 188 | ui <- fullPage( 189 | 190 | center = TRUE, 191 | 192 | fullTheme("red"), # theme 193 | 194 | fullSection( 195 | center = TRUE, 196 | h1("Themes") 197 | ), 198 | fullSection( 199 | fullButtonTo("Move to first section", section = 1) 200 | ), 201 | fullSection( 202 | center = TRUE, 203 | fullSlide( 204 | fullButtonRight("Slide right", clear = TRUE) 205 | ), 206 | fullSlide( 207 | fullButtonLeft("Slide left", clear = TRUE) 208 | ) 209 | ) 210 | ) 211 | 212 | server <- function(input, output){} 213 | 214 | shinyApp(ui, server) 215 | }
Add a container.
146 |fullContainer(...) 149 | 150 | pageContainer(...) 151 | 152 | multiContainer(...)153 | 154 |
| ... | 159 |any element. |
160 |
|---|
Pass within your grid, sections or slides.
166 | 167 |205 |if(interactive()){ 169 | library(shiny) 170 | 171 | ui <- fullPage( 172 | center = TRUE, 173 | fullSection( 174 | h1("Containers") 175 | ), 176 | fullSection( 177 | h1("Without container"), 178 | plotOutput("plot1") 179 | ), 180 | fullSection( 181 | fullContainer( 182 | h1("With container"), 183 | plotOutput("plot2"), 184 | pre( 185 | code( 186 | "fullContainer()" 187 | ) 188 | ) 189 | ) 190 | ) 191 | ) 192 | 193 | server <- function(input, output){ 194 | output$plot1 <- renderPlot({ 195 | plot(mtcars$wt, mtcars$mpg) 196 | }) 197 | 198 | output$plot2 <- renderPlot({ 199 | plot(mtcars$wt, mtcars$mpg) 200 | }) 201 | } 202 | 203 | shinyApp(ui, server) 204 | }
Create multi sections.
146 |multiSection(..., menu = NULL, align = "none") 149 | 150 | multiSectionImage(..., img, side, menu = NULL, align = "none")151 | 152 |
| ... | 157 |any element. |
158 |
|---|---|
| menu | 161 |named vector of menu links. |
162 |
| align | 165 |text alignment, takes |
166 |
| img | 169 |path to image. |
170 |
| side | 173 |image side. |
174 |
220 |if(interactive()){ 180 | library(shiny) 181 | 182 | options <- list( 183 | sectionsColor = c("#f3f3f3", "#d3d3d3", "#000") 184 | ) 185 | 186 | ui <- multiPage( 187 | opts = options, 188 | multiLeft( 189 | align = "right", 190 | multiSection( 191 | h1("multi") 192 | ), 193 | multiSection( 194 | h2("Section ") 195 | ), 196 | multiSection( 197 | h2("Image ") 198 | ) 199 | ), 200 | multiRight( 201 | align = "left", 202 | multiSection( 203 | h1("page()") 204 | ), 205 | multiSection( 206 | h2(" 2") 207 | ), 208 | multiSectionImage( 209 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 210 | side = "right", 211 | h2("Background") 212 | ) 213 | ) 214 | ) 215 | 216 | server <- function(input, output){} 217 | 218 | shinyApp(ui, server) 219 | }