Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JohnCoene/textillate

📄 textillate.js for R
https://github.com/JohnCoene/textillate

r rstats

Last synced: about 2 months ago
JSON representation

📄 textillate.js for R

Awesome Lists containing this project

README

        

[![Travis-CI Build Status](https://travis-ci.org/JohnCoene/textillate.svg?branch=master)](https://travis-ci.org/JohnCoene/textillate)

# textillate

[textillate.js](http://textillate.js.org/) for R.

## Dependencies

* [jQuery](http://jquery.com/download/)
* [lettering.js](https://github.com/davatron5000/Lettering.js)
* [animate.css](https://github.com/daneden/animate.css)

## Examples

### RMarkdown

``` r
textillate(
"Textillate"
)

textillate(
"Effects",
`in` = list(
effect = "rollIn"
)
)

# Pass options as list
textillate(
"Duration and effect",
`in` = list(
effect = "flipInX"
),
min.display.time = 5000
)

# Or pipe
textillate(
"Duration and effect",
min.display.time = 5000
) %>%
textillateIn(
effect = "flipInX",
delay = 1000,
shuffle = TRUE
)
```

### Shiny

*proxies*

```r
if(interactive()){
library(shiny)

ui <- fluidPage(
actionButton(
"start",
"start"
),
actionButton(
"stop",
"stop"
),
actionButton(
"in",
"in"
),
actionButton(
"out",
"out"
),
textillateOutput('textillate')
)

server <- function(input, output){
output$textillate <- renderTextillate({
textillate("Click to start", auto.start = FALSE) %>%
textillateIn(effect = "fadeIn") %>%
textillateOut(effect = "bounce")
})

observeEvent(input$start, {
textillateProxy("textillate") %>%
textillateStartProxy()
})

observeEvent(input$stop, {
textillateProxy("textillate") %>%
textillateStopProxy()
})

observeEvent(input$in, {
textillateProxy("textillate") %>%
textillateInProxy()
})

observeEvent(input$out, {
textillateProxy("textillate") %>%
textillateOutProxy()
})
}

shinyApp(ui, server)
}
```