-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
94 lines (63 loc) · 2.12 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
84
85
86
87
88
89
90
91
92
93
94
---
output: rmarkdown::github_document
---
# graffle
An 'OmniGraffle' Graphics Device [WIP]
## Description
A graphics device that produces 'OmniGraffle' documents.
Currently based on the code structure of the 'svglite' package.
## What's Inside The Tin
The following functions are implemented:
- `graffle`: A graphics device that produces 'OmniGraffle' documents
## NOTE
This is a WIP but it may still be useful to some folks. The pacakge (perhaps somewhat obviously) requires that you have OmniGraffle installed.
It also requires that you have it open and — for the moment — have at least one document window open. It relies on the [Omni Automation API](https://omni-automation.com/omnigraffle/) and "draws" directly in a new document.
Eventually it will not be necessary to have OmniGraffle already open or also have a document open to make this work.
Since it's instrumenting an application to draw, it's also not super-speedy. Yay for closed document formats?
## TODO
- Fix need to have OG up and an existing or new doc open
- Text/fonts
- Tests
## Installation
```{r eval=FALSE}
devtools::install_git("https://git.sr.ht/~hrbrmstr/graffle")
# OR
devtools::install_gitlab("hrbrmstr/graffle")
# OF
devtools::install_github("hrbrmstr/graffle")
```
```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```
## Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
library(graffle)
# current verison
packageVersion("graffle")
```
### Base graphics
```{r eval=FALSE}
graffle()
plot(
cars, main = "Stopping Distance versus Speed",
col = "red", cex = 3
)
lines(stats::lowess(cars), col = "blue")
dev.off()
```
![](man/figures/base-graphics.gif)
### ggplot2
```{r eval=FALSE}
graffle()
ggplot(mpg, aes(displ, hwy)) +
geom_point(aes(color = drv)) +
facet_wrap(vars(cyl, drv))
dev.off()
```
![](man/figures/ggplot2-example.gif)
## `graffle` Metrics
```{r cloc, echo=FALSE}
cloc::cloc_pkg_md()
```
## Code of Conduct
Please note that the 'graffle' project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.