All Projects → react-R → Reactr

react-R / Reactr

Licence: other
React for R

Programming Languages

javascript
184084 projects - #8 most used programming language
r
7636 projects

Projects that are alternatives of or similar to Reactr

Sunburstr
R htmlwidget for interactive sunburst plots
Stars: ✭ 177 (-22.03%)
Mutual labels:  package, rstats, htmlwidgets
rchess
♛ Chess package for R
Stars: ✭ 68 (-70.04%)
Mutual labels:  cran, rstats, htmlwidgets
Pkgsearch
Search R packages on CRAN
Stars: ✭ 73 (-67.84%)
Mutual labels:  package, cran, rstats
Highcharter
R wrapper for highcharts
Stars: ✭ 583 (+156.83%)
Mutual labels:  cran, rstats, htmlwidgets
Linl
Linl Is Not Letter -- Markdown-based LaTeX Letter Template
Stars: ✭ 84 (-63%)
Mutual labels:  package, cran
Sigmajs
Σ sigma.js for R
Stars: ✭ 58 (-74.45%)
Mutual labels:  rstats, htmlwidgets
Gargle
Infrastructure for calling Google APIs from R, including auth
Stars: ✭ 88 (-61.23%)
Mutual labels:  package, rstats
Manipulatewidget
Add More Interactivity to htmlwidgets
Stars: ✭ 110 (-51.54%)
Mutual labels:  cran, htmlwidgets
Ggrepel
📍 Repel overlapping text labels away from each other.
Stars: ✭ 853 (+275.77%)
Mutual labels:  cran, rstats
Refinr
Cluster and merge similar char values: an R implementation of Open Refine clustering algorithms
Stars: ✭ 91 (-59.91%)
Mutual labels:  cran, rstats
D3r
d3.js helpers for R
Stars: ✭ 133 (-41.41%)
Mutual labels:  cran, rstats
Liger
Lightweight Iterative Gene set Enrichment in R
Stars: ✭ 44 (-80.62%)
Mutual labels:  cran, rstats
Rcppexamples
Examples of using Rcpp to interface R and C++
Stars: ✭ 33 (-85.46%)
Mutual labels:  package, cran
Onnx R
R Interface to Open Neural Network Exchange (ONNX)
Stars: ✭ 31 (-86.34%)
Mutual labels:  cran, rstats
Matrixstats
R package: Methods that Apply to Rows and Columns of Matrices (and to Vectors)
Stars: ✭ 151 (-33.48%)
Mutual labels:  package, cran
Changepoint
A place for the development version of the changepoint package on CRAN.
Stars: ✭ 90 (-60.35%)
Mutual labels:  package, cran
Streamgraph
〰️ htmlwidget for creating streamgraph visualizations in R
Stars: ✭ 137 (-39.65%)
Mutual labels:  rstats, htmlwidgets
Explor
Interfaces for Multivariate Analysis in R
Stars: ✭ 157 (-30.84%)
Mutual labels:  cran, htmlwidgets
Usethis
Set up commonly used 📦 components
Stars: ✭ 613 (+170.04%)
Mutual labels:  package, rstats
Tidymv
Tidy Model Visualisation for Generalised Additive Models
Stars: ✭ 25 (-88.99%)
Mutual labels:  package, rstats

reactR reactR logo

CRAN_Status_Badge Travis-CI Build Status Slack Status

reactR provides a set of convenience functions for using React in R with htmlwidget constructor templates and local JavaScript dependencies. The React ecosystem is rich with components that can enhance R web and Shiny apps. scaffoldReactWidget() helps build htmlwidgets to integrate these React components as R htmlwidgets. scaffoldReactShinyInput() does the same for Shiny inputs. The local dependency functions are modeled after the html_dependency_* functions from RStudio’s rmarkdown package.

Installation

You can install reactR from CRAN with install.packages("reactR"). For the development version, please use devtools as shown below.

# install.packages("devtools")
devtools::install_github("react-R/reactR")

Creating htmlwidgets with React Components

To wrap a React component as an htmlwidget, please see the tutorial htmlwidgets with reactR. Also, there are a variety of examples in the react-R Github organization.

reactable is a very well-built htmlwidget leveraging this functionality.

Shiny Outputs and Inputs

htmlwidgets built with reactR work well in Shiny as outputs. In version 0.4.0 Alan Dipert has added the ability to easily create React-based official Shiny inputs with helpers and scaffolds. Please see the tutorial for more details.

Examples

Below are examples of using reactR directly.

library(reactR)
library(htmltools)

browsable(tagList(
  tags$div(id = "app"),
  tags$script(
  "
    ReactDOM.render(
      React.createElement(
        'h1',
        null,
        'Powered by React'
      ),
      document.getElementById('app')
    )
  "
  ),
  #add core-js first to work in RStudio Viewer
  html_dependency_corejs(),
  html_dependency_react()
))

reactR uses the V8 package if available to transform JSX and ES2015 code with babel.

library(reactR)
library(htmltools)

browsable(
  tagList(
    tags$div(id = "app"),
    tags$script(
      babel_transform('ReactDOM.render(<h1>Powered By React/JSX</h1>,document.getElementById("app"))')
    ),
    # add core-js shim first for React in older versions of RStudio Viewer
    #html_dependency_corejs(),
    html_dependency_react()
  )
)

Contributing and Code of Conduct

We welcome contributors and would love your participation. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by the terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].