rintrojs

rintrojs: A Wrapper for the Intro.js Library - Published in JOSS (2016)

https://github.com/carlganz/rintrojs

Science Score: 95.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
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

cran introjs r shiny
Last synced: 4 months ago · JSON representation

Repository

Wrapper for the Intro.js library

Basic Info
Statistics
  • Stars: 134
  • Watchers: 10
  • Forks: 11
  • Open Issues: 20
  • Releases: 3
Topics
cran introjs r shiny
Created over 9 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---


[![JOSS Status](https://joss.theoj.org/papers/10.21105/joss.00063/status.svg)](https://dx.doi.org/10.21105/joss.00063)[![Project Status: Active.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![R-CMD-check](https://github.com/carlganz/rintrojs/workflows/R-CMD-check/badge.svg)](https://github.com/carlganz/rintrojs/actions)[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/rintrojs)](https://cran.r-project.org/package=rintrojs)[![Licence](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.en.html)[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.0.0-6666ff.svg)](https://cran.r-project.org/)

rintrojs
========

[R](https://www.r-project.org/) was originally developed with the name S in the 70's as a glue language. Statisticians at Bell Labs needed an interactive environment for working with their C and Fortran scripts. Decades later, R is still a glue language, except instead of C and Fortran, it brings together C++, and JavaScript. With the advent of the [Shiny](https://shiny.posit.co/) package, R is now a popular platform for developing data-driven web applications. As Shiny increases in popularity so will the complexity of the Shiny apps built. In many instances, new-users will require guidance when they first use a Shiny application.

Luckily, there is already a well established JavaScript library for this purpose. [Intro.js](https://introjs.com/), written by Afshin Mehrabani, is a JavaScript library that helps integrate step-by-step introductions, and clickable hints into websites. The `rintrojs` R package integrates Intro.js into Shiny, so that users can easily add instructions to their application without having to use HTML, CSS, or JavaScript.

Install
-------

`rintrojs` is available on CRAN:

```r
install.packages("rintrojs")
```

To access the bleeding-edge version, use `devtools` to install `rintrojs` from github:

```r
devtools::install_github("carlganz/rintrojs")
```

Usage
-----

To use `rintrojs`, you need to call `introjsUI()` once in the UI. `rintrojs` supports both static and programmatic introductions meaning you can either wrap the elements you want to introduce with `introBox`, or dynamically generate your introduction using the `steps` option (see [the Intro.js documentaion](https://github.com/usablica/intro.js/wiki/Documentation)). You specify the order of the introduction with the data.step parameter, and you specify the content of the introduction with the data.intro parameter. You can initiate the introduction from the server by calling `introjs(session)`. You can also specify options, and pass text as the body of javascript events associated with `Intro.js`.

Here is an example with a static introduction, but with options, and events used. 

``` r
library(rintrojs)
library(shiny)

# Define UI for application that draws a histogram
ui <- shinyUI(fluidPage(
  introjsUI(),
  
  # Application title
  introBox(
    titlePanel("Old Faithful Geyser Data"),
    data.step = 1,
    data.intro = "This is the title panel"
  ),
  
  # Sidebar with a slider input for number of bins
  sidebarLayout(sidebarPanel(
    introBox(
      introBox(
        sliderInput(
          "bins",
          "Number of bins:",
          min = 1,
          max = 50,
          value = 30
        ),
        data.step = 3,
        data.intro = "This is a slider",
        data.hint = "You can slide me"
      ),
      introBox(
        actionButton("help", "Press for instructions"),
        data.step = 4,
        data.intro = "This is a button",
        data.hint = "You can press me"
      ),
      data.step = 2,
      data.intro = "This is the sidebar. Look how intro elements can nest"
    )
  ),
  
  # Show a plot of the generated distribution
  mainPanel(
    introBox(
      plotOutput("distPlot"),
      data.step = 5,
      data.intro = "This is the main plot"
    )
  ))
))

# Define server logic required to draw a histogram
server <- shinyServer(function(input, output, session) {
  # initiate hints on startup with custom button and event
  hintjs(session, options = list("hintButtonLabel"="Hope this hint was helpful"),
         events = list("onhintclose"=I('alert("Wasn\'t that hint helpful")')))
  
  output$distPlot <- renderPlot({
    # generate bins based on input$bins from ui.R
    x    <- faithful[, 2]
    bins <- seq(min(x), max(x), length.out = input$bins + 1)
    
    # draw the histogram with the specified number of bins
    hist(x,
         breaks = bins,
         col = 'darkgray',
         border = 'white')
  })
  
  # start introjs when button is pressed with custom options and events
  observeEvent(input$help,
               introjs(session, options = list("nextLabel"="Onwards and Upwards",
                                               "prevLabel"="Did you forget something?",
                                               "skipLabel"="Don't be a quitter"),
                                events = list("oncomplete"=I('alert("Glad that is over")')))
  )
})

# Run the application
shinyApp(ui = ui, server = server)
```

You can also generate introductions dynamically.

``` r
library(shiny)
library(rintrojs)

ui <- shinyUI(fluidPage(
      introjsUI(),
      mainPanel(
        textInput("intro","Enter an introduction"),
         actionButton("btn","Press me")
      )
   )
)

server <- shinyServer(function(input, output, session) {
   
  steps <- reactive(data.frame(element = c(NA,"#btn"),
                               intro = c(input$intro,"This is a button")))
  
  observeEvent(input$btn,{
    introjs(session,options = list(steps=steps()))
    
  })
  
})

# Run the application 
shinyApp(ui = ui, server = server)
```

Click [here to view example.](https://carlganz.shinyapps.io/rintrojsexample/)

Contributing
------------

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/carlganz/rintrojs/blob/master/CONDUCT.md). By participating in this project you agree to abide by its terms.

If you find any problems or have any questions, please feel free to file an issue. 

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):




Carl Ganz
Afshin Mehrabani
Etienne Bacher
Matthew van Bommel
Chris Baker
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

Owner

  • Name: Carl Ganz
  • Login: carlganz
  • Kind: user
  • Location: Los Angeles

Some kind of programer

JOSS Publication

rintrojs: A Wrapper for the Intro.js Library
Published
October 11, 2016
Volume 1, Issue 6, Page 63
Authors
Carl Ganz ORCID
UCLA Center for Health Policy Research
Editor
Arfon Smith ORCID
Tags
Shiny

Papers & Mentions

Total mentions: 3

ideal: an R/Bioconductor package for interactive differential expression analysis
Last synced: 3 months ago
iSEE: Interactive SummarizedExperiment Explorer
Last synced: 3 months ago
ExploreModelMatrix: Interactive exploration for improved understanding of design matrices and linear models in R
Last synced: 3 months ago

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 155
  • Total Committers: 6
  • Avg Commits per committer: 25.833
  • Development Distribution Score (DDS): 0.116
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
carlganz c****z@g****m 137
carlganz c****z@c****u 10
etiennebacher y****u@e****m 3
Matthew van Bommel m****l@g****m 2
Chris Baker c****r@g****m 2
Carl Ganz c****z@C****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 57
  • Total pull requests: 6
  • Average time to close issues: 6 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 42
  • Total pull request authors: 5
  • Average comments per issue: 2.96
  • Average comments per pull request: 1.33
  • Merged pull requests: 5
  • 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
  • brylie (6)
  • carlganz (6)
  • rpodcast (3)
  • happyshows (2)
  • federicomarini (2)
  • dchen71 (2)
  • lampoverde (1)
  • LukasK13 (1)
  • dernesa (1)
  • jsinnett (1)
  • mjdzr (1)
  • DavZim (1)
  • georgemirandajr (1)
  • leonawicz (1)
  • mvanbommel (1)
Pull Request Authors
  • carlganz (3)
  • LukasK13 (1)
  • mvanbommel (1)
  • crew102 (1)
  • etiennebacher (1)
Top Labels
Issue Labels
bug (5) enhancement (2) help wanted (1) question (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 2,748 last-month
  • Total docker downloads: 55,222
  • Total dependent packages: 12
    (may contain duplicates)
  • Total dependent repositories: 43
    (may contain duplicates)
  • Total versions: 13
  • Total maintainers: 1
cran.r-project.org: rintrojs

Wrapper for the 'Intro.js' Library

  • Versions: 9
  • Dependent Packages: 11
  • Dependent Repositories: 42
  • Downloads: 2,748 Last month
  • Docker Downloads: 55,222
Rankings
Stargazers count: 3.3%
Dependent repos count: 4.0%
Dependent packages count: 5.0%
Forks count: 6.3%
Downloads: 7.0%
Average: 8.4%
Docker downloads count: 25.1%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: r-rintrojs
  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.0%
Dependent packages count: 28.9%
Stargazers count: 31.1%
Average: 31.8%
Forks count: 43.4%
Last synced: 4 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.0.0 depends
  • jsonlite * imports
  • shiny * imports
  • covr * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite