Movatterモバイル変換


[0]ホーム

URL:


scrollrevealR

CRAN_Status_Badge

CRAN_time_from_release

metacran downloads

metacran downloads

Travis build status

R badge

scrollrevealR allows you to animateshinyelements when they scroll into view using thescrollrevealjs library.


Installation

You can install thescrollrevealR package fromCRANwith:

install.packages("scrollrevealR")

You can install the development version ofscrollrevealRfromGitHub with:

# install.packages("devtools")devtools::install_github("feddelegrand7/scrollrevealR")

Example

In order to usescrollrevealR, you only need to use onefunction:

Important:when you apply thescroll_reveal() function on ShinyTables, they tend to disappear when you scroll down to check the lastobservations of the table which is annoying. In order to deal with thisissue, you can use thereset = FALSE argument which willtrigger an animation only once.

Below an example of a simple shiny app that uses thescrollrevealR package:

library(shiny)library(scrollrevealR)ui<-fluidPage(h1("Mtcars Plot"),br(),br(),plotOutput(outputId ="plt1"),br(),br(),h1("Iris Plot"),plotOutput(outputId ="plt2"),br(),br(),h1("ChickWeight Plot"),plotOutput(outputId ="plt3"),# Using the scroll_reveal() function -------------------------------------------scroll_reveal(target =c("#plt1","#plt2","#plt3"),duration =2000,distance ="100px"),scroll_reveal(target ="h1",duration =2000,distance ="100px"),# -----------------------------------------------------------------------------# Making some space at the endbr(),br(),br(),br(),br(),br(),br(),br(),br(),br(),br(),br())server<-function(input, output) {output$plt1<-renderPlot({plot(mtcars)  })output$plt2<-renderPlot({plot(iris)})output$plt3<-renderPlot({plot(ChickWeight)})}shinyApp(ui = ui,server = server)

Commercial License

If you use thescrollrevealR package for commercialusage, You can buy a Commercial License from thescrollrevealwebsite.

Code of Conduct

Please note that the scrollrevealR project is released with aContributorCode of Conduct. By contributing to this project, you agree to abideby its terms.


[8]ページ先頭

©2009-2025 Movatter.jp