Skip to content

Commit 8a896e2

Browse files
authored
release 0.7.2
* first open-source release
1 parent e6f369b commit 8a896e2

File tree

10 files changed

+54
-24
lines changed

10 files changed

+54
-24
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: gridify
33
Title: Enrich Figures and Tables with Custom Headers and Footers and More
4-
Version: 0.7.1.9000
4+
Version: 0.7.2
55
Authors@R: c(
66
person("Maciej", "Nasinski", , "Maciej.Nasinski@ucb.com", role = c("aut", "cre")),
77
person("Alexandra", "Wall", , "Alexandra.Wall@ucb.com", role = "aut"),

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# gridify 0.7.1.9000
1+
# gridify 0.7.2
22

33
* First open-source release.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# gridify <img src="man/figures/logo.png" align="right" height="auto" width="300" />
1+
# gridify <img src="man/figures/logo.png" alt="gridify logo" align="right" height="auto" width="300" />
22

33
[![R-CMD-check](https://github.com/pharmaverse/gridify/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pharmaverse/gridify/actions/workflows/R-CMD-check.yaml)
44
[![Codecov test coverage](https://codecov.io/gh/pharmaverse/gridify/graph/badge.svg)](https://app.codecov.io/gh/pharmaverse/gridify)
@@ -101,7 +101,7 @@ gridify_object_fill
101101
print(gridify_object_fill)
102102
```
103103

104-
<img src="man/figures/README-example-1.png" width="100%" />
104+
<img src="man/figures/README-example-1.png" alt="Example of gridify output" width="100%" />
105105

106106
Note: Get the image using
107107
`export_to(gridify_object_fill, to = "mypng.png", res = 300, width = 2300, height = 1900)`
@@ -143,4 +143,4 @@ By contributing to this project, you agree to abide by its terms.
143143

144144
Along with the authors and contributors, thanks to the following people for their support:
145145

146-
Alberto Montironi, Jonathan Bleier, Cynthia McShea, Nils Penard, Oswald Dallimore, Laetitia Lemoine, Richard Abdy
146+
Alberto Montironi, Jonathan Bleier, Cynthia McShea, Nils Penard, Oswald Dallimore, Laetitia Lemoine, Daniel Vicencio Perez, Richard Abdy

_pkgdown.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
url: https://pharmaverse.github.io/gridify
2+
3+
template:
4+
bootstrap: 5
5+
params:
6+
bootswatch: flatly
7+
18
pkgdown:
29
title: "gridify"
310

inst/WORDLIST

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Ncol
1414
Nrow
1515
PatientID
1616
Penard
17+
Perez
1718
Pharmaverse
1819
Qmd
1920
RStudio
@@ -39,3 +40,4 @@ rd
3940
rtables
4041
sprintf
4142
unitType
43+
Vicencio

vignettes/create_custom_layout.Rmd

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ vignette: >
88
%\VignetteIndexEntry{Create Custom Layout}
99
%\VignetteEngine{knitr::rmarkdown}
1010
%\VignetteEncoding{UTF-8}
11+
editor_options:
12+
markdown:
13+
wrap: 72
1114
---
1215

1316
```{r, include = FALSE}
@@ -29,7 +32,7 @@ Please note that creating a custom layout may not be required. It is intended fo
2932

3033
A layout is a grid structure defined by the number of rows and columns which creates spaces or cells where text elements can then be added. Each cell is then defined by the rows and columns it spans.
3134

32-
```{r}
35+
```{r layout-basics}
3336
library(gridify)
3437
# (to use |> version 4.1.0 of R is required, for lower versions we recommend %>% from magrittr)
3538
library(magrittr)
@@ -43,7 +46,7 @@ show_layout(simple_layout())
4346

4447
Here is an example layout. All arguments will be explained below.
4548

46-
```{r}
49+
```{r example-layout}
4750
#| results: hide
4851
4952
new_layout <- gridifyLayout(
@@ -103,7 +106,7 @@ The layout needs to have a margin defined to determine how much space there shou
103106

104107
The margin must be a call to `grid::unit(...)` where a vector with arguments `t`, `r`, `b` and `l` are given values, this is for the top, right, bottom and left margins respectively e.g.
105108

106-
```{r}
109+
```{r margin-argument}
107110
#| eval: false
108111
109112
# a 10% margin on all sides
@@ -116,7 +119,7 @@ The object's location is defined in the `object` argument of `gridifyLayout()`.
116119

117120
The arguments `height` and `width` of `gridifyObject()` determine how much of the space the object should take up within the cell(s) location. The default values are `1`, which is the equivalent of 100% of the width/height of the area.
118121

119-
```{r}
122+
```{r adding-object-argument}
120123
#| eval: false
121124
122125
# an object that spans only row 3 but both columns 1 and 2
@@ -132,26 +135,26 @@ For transparency, this section will explain how the `scales` argument works, and
132135

133136
In the predefined simple and complex layouts, you can choose between `"free"` and `"fixed"` scales. When using `"free"` scales, row heights are proportionally 15%, 70% and 15% of the total area. Conversely, with `"fixed"` scales, row heights are determined by the number of lines required for each text element, with any remaining space allocated to the object.
134137

135-
```{r}
138+
```{r scales-argument-free}
136139
simple_layout(scales = "free")
137140
```
138141

139-
```{r}
142+
```{r show-scales-argument-free}
140143
show_layout(simple_layout(scales = "free"))
141144
```
142145

143-
```{r}
146+
```{r scales-argument-fixed}
144147
simple_layout(scales = "fixed")
145148
```
146149

147-
```{r}
150+
```{r show-scales-argument-fixed}
148151
# As no lines were defined, the object takes up the whole space below
149152
show_layout(simple_layout(scales = "fixed"))
150153
```
151154

152155
Below is an example of how to add scales to a custom layout with options being `npc` or `lines`.
153156

154-
```{r}
157+
```{r how-add-scales-custom-layout}
155158
scales_example_layout <- function(
156159
margin = grid::unit(c(t = 0.1, r = 0.1, b = 0.1, l = 0.1), units = "npc"),
157160
global_gpar = grid::gpar(),
@@ -197,7 +200,7 @@ The cells are the places a user can add their text elements to the output. If a
197200

198201
The cells are created by making a call to `gridifyCells()` which requires named arguments returning calls to `gridifyCell()`. The names of these arguments are the names the user will be referencing when adding text elements to the output so make sure they are named appropriately.
199202

200-
```{r}
203+
```{r adding-cells}
201204
#| eval: false
202205
gridifyCells(
203206
company = gridifyCell(row = 1, col = 2, x = 1, hjust = 1, y = 1, vjust = 1),
@@ -248,7 +251,7 @@ local \> default \> global
248251

249252
Therefore, any graphical parameter can be overwritten by the users in the calls to `set_cell()`.
250253

251-
```{r}
254+
```{r default-graphical-parameters}
252255
#| results: hide
253256
254257
new_layout <- gridifyLayout(
@@ -280,7 +283,7 @@ gridify(
280283

281284
The text element fonts can also be customized easily as per the user requirements.
282285

283-
```{r}
286+
```{r default-graphical-parameters-text}
284287
#| results: hide
285288
286289
new_layout <- gridifyLayout(
@@ -317,7 +320,7 @@ gridify(
317320

318321
The `text` argument of `gridifyCell()` can be used to set the default text for a cell. Please note, the text provided by the end user with `set_cell()` will take higher priority and overwrite the default.
319322

320-
```{r}
323+
```{r default-cell-text}
321324
new_layout <- gridifyLayout(
322325
nrow = 4L,
323326
ncol = 2L,
@@ -348,7 +351,7 @@ gridify(
348351

349352
To add a watermark to your output, create a cell covering the desired rows and columns and set the transparency of the text, the font size large and the rotation to 45 degrees.
350353

351-
```{r}
354+
```{r adding-watermark}
352355
#| results: hide
353356
354357
new_layout <- gridifyLayout(

vignettes/gridify.Rmd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
---
22
title: "Get Started with gridify"
3-
output: rmarkdown::html_vignette
3+
output:
4+
rmarkdown::html_vignette:
5+
toc: true
6+
toc_depth: 4
47
vignette: >
58
%\VignetteIndexEntry{Get Started with gridify}
69
%\VignetteEngine{knitr::rmarkdown}
710
%\VignetteEncoding{UTF-8}
11+
editor_options:
12+
markdown:
13+
wrap: 72
814
---
915

1016
```{r, include = FALSE}
@@ -21,7 +27,7 @@ knitr::opts_chunk$set(
2127
In the pharmaceutical industry, and many other fields that rely heavily on data reporting, there is often a need to create tables and figures with specific text elements — like titles, subtitles, captions, and footnotes — positioned consistently around the output.
2228
Manually arranging these elements can be time-consuming and prone to inconsistencies across projects.
2329

24-
`gridify` addresses this by building on the base R `[grid](https://cran.r-project.org/package=grid)` package, making it easy to add flexible, customizable elements around a plot or table. This ensures a consistent layout for text elements (like headers, footers, etc.) across various output types, such as:
30+
`gridify` addresses this by building on the base R [grid](https://cran.r-project.org/package=grid) package, making it easy to add flexible, customizable elements around a plot or table. This ensures a consistent layout for text elements (like headers, footers, etc.) across various output types, such as:
2531

2632
- `ggplot2` objects
2733
- `flextable` tables

vignettes/multi_page_examples.Rmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
22
title: "Multi-Page and Multi-Figure Examples"
3-
output:
3+
output:
44
rmarkdown::html_vignette:
55
toc: true
66
toc_depth: 4
77
vignette: >
88
%\VignetteIndexEntry{Multi-Page and Multi-Figure Examples}
99
%\VignetteEngine{knitr::rmarkdown}
1010
%\VignetteEncoding{UTF-8}
11+
editor_options:
12+
markdown:
13+
wrap: 72
1114
---
1215

1316
```{r setup, include = FALSE}

vignettes/simple_examples.Rmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ title: "Simple Examples"
33
output:
44
rmarkdown::html_vignette:
55
toc: true
6-
toc_depth: 6
6+
toc_depth: 4
77
vignette: >
88
%\VignetteIndexEntry{Simple Examples}
99
%\VignetteEngine{knitr::rmarkdown}
1010
%\VignetteEncoding{UTF-8}
11+
editor_options:
12+
markdown:
13+
wrap: 72
1114
---
1215

1316
```{r, include = FALSE}

vignettes/transparency.Rmd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
---
22
title: "Transparency with gridify"
3-
output: rmarkdown::html_vignette
3+
output:
4+
rmarkdown::html_vignette:
5+
toc: true
6+
toc_depth: 4
47
vignette: >
58
%\VignetteIndexEntry{Transparency with gridify}
69
%\VignetteEngine{knitr::rmarkdown}
710
%\VignetteEncoding{UTF-8}
11+
editor_options:
12+
markdown:
13+
wrap: 72
814
---
915

1016
```{r, include = FALSE}

0 commit comments

Comments
 (0)