Skip to content

Commit 517a492

Browse files
Merge branch 'enhancements'
2 parents f03c135 + 56bef5d commit 517a492

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1975
-5895
lines changed

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
^node_modules$
2+
^pkgdown$
23
^.*\.Rproj$
34
^\.Rproj\.user$
45
^\build
@@ -10,3 +11,5 @@
1011
^karma\.conf\.js$
1112
^package\.json$
1213
^yarn\.lock$
14+
^README\.Rmd$
15+
logo.svg

README.Rmd

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
output: github_document
3+
---
4+
5+
# reactR <img src="logo.svg" alt="reactR logo" width="100px" />
6+
7+
<!-- README.md is generated from README.Rmd. Please edit that file -->
8+
9+
```{r setup, include = FALSE}
10+
knitr::opts_chunk$set(
11+
collapse = TRUE,
12+
comment = "#>",
13+
fig.path = "man/figures/README-",
14+
out.width = "100%"
15+
)
16+
```
17+
18+
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/reactR)](https://cran.r-project.org/package=reactR)
19+
[![Travis-CI Build Status](https://travis-ci.org/react-R/reactR.svg?branch=master)](https://travis-ci.org/react-R/reactR)
20+
21+
22+
`reactR` provides a set of convenience functions for using [`React`](https://facebook.github.io/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`. The local dependency functions are modeled after the `html_dependency_*` functions from RStudio's [`rmarkdown`](https://github.com/rstudio/rmarkdown) package.
23+
24+
## Installation
25+
26+
You can install reactR from CRAN with `install.packages("reactR")`. For the development version, please use `devtools` as shown below.
27+
28+
```R
29+
# install.packages("devtools")
30+
devtools::install_github("react-R/reactR")
31+
```
32+
33+
## Creating htmlwidgets with React Components
34+
35+
To wrap a `React` component as an `htmlwidget`, please see the tutorial [htmlwidgets with reactR](https://react-r.github.io/reactR/articles/intro_htmlwidgets.html). Also, there are a variety of examples in the [react-R Github organization](https://github.com/react-R).
36+
37+
## Examples
38+
39+
```R
40+
library(reactR)
41+
library(htmltools)
42+
43+
browsable(tagList(
44+
tags$div(id = "app"),
45+
tags$script(
46+
"
47+
ReactDOM.render(
48+
React.createElement(
49+
'h1',
50+
null,
51+
'Powered by React'
52+
),
53+
document.getElementById('app')
54+
)
55+
"
56+
),
57+
#add core-js first to work in RStudio Viewer
58+
html_dependency_corejs(),
59+
html_dependency_react()
60+
))
61+
```
62+
63+
`reactR` also uses the `V8` package if available to transform `JSX` and `ES2015` code.
64+
65+
```R
66+
library(reactR)
67+
library(htmltools)
68+
69+
browsable(
70+
tagList(
71+
tags$div(id = "app"),
72+
tags$script(
73+
babel_transform('ReactDOM.render(<h1>Powered By React/JSX</h1>,document.getElementById("app"))')
74+
),
75+
# add core-js shim first for React in RStudio Viewer
76+
html_dependency_corejs(),
77+
html_dependency_react()
78+
)
79+
)
80+
```
81+
82+
## Contributing and Code of Conduct
83+
84+
We welcome contributors and would love your participation. Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by the terms.

README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/reactR)](https://cran.r-project.org/package=reactR)
2-
[![Travis-CI Build Status](https://travis-ci.org/react-R/reactR.svg?branch=master)](https://travis-ci.org/react-R/reactR)
31

4-
<img height="150px" alt="react-R logo" src="https://github.com/react-R/reactR/raw/enhancements/assets/logos/reactR-logo.png"/>
2+
# reactR <img src="logo.svg" alt="reactR logo" width="100px" />
53

6-
# reactR
4+
<!-- README.md is generated from README.Rmd. Please edit that file -->
75

8-
`reactR` provides a set of convenience functions for using [`React`](https://facebook.github.io/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`. The local dependency functions are modeled after the `html_dependency_*` functions from RStudio's [`rmarkdown`](https://github.com/rstudio/rmarkdown) package.
6+
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/reactR)](https://cran.r-project.org/package=reactR)
7+
[![Travis-CI Build
8+
Status](https://travis-ci.org/react-R/reactR.svg?branch=master)](https://travis-ci.org/react-R/reactR)
9+
10+
`reactR` provides a set of convenience functions for using
11+
[`React`](https://facebook.github.io/react) in `R` with `htmlwidget`
12+
constructor templates and local JavaScript dependencies. The `React`
13+
ecosystem is rich with components that can enhance `R` web and Shiny
14+
apps. `scaffoldReactWidget()` helps build `htmlwidgets` to integrate
15+
these `React` components as `R` `htmlwidgets`. The local dependency
16+
functions are modeled after the `html_dependency_*` functions from
17+
RStudio’s [`rmarkdown`](https://github.com/rstudio/rmarkdown) package.
918

1019
## Installation
1120

12-
You can install reactR from CRAN with `install.packages("reactR")`. For the development version, please use `devtools` as shown below.
21+
You can install reactR from CRAN with `install.packages("reactR")`. For
22+
the development version, please use `devtools` as shown below.
1323

14-
```R
24+
``` r
1525
# install.packages("devtools")
1626
devtools::install_github("react-R/reactR")
1727
```
1828

1929
## Creating htmlwidgets with React Components
2030

21-
To wrap a `React` component as an `htmlwidget`, please see the tutorial [htmlwidgets with reactR](https://react-r.github.io/reactR/articles/intro_htmlwidgets.html). Also, there are a variety of examples in the [react-R Github organization](https://github.com/react-R).
31+
To wrap a `React` component as an `htmlwidget`, please see the tutorial
32+
[htmlwidgets with
33+
reactR](https://react-r.github.io/reactR/articles/intro_htmlwidgets.html).
34+
Also, there are a variety of examples in the [react-R Github
35+
organization](https://github.com/react-R).
2236

2337
## Examples
2438

25-
```R
39+
``` r
2640
library(reactR)
2741
library(htmltools)
2842

@@ -46,9 +60,10 @@ browsable(tagList(
4660
))
4761
```
4862

49-
`reactR` also uses the `V8` package if available to transform `JSX` and `ES2015` code.
63+
`reactR` also uses the `V8` package if available to transform `JSX` and
64+
`ES2015` code.
5065

51-
```R
66+
``` r
5267
library(reactR)
5368
library(htmltools)
5469

@@ -67,4 +82,7 @@ browsable(
6782

6883
## Contributing and Code of Conduct
6984

70-
We welcome contributors and would love your participation. Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by the terms.
85+
We welcome contributors and would love your participation. Please note
86+
that this project is released with a [Contributor Code of
87+
Conduct](CONDUCT.md). By participating in this project you agree to
88+
abide by the terms.

docs/CONDUCT.html

Lines changed: 160 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)