Skip to content

Commit

Permalink
combine JavaScript steps
Browse files Browse the repository at this point in the history
  • Loading branch information
timelyportfolio committed Jan 27, 2019
1 parent a972c3d commit f1b4a7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
7 changes: 1 addition & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,14 @@ scaffoldReactWidget(

Now we have all the files we need for a working `htmlwidget` but unfortunately not working in the way we want.

## 1.5 Lines of JavaScript
## 1.5 Lines of JavaScript and Build

In the JavaScript, we will need to import the module we want to use. For `nivocal` we want `ResponsiveCalendar`. `import` in JavaScript is very similar to `library()` in R.

```{r eval=FALSE}
import { ResponsiveCalendar } from '@nivo/calendar'
```

![screencast of writing the JavaScript](./man/figures/nivocal3.gif)


## Build JavaScript

The JavaScript build toolchain can get complicated, but fortunately `reactR` takes care of much of this for us. I hate to tell you, but you will need to install [`node`](https://nodejs.org/en/download/) and [`yarn`](https://yarnpkg.com/lang/en/docs/install). I promise this is not hard or scary though. Once you have both installed, we will build/webpack our JavaScript in the RStudio terminal or other terminal/console.

```{r eval=FALSE}
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ scaffoldReactWidget(
Now we have all the files we need for a working `htmlwidget` but
unfortunately not working in the way we want.

## 1.5 Lines of JavaScript
## 1.5 Lines of JavaScript and Build

In the JavaScript, we will need to import the module we want to use. For
`nivocal` we want `ResponsiveCalendar`. `import` in JavaScript is very
Expand All @@ -67,10 +67,6 @@ similar to `library()` in R.
import { ResponsiveCalendar } from '@nivo/calendar'
```

![screencast of writing the JavaScript](./man/figures/nivocal3.gif)

## Build JavaScript

The JavaScript build toolchain can get complicated, but fortunately
`reactR` takes care of much of this for us. I hate to tell you, but you
will need to install [`node`](https://nodejs.org/en/download/) and
Expand Down
11 changes: 2 additions & 9 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f1b4a7e

Please sign in to comment.