From 14e234cd3d0500dea0748d2118991bad44ef4d3c Mon Sep 17 00:00:00 2001 From: Mason Garrison <6001608+smasongarrison@users.noreply.github.com> Date: Sat, 3 Jan 2026 15:31:41 -0500 Subject: [PATCH 1/3] add other rendering of emoji --- vignettes/articles/emoji_preview.png | Bin 0 -> 7917 bytes vignettes/articles/v02_configuration.Rmd | 15 +++++++++------ vignettes/v00_plots.Rmd | 2 +- vignettes/v00_plots.html | 13 +++++++------ 4 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 vignettes/articles/emoji_preview.png diff --git a/vignettes/articles/emoji_preview.png b/vignettes/articles/emoji_preview.png new file mode 100644 index 0000000000000000000000000000000000000000..5e512dfd3ab6041b0ae4887cb411dc581e733327 GIT binary patch literal 7917 zcmeHs2{e@N+y7ujgM@5FX{^~vN{zzEHV9c8Woa>%h&0)k3@Sz0g&9VXofuRMlI*D= z6hafSWnU)3^FCAG->>iY`}_U>?|IL8&wI{$&U?=NJlB0a_qE*1_1w?rzMd#E6Mas0 zA$AA^!ihG}F^52yNe~FrXE+P^j|tRW#- zBr+BmJBSio!2WE;LaSNC^KFvGhQvjfrVZMK2HV9W)&7vsqF@D6ktFLdFSx^SyqxQ(t&@%)1PM>=!`mpe+3ev&4IWyt;$8ZE~!5noM<2Rep%OwzGvjRnj~7 zkHB;*6e_r-JtEB#ZCzNBr8>7~M?}iop7i(oW1X?SKFc+w9eXGl!MhIo`Xrq8bLe1t z=~zS&h9KDB?9r@v=Eq^Amo5ltWubr1o)MoMomy;~^2|I>JRZD3CSNx+7cyhtb8|Op zP|*FseBC+@i>*+}iDDmf4*z_>`F_SKm|PJ89C{eVTAk=?)*E6RXsQJlTG1u>kL4I}~pEUb{3COc@&a_IVAYi@ zBHUBftR|^C>Dx7-{JPC6#RHgJATqoikM^@j6c@F$PH`DO=y^(XGupVV$$xuj{@ z@31N5!$LfduH%yyV8d4>+X%(v1_Q2g_UQ{TH2l`~!L{#cfSu`zy(CwFL!)JK4Md(xE&9=bi9_;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mV?d00001 diff --git a/vignettes/articles/v02_configuration.Rmd b/vignettes/articles/v02_configuration.Rmd index b9207e49..0e30d82b 100644 --- a/vignettes/articles/v02_configuration.Rmd +++ b/vignettes/articles/v02_configuration.Rmd @@ -24,9 +24,7 @@ library(viridis) # viridis for color palettes library(tidyverse) # for data wrangling ``` -Every gg-based plotting function in `{ggpedigree}` accepts a `config` argument. - -This is an easier way to control plot behavior without rewriting the plotting code. +Every gg-based plotting function in `{ggpedigree}` accepts a `config` argument. This is an easier way to control plot behavior without rewriting the plotting code. A `config` is a named list. Each element corresponds to one plotting, layout, or aesthetic option. You pass the list to the plotting function and the plot is drawn using those values. @@ -77,7 +75,7 @@ ggPedigree( config = list( code_male = 1, code_female = 2, - code_unknown = 0 + code_unknown = 3 ) ) @@ -293,7 +291,7 @@ plot_ped <- ggPedigree( sex_shape_male = "🚗" ) ) -plot_ped + ggplot2::ggsave( filename = "custom_sex_emoji_pedigree.png", plot = plot_ped, @@ -303,10 +301,15 @@ ggplot2::ggsave( ) ``` -Note that when using emoji shapes, it is best to use `ggsave()` to save the plot to a file, as some R graphics devices may not render emoji correctly. Notice how the emoji shapes appear in the saved PNG file below compares to the image rendered above, which may vary because of differences in font rendering. + +![](emoji_preview.png){width="7in" height="5in"} + +Note that when using emoji shapes, it is best to use `ggsave()` to save the plot to a file, as some R graphics devices may render emoji differently. Notice how the emoji shapes appear in the saved PNG file below compares to the image rendered during the preview above. These may vary because of differences in font rendering. ![](custom_sex_emoji_pedigree.png){width="7in" height="5in"} + + ## 5) Affected status overlay Affected status behavior is controlled by keys such as: diff --git a/vignettes/v00_plots.Rmd b/vignettes/v00_plots.Rmd index 953479f2..a28392ec 100644 --- a/vignettes/v00_plots.Rmd +++ b/vignettes/v00_plots.Rmd @@ -377,4 +377,4 @@ p + # Advanced Examples: Large Pedigrees with self-loops -Additional examples are provided as articles that demonstrate more complex pedigree plots. You can find these on the [ggpedigree website](https://r-computing-lab.github.io/ggpedigree/). These articles cover advanced topics such as: multiple families, self-loops, and other advanced features. +Additional examples are available in the online documentation to keep the package file size reasonable. These are provided as articles that demonstrate more complex pedigree plots. You can find these on the [ggpedigree website](https://r-computing-lab.github.io/ggpedigree/). These articles cover advanced topics such as: multiple families, self-loops, and other advanced features. diff --git a/vignettes/v00_plots.html b/vignettes/v00_plots.html index 0f805147..14370629 100644 --- a/vignettes/v00_plots.html +++ b/vignettes/v00_plots.html @@ -436,8 +436,8 @@

Customizing Aesthetics

) + theme_bw(base_size = 12) + scale_colour_brewer(palette = "Set2") #> Scale for colour is already present. -#> Adding another scale for colour, which will replace the -#> existing scale. +#> Adding another scale for colour, which will replace +#> the existing scale.

This can be particularly useful for matching house styles in academic publications or removing clutter for presentations.

@@ -716,14 +716,15 @@

Adjusting Plot Appearance

labels = c("Female", "Male", "Unknown") ) #> Scale for colour is already present. -#> Adding another scale for colour, which will replace the -#> existing scale. +#> Adding another scale for colour, which will replace +#> the existing scale.

Advanced Examples: Large Pedigrees with self-loops

-

Additional examples are provided as articles that demonstrate more -complex pedigree plots. You can find these on the ggpedigree +

Additional examples are available in the online documentation to keep +the package file size reasonable. These are provided as articles that +demonstrate more complex pedigree plots. You can find these on the ggpedigree website. These articles cover advanced topics such as: multiple families, self-loops, and other advanced features.

From 85b77ed1a6027f32d0d8090962823555f239a036 Mon Sep 17 00:00:00 2001 From: Mason Garrison <6001608+smasongarrison@users.noreply.github.com> Date: Sat, 3 Jan 2026 15:42:12 -0500 Subject: [PATCH 2/3] renaming --- ...ion.Rmd => v11_configuration_extended.Rmd} | 4 +- ...s.Rmd => v21_extendedinteractiveplots.Rmd} | 0 ...ydegree.Rmd => v31_phenotypicbydegree.Rmd} | 0 ...exity.Rmd => v32_plots_morecomplexity.Rmd} | 0 vignettes/v10_configuration.R | 28 ++ vignettes/v10_configuration.Rmd | 101 ++++ vignettes/v10_configuration.html | 453 ++++++++++++++++++ ...eractiveplots.R => v20_interactiveplots.R} | 0 ...tiveplots.Rmd => v20_interactiveplots.Rmd} | 0 ...veplots.html => v20_interactiveplots.html} | 0 vignettes/{v20_matrix.R => v30_matrix.R} | 0 vignettes/{v20_matrix.Rmd => v30_matrix.Rmd} | 0 .../{v20_matrix.html => v30_matrix.html} | 0 13 files changed, 584 insertions(+), 2 deletions(-) rename vignettes/articles/{v02_configuration.Rmd => v11_configuration_extended.Rmd} (99%) rename vignettes/articles/{v11_extendedinteractiveplots.Rmd => v21_extendedinteractiveplots.Rmd} (100%) rename vignettes/articles/{v21_phenotypicbydegree.Rmd => v31_phenotypicbydegree.Rmd} (100%) rename vignettes/articles/{v22_plots_morecomplexity.Rmd => v32_plots_morecomplexity.Rmd} (100%) create mode 100644 vignettes/v10_configuration.R create mode 100644 vignettes/v10_configuration.Rmd create mode 100644 vignettes/v10_configuration.html rename vignettes/{v10_interactiveplots.R => v20_interactiveplots.R} (100%) rename vignettes/{v10_interactiveplots.Rmd => v20_interactiveplots.Rmd} (100%) rename vignettes/{v10_interactiveplots.html => v20_interactiveplots.html} (100%) rename vignettes/{v20_matrix.R => v30_matrix.R} (100%) rename vignettes/{v20_matrix.Rmd => v30_matrix.Rmd} (100%) rename vignettes/{v20_matrix.html => v30_matrix.html} (100%) diff --git a/vignettes/articles/v02_configuration.Rmd b/vignettes/articles/v11_configuration_extended.Rmd similarity index 99% rename from vignettes/articles/v02_configuration.Rmd rename to vignettes/articles/v11_configuration_extended.Rmd index 0e30d82b..0041481d 100644 --- a/vignettes/articles/v02_configuration.Rmd +++ b/vignettes/articles/v11_configuration_extended.Rmd @@ -1,8 +1,8 @@ --- -title: "Extended: Using `config` to control ggpedigree plots" +title: "Extended: More uses of `config` to control ggpedigree plots" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Extended: Using config to control ggpedigree plots} + %\VignetteIndexEntry{Extended: More uses of config to control ggpedigree plots} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/articles/v11_extendedinteractiveplots.Rmd b/vignettes/articles/v21_extendedinteractiveplots.Rmd similarity index 100% rename from vignettes/articles/v11_extendedinteractiveplots.Rmd rename to vignettes/articles/v21_extendedinteractiveplots.Rmd diff --git a/vignettes/articles/v21_phenotypicbydegree.Rmd b/vignettes/articles/v31_phenotypicbydegree.Rmd similarity index 100% rename from vignettes/articles/v21_phenotypicbydegree.Rmd rename to vignettes/articles/v31_phenotypicbydegree.Rmd diff --git a/vignettes/articles/v22_plots_morecomplexity.Rmd b/vignettes/articles/v32_plots_morecomplexity.Rmd similarity index 100% rename from vignettes/articles/v22_plots_morecomplexity.Rmd rename to vignettes/articles/v32_plots_morecomplexity.Rmd diff --git a/vignettes/v10_configuration.R b/vignettes/v10_configuration.R new file mode 100644 index 00000000..80189282 --- /dev/null +++ b/vignettes/v10_configuration.R @@ -0,0 +1,28 @@ +## ----setup, include=FALSE----------------------------------------------------- +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.width = 7, + fig.height = 5 +) + +## ----libraries, message=FALSE, warning=FALSE---------------------------------- +library(ggpedigree) # ggPedigree lives here +library(BGmisc) # helper utilities & example data +library(ggplot2) # ggplot2 for plotting +library(viridis) # viridis for color palettes +library(tidyverse) # for data wrangling + +## ----------------------------------------------------------------------------- +library(BGmisc) +data("potter") + +## ----------------------------------------------------------------------------- +ggPedigree( + potter, + famID = "famID", + personID = "personID", + momID = "momID", + dadID = "dadID" +) + diff --git a/vignettes/v10_configuration.Rmd b/vignettes/v10_configuration.Rmd new file mode 100644 index 00000000..ecc5ab47 --- /dev/null +++ b/vignettes/v10_configuration.Rmd @@ -0,0 +1,101 @@ +--- +title: "Using config to control ggpedigree plots" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Using config to control ggpedigree plots} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.width = 7, + fig.height = 5 +) +``` + +```{r libraries, message=FALSE, warning=FALSE} +library(ggpedigree) # ggPedigree lives here +library(BGmisc) # helper utilities & example data +library(ggplot2) # ggplot2 for plotting +library(viridis) # viridis for color palettes +library(tidyverse) # for data wrangling +``` + +This vignette demonstrates how to use the `config` argument to control the behavior of pedigree plots in the `{ggpedigree}` package. + +Every gg-based plotting function in `{ggpedigree}` accepts a `config` argument. A `config` is a named list. Each element corresponds to one plotting, layout, or aesthetic option. You pass the list to the plotting function and the plot is drawn using those values. + +You do not need to supply every option. You only provide the options you want to change. Any options you do not specify will use the package defaults. You can see a full list of supported options and their defaults by reviewing the documentation for `getDefaultPlotConfig()`. + +This vignette demonstrates how `config` is used in practice. An extended list of all available options is provided in the online documentation. + +# Basic usage of `config` in `ggPedigree()` + +We will use the `potter` pedigree dataset bundled in `{BGmisc}`. + +```{r} +library(BGmisc) +data("potter") +``` + +A basic pedigree plot uses defaults: + +```{r} +ggPedigree( + potter, + famID = "famID", + personID = "personID", + momID = "momID", + dadID = "dadID" +) +``` + +## Sex coding: `code_male` and `code_female` + +`ggPedigree()` (and other ggpedigree plots that use sex) need to know how sex is encoded in your data so they can assign the correct **shapes** (and optionally **colors**) for female, male, and unknown. + +The `code_male` and `code_female` config options define which values in your sex column should be treated as male vs female. The defaults assume: + +- `code_female = 0` +- `code_male = 1` + +If your dataset uses different codes (for example `1/2` or `"M"/"F"`), override these in `config`. + +``` r +# Example: sex coded as 1 = male, 2 = female +ggPedigree( + ped, + famID = "famID", + personID = "personID", + momID = "momID", + dadID = "dadID", + config = list( + code_male = 1, + code_female = 2, + code_unknown = 3 + ) +) + +# Example: sex coded as "M" / "F" +ggPedigree( + ped, + famID = "famID", + personID = "personID", + momID = "momID", + dadID = "dadID", + config = list( + code_male = "M", + code_female = "F" + ) +) +``` + +Once the sex codes are interpreted correctly, the plot uses the corresponding shape settings (`sex_shape_female`, `sex_shape_male`, `sex_shape_unknown`) and, when enabled, sex-based coloring (`sex_color_include`, `sex_color_palette`). + + +# Advanced Examples + +Additional examples are available in the online documentation to keep the package file size reasonable. These are provided as articles that demonstrate more complex pedigree plots. You can find these on the [ggpedigree website](https://r-computing-lab.github.io/ggpedigree/). diff --git a/vignettes/v10_configuration.html b/vignettes/v10_configuration.html new file mode 100644 index 00000000..4be034df --- /dev/null +++ b/vignettes/v10_configuration.html @@ -0,0 +1,453 @@ + + + + + + + + + + + + + + +Using config to control ggpedigree plots + + + + + + + + + + + + + + + + + + + + + + + + + + +

Using config to control ggpedigree +plots

+ + + +
library(ggpedigree) # ggPedigree lives here
+library(BGmisc) # helper utilities & example data
+library(ggplot2) # ggplot2 for plotting
+library(viridis) # viridis for color palettes
+library(tidyverse) # for data wrangling
+

This vignette demonstrates how to use the config +argument to control the behavior of pedigree plots in the +{ggpedigree} package.

+

Every gg-based plotting function in {ggpedigree} accepts +a config argument. A config is a named list. +Each element corresponds to one plotting, layout, or aesthetic option. +You pass the list to the plotting function and the plot is drawn using +those values.

+

You do not need to supply every option. You only provide the options +you want to change. Any options you do not specify will use the package +defaults. You can see a full list of supported options and their +defaults by reviewing the documentation for +getDefaultPlotConfig().

+

This vignette demonstrates how config is used in +practice. An extended list of all available options is provided in the +online documentation.

+
+

Basic usage of config in ggPedigree()

+

We will use the potter pedigree dataset bundled in +{BGmisc}.

+
library(BGmisc)
+data("potter")
+

A basic pedigree plot uses defaults:

+
ggPedigree(
+  potter,
+  famID = "famID",
+  personID = "personID",
+  momID = "momID",
+  dadID = "dadID"
+)
+

+
+

Sex coding: code_male and code_female

+

ggPedigree() (and other ggpedigree plots that use sex) +need to know how sex is encoded in your data so they can assign the +correct shapes (and optionally colors) +for female, male, and unknown.

+

The code_male and code_female config +options define which values in your sex column should be treated as male +vs female. The defaults assume:

+
    +
  • code_female = 0
  • +
  • code_male = 1
  • +
+

If your dataset uses different codes (for example 1/2 or +"M"/"F"), override these in config.

+
# Example: sex coded as 1 = male, 2 = female
+ggPedigree(
+  ped,
+  famID = "famID",
+  personID = "personID",
+  momID = "momID",
+  dadID = "dadID",
+  config = list(
+    code_male = 1,
+    code_female = 2,
+    code_unknown = 3
+  )
+)
+
+# Example: sex coded as "M" / "F"
+ggPedigree(
+  ped,
+  famID = "famID",
+  personID = "personID",
+  momID = "momID",
+  dadID = "dadID",
+  config = list(
+    code_male = "M",
+    code_female = "F"
+  )
+)
+

Once the sex codes are interpreted correctly, the plot uses the +corresponding shape settings (sex_shape_female, +sex_shape_male, sex_shape_unknown) and, when +enabled, sex-based coloring (sex_color_include, +sex_color_palette).

+
+
+
+

Advanced Examples

+

Additional examples are available in the online documentation to keep +the package file size reasonable. These are provided as articles that +demonstrate more complex pedigree plots. You can find these on the ggpedigree +website.

+
+ + + + + + + + + + + diff --git a/vignettes/v10_interactiveplots.R b/vignettes/v20_interactiveplots.R similarity index 100% rename from vignettes/v10_interactiveplots.R rename to vignettes/v20_interactiveplots.R diff --git a/vignettes/v10_interactiveplots.Rmd b/vignettes/v20_interactiveplots.Rmd similarity index 100% rename from vignettes/v10_interactiveplots.Rmd rename to vignettes/v20_interactiveplots.Rmd diff --git a/vignettes/v10_interactiveplots.html b/vignettes/v20_interactiveplots.html similarity index 100% rename from vignettes/v10_interactiveplots.html rename to vignettes/v20_interactiveplots.html diff --git a/vignettes/v20_matrix.R b/vignettes/v30_matrix.R similarity index 100% rename from vignettes/v20_matrix.R rename to vignettes/v30_matrix.R diff --git a/vignettes/v20_matrix.Rmd b/vignettes/v30_matrix.Rmd similarity index 100% rename from vignettes/v20_matrix.Rmd rename to vignettes/v30_matrix.Rmd diff --git a/vignettes/v20_matrix.html b/vignettes/v30_matrix.html similarity index 100% rename from vignettes/v20_matrix.html rename to vignettes/v30_matrix.html From 555b75153a81e97b50f116fa1224bf85c5075547 Mon Sep 17 00:00:00 2001 From: Mason Garrison <6001608+smasongarrison@users.noreply.github.com> Date: Sat, 3 Jan 2026 16:24:17 -0500 Subject: [PATCH 3/3] Update NEWS and clarify vignette introduction Updated NEWS.md to mention two vignettes for ggpedigree configuration options. Improved clarity in the introduction of the extended configuration vignette by referencing previous explanations and rephrasing dataset usage. --- NEWS.md | 2 +- vignettes/articles/v11_configuration_extended.Rmd | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 91ef87d4..2cc47a74 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,7 +17,7 @@ * Added automatic point scaling based on pedigree size. * Added optional segment size scaling based on pedigree size. * Hid the Sex key by default in `ggpedigree`. -* Added a vignette describing `ggpedigree` configuration options. +* Added two vignettes describing `ggpedigree` configuration options. ## Validation and messages * Performed required-column checks earlier in `ggpedigree()`, including `sex`. diff --git a/vignettes/articles/v11_configuration_extended.Rmd b/vignettes/articles/v11_configuration_extended.Rmd index 0041481d..1dcb06bd 100644 --- a/vignettes/articles/v11_configuration_extended.Rmd +++ b/vignettes/articles/v11_configuration_extended.Rmd @@ -26,15 +26,14 @@ library(tidyverse) # for data wrangling Every gg-based plotting function in `{ggpedigree}` accepts a `config` argument. This is an easier way to control plot behavior without rewriting the plotting code. -A `config` is a named list. Each element corresponds to one plotting, layout, or aesthetic option. You pass the list to the plotting function and the plot is drawn using those values. +As already discussed, a `config` is a named list. Each element corresponds to one plotting, layout, or aesthetic option. You pass the list to the plotting function and the plot is drawn using those values. You do not need to supply every option. You only provide the options you want to change. Any options you do not specify will use the package defaults. You can see a full list of supported options and their defaults by reviewing the documentation for `getDefaultPlotConfig()`. -This vignette demonstrates how `config` is used in practice. # Basic usage of `config` in `ggPedigree()` -We will use the `potter` pedigree dataset bundled in `{BGmisc}`. +As before, we will use the `potter` pedigree dataset bundled in `{BGmisc}`. ```{r} library(BGmisc)