aniview
▶️ Animate Shiny and R Markdown content when it comes into view
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.1%) to scientific vocabulary
Keywords
aniview
r
r-package
shiny
Last synced: 9 months ago
·
JSON representation
Repository
▶️ Animate Shiny and R Markdown content when it comes into view
Basic Info
- Host: GitHub
- Owner: lgnbhl
- License: other
- Language: R
- Default Branch: master
- Homepage: https://lgnbhl.github.io/aniview
- Size: 993 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
aniview
r
r-package
shiny
Created about 6 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Changelog
License
README.Rmd
--- output: github_document --- [](https://CRAN.R-project.org/package=aniview) [](https://cran.r-project.org/package=aniview) [](https://github.com/lgnbhl/aniview/actions/workflows/R-CMD-check.yaml) # aniview> Animate Shiny and R Markdown content when it comes into view The package `aniview` allows to animate Shiny and R Markdown content when it comes into view using [animate-css](https://daneden.github.io/animate.css/) thanks to [AniView](https://jjcosgrove.github.io/jquery-aniview/). ## Installation Install the released version from CRAN. ```{r install cran, eval = FALSE} install.packages("aniview") ``` To get a bug fix, or use a feature from the development version, you can install it from GitHub. ```{r install github, eval = FALSE} # install.packages("remotes") remotes::install_github("lgnbhl/aniview") ``` ## Shiny In order to use aniview, you must first call `use_aniview()` in the UI. Then simply apply `aniview()` to any shiny element with an animation listed on the [animate-css website](https://daneden.github.io/animate.css/). Here a basic example: ```{r shiny, eval = FALSE} library(shiny) library(tidyverse) library(ggrepel) library(aniview) shinyApp( ui = fluidPage( align = "center", aniview::use_aniview(), # add use_aniview() in the UI aniview(h1("Shiny with AniView"), animation = "fadeInUp"), HTML(rep("↓
scroll down
", 10)), aniview(plotOutput("plot"), animation = "slideInLeft"), br() ), server = function(input, output){ output$plot <- renderPlot({ ggplot(starwars, aes(mass, height)) + geom_point(aes(color = gender)) + geom_label_repel(aes(label = name), size = 3) + labs(title = "Star Wars Characters Height vs Mass") }) } ) ``` ### Htmlwidgets The function `aniview()` doesn't work directly with [htmlwidgets](https://www.htmlwidgets.org/). The solution is to put the htmlwidget inside a container and animate it. Below an example animating the `box()` from `shinydashboard` in order to use `plotly`. ```{r htmlwidgets, eval = FALSE} library(shiny) library(shinydashboard) library(plotly) ui <- dashboardPage( dashboardHeader(title = "Basic dashboard"), dashboardSidebar(), dashboardBody( use_aniview(), # use_aniview() should be inside the body element fluidRow( aniview(box(plotlyOutput("plotly")), animation = "slideInLeft"), ) ) ) server <- function(input, output) { output$plotly <- renderPlotly({ gg <- ggplot(mpg, aes(displ, hwy, colour = class)) + geom_point() ggplotly(gg) }) } shinyApp(ui, server) ``` ## R Markdown To animate a element of a R Markdown document, you must first call `use_aniview()` inside a R code chunk with ```{r, echo = FALSE}``` so the code will not be shown in the final document. ``` r ```{r, echo = FALSE} aniview::use_aniview() ``` ``` Then you can animate any content of your R Markdown document using the `:::` markers of the `rmarkdown` package followed by `{.aniview data-av-animation="ANIMATE-CSS EFFECT"}`. The animate-css effects are listed [here](https://daneden.github.io/animate.css/). Below an example with the "slideInUp" effect. ```md ::: {.aniview data-av-animation="slideInUp"} This element will be animated. ::: ``` You can learn more about the CSS class markers in the [Custom block](https://bookdown.org/yihui/rmarkdown-cookbook/custom-blocks.html) chapter of the *R Markdown Cookbook* from Yihui Xie. ### Xaringan presentation [xaringan](https://github.com/yihui/xaringan) is a package for creating slideshows with [remark.js](https://github.com/gnab/remark) using R Markdown. You can take a look at its [introductory presentation](https://slides.yihui.name/xaringan/). You can easily animate a slide using the "animated" class of [animate-css](https://daneden.github.io/animate.css/) with any animation effect. Below is a minimal example. ```md --- title: "Presentation Ninja" subtitle: "with xaringan" output: xaringan::moon_reader: lib_dir: libs --- ```{r, echo = FALSE} aniview::use_aniview() ``` # A normal slide --- class: animated, bounceInDown # An animated slide ```
Owner
- Name: Félix Luginbuhl
- Login: lgnbhl
- Kind: user
- Location: Switzerland
- Website: https://felixluginbuhl.com/
- Repositories: 5
- Profile: https://github.com/lgnbhl
R and data viz
GitHub Events
Total
Last Year
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| lgnbhl2 | f****l@p****h | 36 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: 8 days
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 5.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- dcaud (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 232 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: aniview
Animate Shiny and R Markdown Content when it Comes into View
- Homepage: https://felixluginbuhl.com/aniview
- Documentation: http://cran.r-project.org/web/packages/aniview/aniview.pdf
- License: MIT + file LICENSE
-
Latest release: 0.1.0
published about 6 years ago
Rankings
Stargazers count: 28.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 36.0%
Downloads: 57.6%
Maintainers (1)
Last synced:
9 months ago
Dependencies
.github/workflows/R-CMD-check.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc master composite
- r-lib/actions/setup-r master composite
DESCRIPTION
cran
- htmltools * imports
- jsonlite * imports
- shiny * suggests
> Animate Shiny and R Markdown content when it comes into view
The package `aniview` allows to animate Shiny and R Markdown content when it comes into view using [animate-css](https://daneden.github.io/animate.css/) thanks to [AniView](https://jjcosgrove.github.io/jquery-aniview/).
## Installation
Install the released version from CRAN.
```{r install cran, eval = FALSE}
install.packages("aniview")
```
To get a bug fix, or use a feature from the development version, you can install it from GitHub.
```{r install github, eval = FALSE}
# install.packages("remotes")
remotes::install_github("lgnbhl/aniview")
```
## Shiny
In order to use aniview, you must first call `use_aniview()` in the UI.
Then simply apply `aniview()` to any shiny element with an animation listed on the [animate-css website](https://daneden.github.io/animate.css/).
Here a basic example:
```{r shiny, eval = FALSE}
library(shiny)
library(tidyverse)
library(ggrepel)
library(aniview)
shinyApp(
ui = fluidPage(
align = "center",
aniview::use_aniview(), # add use_aniview() in the UI
aniview(h1("Shiny with AniView"), animation = "fadeInUp"),
HTML(rep("↓