Skip to content

Commit

Permalink
Fixes #206 restore vignette image files (#215)
Browse files Browse the repository at this point in the history
Fix suggested from r-lib/pkgdown#1231
  • Loading branch information
pchelle committed Jan 26, 2022
1 parent 6434184 commit fe4eac2
Show file tree
Hide file tree
Showing 32 changed files with 34 additions and 30 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
34 changes: 18 additions & 16 deletions vignettes/plot-maker.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: "plot-maker"
resource_files:
- figures
author: "OSPSuiteR 2021"
output:
rmarkdown::html_vignette:
Expand Down Expand Up @@ -36,7 +38,7 @@ The aim of this vignette is to document how to create plots using the `tlf` user
Use the function `runPlotMaker()` to start the User Interface. The function will load `shiny` required for the UI.

```{r start-plot-maker}
knitr::include_graphics("../man/figures/plot-maker/start-plot-maker.png")
knitr::include_graphics("figures/plot-maker/start-plot-maker.png")
```

# 3. How to import data
Expand All @@ -47,7 +49,7 @@ Data can be directly taken from the global environment if the field **Location**
Note that such variables are required as data.frame if you want to create a plot.

```{r import-env-data}
knitr::include_graphics("../man/figures/plot-maker/import-env-data.png")
knitr::include_graphics("figures/plot-maker/import-env-data.png")
```

Data can also be imported from a file if the field **Location** uses *file*. This will change the field **Variables available in environment** into **Select a file** (figure below).
Expand All @@ -56,7 +58,7 @@ Note that it is possible to use options and skip the first lines of your file an
In the figure below, a variable named *myDataset* was created in the global environment and is listed in the field **Variables available in environment**.

```{r import-file-data}
knitr::include_graphics("../man/figures/plot-maker/import-file-data.png")
knitr::include_graphics("figures/plot-maker/import-file-data.png")
```

When data are imported as illustrated below on the dataset "test-data.csv", the first rows of the dataset are shown on the bottom left side of the UI.
Expand All @@ -66,7 +68,7 @@ The only requirement to use that field is to name the imported data "data".
For instance, if only male adults are selected in the example below, the field **Data Selection** should include *data$AgeBin %in% "Adults" & data$Sex %in% "Male"*.

```{r imported-data}
knitr::include_graphics("../man/figures/plot-maker/imported-data.png")
knitr::include_graphics("figures/plot-maker/imported-data.png")
```

# 4. How to plot the imported data
Expand All @@ -79,30 +81,30 @@ The first steps to plot the data is to select which plot and variables are plott
This is the role of the **Data Mapping** navigation bar (figure below).

```{r data-mapping}
knitr::include_graphics("../man/figures/plot-maker/data-mapping.png")
knitr::include_graphics("figures/plot-maker/data-mapping.png")
```

In the navigation bar **Data Mapping**, users can select from the variable names available in the dataset which should be plotted in *x*, *y* or used to split the data by *color*, *shape*, *linetype*, and *fill* as illustrated below.
Some mappings are not used by all the plots and won't be available if the corresponding plot is currently selected.
Note that if no mapping is wanted for a variable, the corresponding field can be set as **none**.

```{r data-mapping-x}
knitr::include_graphics("../man/figures/plot-maker/data-mapping-x.png")
knitr::include_graphics("figures/plot-maker/data-mapping-x.png")
```

In parallel the field **Select a plot** allows users to choose the advanced plot they want to perform (figure below).
In the list of available plots, the names were chosen as the names of the `tlf` functions used to perform the same plots.

```{r plot-selection}
knitr::include_graphics("../man/figures/plot-maker/plot-selection.png")
knitr::include_graphics("figures/plot-maker/plot-selection.png")
```

The corresponding plot is shown below.
An additional table is added below the PK Ratio plot and shows the measure of number of points within 1.5- and 2-fold errors.
Other plots, such as box-whisker plots, may show similar additional results below the plots.

```{r pk-ratio-plot}
knitr::include_graphics("../man/figures/plot-maker/pk-ratio-plot.png")
knitr::include_graphics("figures/plot-maker/pk-ratio-plot.png")
```

## 4.2. Update plot properties
Expand All @@ -114,29 +116,29 @@ In the **Labels** navigation bar, font properties and content of the most common
The example below highlights the updates of the properties of the watermark which indicates "watermark" instead of "template" written bigger in "goldenrod" color.

```{r plot-labels}
knitr::include_graphics("../man/figures/plot-maker/plot-labels.png")
knitr::include_graphics("figures/plot-maker/plot-labels.png")
```

The **Background** navigation bar includes the properties of the fill, colors, sizes and linetypes for each background elements.
The example below highlights the updates of the properties of the plot area (area around the panel) which was filled with "aliceblue" color and uses a "solid" and "black" border.

```{r plot-background}
knitr::include_graphics("../man/figures/plot-maker/plot-background.png")
knitr::include_graphics("figures/plot-maker/plot-background.png")
```

The **Axes** navigation bar includes the properties of the axes lines (colors, sizes and linetypes), the font properties of their ticks as well as their scales and limits.
The example below highlights the updates of Y-axis scale in which new limits were defined as `ymin=0.1` and `ymax=10`.
Note that limits are taken into account only if both `ymin` and `ymax` values are used.

```{r plot-axes}
knitr::include_graphics("../man/figures/plot-maker/plot-axes.png")
knitr::include_graphics("figures/plot-maker/plot-axes.png")
```

The **Legend** navigation bar includes the properties of the position of the legend (figure below).
Fonts and background are not yet accounted for in the current version of `runPlotMaker()`.

```{r plot-legend}
knitr::include_graphics("../man/figures/plot-maker/plot-legend.png")
knitr::include_graphics("figures/plot-maker/plot-legend.png")
```

The **Aesthetics** navigation bar defines how **points**, **lines**, **ribbons** and **errorbars** are plotted.
Expand All @@ -145,7 +147,7 @@ Any other value will be used as is to define how **points**, **lines**, **ribbon
The example below highlights the updates of how lines are plotted in this PK Ratio plot. Lines are now all in "#000000" (black) color using the concept of theme for their linetype (theme map for linetype is solid, then longdash, then dotted line...).

```{r plot-aesthetics}
knitr::include_graphics("../man/figures/plot-maker/plot-aesthetics.png")
knitr::include_graphics("figures/plot-maker/plot-aesthetics.png")
```

# 5. Save/export a plot
Expand All @@ -158,7 +160,7 @@ The R code to re-create such an object with the same properties is available in
Users can either copy/paste or save such R code.

```{r plot-export}
knitr::include_graphics("../man/figures/plot-maker/plot-export.png")
knitr::include_graphics("figures/plot-maker/plot-export.png")
```

# 6. Plot-specific properties
Expand All @@ -169,7 +171,7 @@ If *plotObsVsPred* or *plotResVsPred* is selected in **Select a plot**, you can
The regression *lm* stands for *linear model* and will add a linear regression to the plot; while *loess* will perform and add a loess regression to the plot.

```{r plot-regression}
knitr::include_graphics("../man/figures/plot-maker/plot-regression.png")
knitr::include_graphics("figures/plot-maker/plot-regression.png")
```

## 6.1. Tornado plot
Expand All @@ -180,5 +182,5 @@ If *plotTornado* is selected in **Select a plot**, two optional fields are avail
- The field **Sort by x variable** allows you to choose if the values should be sorted by the absolute value of *x* or used as is.

```{r plot-tornado}
knitr::include_graphics("../man/figures/plot-maker/plot-tornado.png")
knitr::include_graphics("figures/plot-maker/plot-tornado.png")
```
30 changes: 16 additions & 14 deletions vignettes/theme-maker.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: "theme-maker"
resource_files:
- figures
author: "OSPSuiteR 2021"
output:
rmarkdown::html_vignette:
Expand Down Expand Up @@ -36,7 +38,7 @@ The aim of this vignette is to document how to create, update, and save `Theme`
Use the function `runThemeMaker()` to start the theme-maker User Interface. The function will load `shiny` required for the UI and set the current theme defined by the UI.

```{r start-theme-maker}
knitr::include_graphics("../man/figures/theme-maker/start-theme-maker.png")
knitr::include_graphics("figures/theme-maker/start-theme-maker.png")
```

# 3. How to update theme properties
Expand All @@ -47,27 +49,27 @@ In the **Labels** navigation bar (already available when starting the UI), font
Note that *Color* properties use a predefined list of available colors as illustrated in the figure below, however, users can type and add their own colors (e.g. hex colors).

```{r theme-labels}
knitr::include_graphics("../man/figures/theme-maker/labels.png")
knitr::include_graphics("figures/theme-maker/labels.png")
```

Properties of the watermark are available in the **Labels** navigation bar, and include the field *Content* which allows to define the content of the watermark (in this example the content is *template*).

The **Background** navigation bar includes the properties of the colors, sizes, and linetypes for each background elements (illustrated below).

```{r theme-background}
knitr::include_graphics("../man/figures/theme-maker/background.png")
knitr::include_graphics("figures/theme-maker/background.png")
```

The **Axes** navigation bar includes the properties of the axes lines (colors, sizes and linetypes) as well as the font properties of their ticks (illustrated below).

```{r theme-axes}
knitr::include_graphics("../man/figures/theme-maker/axes.png")
knitr::include_graphics("figures/theme-maker/axes.png")
```

The **Legend** navigation bar includes the properties of the position, fonts, and background of the legend (illustrated below).

```{r theme-legend}
knitr::include_graphics("../man/figures/theme-maker/legend.png")
knitr::include_graphics("figures/theme-maker/legend.png")
```

The **Aesthetic Maps** navigation bar defines the maps of aesthetic properties (color, fill, linetype, shape, size and alpha).
Expand All @@ -82,32 +84,32 @@ First, select *plotPKRatio* in the list of sample plots to check the current fea
The list of sample plots available in the UI corresponds to all the atom and molecule plot functions defined in the `tlf` package.

```{r sample-plots}
knitr::include_graphics("../man/figures/theme-maker/sample-plots.png")
knitr::include_graphics("figures/theme-maker/sample-plots.png")
```

Then, the **Aesthetic Maps** indicates for each aesthetic property pairs of rank-value for the aesthetic map. The current color map defines *30078D7* (blue color).

```{r aes-map}
knitr::include_graphics("../man/figures/theme-maker/aes-map.png")
knitr::include_graphics("figures/theme-maker/aes-map.png")
```

The values can be changed as illustrated below where color ranked 1 was set as *salmon* and color ranked 2 was set as *dodgerblue*.

```{r aes-map-set}
knitr::include_graphics("../man/figures/theme-maker/aes-map-set.png")
knitr::include_graphics("figures/theme-maker/aes-map-set.png")
```

On the **Plot Configurations** navigation bar, select the *plotPKRatio* (figure below). Three selection keys are available for this plot as it includes points, lines and optionally error bars.
The current selection key is **reset** which resets and uses in sequence the values of the color map.

```{r pk-ratio-color}
knitr::include_graphics("../man/figures/theme-maker/pk-ratio-color.png")
knitr::include_graphics("figures/theme-maker/pk-ratio-color.png")
```

The example below updates how the lines are drawn in the PK ratio plots. Currently, the selection key is defined as **Other** and the corresponding value has *longdash* which is translated as the PK ratio lines are all plotted as long dashes:

```{r pk-ratio-linetype}
knitr::include_graphics("../man/figures/theme-maker/pk-ratio-linetype.png")
knitr::include_graphics("figures/theme-maker/pk-ratio-linetype.png")
```

To update how lines are drawn in PK ratio plots, you can use a default linetype in the selection key **Other** or use the linetype map defined in the **Aesthetic Maps** navigation bar. Different keys are available when using the map:
Expand All @@ -119,13 +121,13 @@ To update how lines are drawn in PK ratio plots, you can use a default linetype
- **other** allows you to specify a user defined lineytpe(s) not related to the map

```{r pk-ratio-selection-key}
knitr::include_graphics("../man/figures/theme-maker/pk-ratio-selection-key.png")
knitr::include_graphics("figures/theme-maker/pk-ratio-selection-key.png")
```

By selecting *next*, the PK ratio plot uses the next value in the linetype map every time a line is added. In this example, this leads to draw the ratio of 1 as a solid line, the ratio of 1.5 as a longdash line and the ratio of 2 as a dotted line.

```{r pk-ratio-linetype-next}
knitr::include_graphics("../man/figures/theme-maker/pk-ratio-linetype-next.png")
knitr::include_graphics("figures/theme-maker/pk-ratio-linetype-next.png")
```


Expand All @@ -137,11 +139,11 @@ To save your current theme using the UI, click on **Download theme .json** as il
Please remember to specify the **.json** file extension while saving the theme to a file.

```{r save-theme}
knitr::include_graphics("../man/figures/theme-maker/save-theme.png")
knitr::include_graphics("figures/theme-maker/save-theme.png")
```

The UI also allows you to load a previously saved theme in `.json` file using the button **Load a Theme from Json** as illustrated in the figure below.

```{r use-saved-theme}
knitr::include_graphics("../man/figures/theme-maker/use-saved-theme.png")
knitr::include_graphics("figures/theme-maker/use-saved-theme.png")
```

0 comments on commit fe4eac2

Please sign in to comment.