-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
83 lines (62 loc) · 2 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# detourr <img src="man/figures/logo.png" align="right"/>
Animations for {tourr} using htmlwidgets for performance and portability.
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/",
out.width = "100%"
)
```
# Installation
Install this package by running the following in R:
```{r, eval=FALSE}
remotes::install_github("casperhart/detourr")
```
# Examples
```{r, eval=FALSE}
# 2D scatter
library(tourr)
library(detourr)
detour(olive, tour_aes(projection = palmitic:eicosenoic, colour = region)) |>
show_scatter()
```
```{r, eval=FALSE}
# 3D scatter
detour(olive, tour_aes(projection = palmitic:eicosenoic, colour = region)) |>
tour_path(grand_tour(3)) |>
show_scatter()
```
# Development
## Getting Started
This project uses TypeScript code which needs to be compiled and bundled for
the package to work. To do this, you will need `node.js`, and `yarn`
installed.
After cloning this repository, you can install the node.js dependencies via:
```{bash, eval=FALSE}
yarn install
```
Compile and bundle the TypeScript code and install the R package from source by
running:
```{bash, eval=FALSE}
yarn run build
```
The TypeScript code which powers the HTMLWidgets can also be run as a
standalone app using `webpack-dev-server` as follows:
```{bash, eval=FALSE}
yarn run start-dev
```
This will start the webpack dev server, which will automatically recompile and
reload the TypeScript code as changes are made.
The sample data and HTML used by the dev server can be found in `./dev`, and
are loaded in to memory based on the configuration in `webpack/dev.config.ts`
If you wish to make changes to the HTML files in `dev/`, or debug the
`yarn run start-dev` command, you can instead run `yarn run build-dev`.
This will load the files in `dev/` in to a folder called `dev_build/` rather
than in to memory, which can make debugging easier.