Browse Source

textbox_simple and margin tweaks

master
boB Rudis 7 months ago
parent
commit
8f8b1f098d
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 4
      DESCRIPTION
  2. 4
      NEWS.md
  3. 87
      R/finish-theme.R
  4. 2
      R/theme-gs.R
  5. 2
      R/theme-inter.R
  6. 2
      R/theme-rc.R
  7. 4
      README.md
  8. 2
      man/theme_gs.Rd
  9. 2
      man/theme_inter.Rd
  10. 2
      man/theme_rc.Rd

4
DESCRIPTION

@ -2,8 +2,8 @@ Package: hrbragg
Type: Package
Title: Typography-centric Themes, Theme Components, and Utilities
for 'ggplot2' and 'ragg'.
Version: 0.2.1
Date: 2021-05-20
Version: 0.2.2
Date: 2021-07-10
Authors@R: c(
person(
given = "Bob",

4
NEWS.md

@ -1,2 +1,6 @@
0.2.2
* title/subtitle/caption are now `ggtext::element_textbox_simple()`
* minor margin tweaks
0.1.0
* Initial release

87
R/finish-theme.R

@ -166,43 +166,69 @@ finish_theme <- function(base_size,
theme(
axis.title = element_text(
size = axis_title_size,
family = axis_title_family, lineheight = line_height
family = axis_title_family,
lineheight = line_height,
margin = margin(t = axis_title_size/2)
),
axis.title.x = element_text(
hjust = xj, size = axis_title_size,
family = axis_title_family, lineheight = line_height
family = axis_title_family,
lineheight = line_height
),
axis.title.x.top = element_text(
hjust = xj, size = axis_title_size,
family = axis_title_family, lineheight = line_height
hjust = xj,
size = axis_title_size,
family = axis_title_family, lineheight = line_height,
margin = margin(b = axis_title_size/2)
),
axis.title.x.bottom = element_text(
hjust = xj, size = axis_title_size,
family = axis_title_family, lineheight = line_height
hjust = xj,
size = axis_title_size,
family = axis_title_family,
lineheight = line_height,
margin = margin(t = axis_title_size/2)
),
axis.title.y = element_text(
hjust = yj, size = axis_title_size,
family = axis_title_family, lineheight = line_height
hjust = yj,
size = axis_title_size,
family = axis_title_family,
lineheight = line_height,
margin = margin(r = axis_title_size/2)
),
axis.title.y.left = element_text(
hjust = yj, size = axis_title_size,
family = axis_title_family, lineheight = line_height
hjust = yj,
size = axis_title_size,
family = axis_title_family,
lineheight = line_height,
margin = margin(r = axis_title_size/2)
),
axis.title.y.right = element_text(
hjust = yj, size = axis_title_size, angle = 90,
family = axis_title_family, lineheight = line_height
hjust = yj,
size = axis_title_size,
angle = 90,
family = axis_title_family,
lineheight = line_height,
margin = margin(l = axis_title_size/2)
),
strip.placement = strip_placement,
strip.text = element_text(
hjust = 0, size = strip_text_size, color = foreground_colour,
family = strip_text_family, lineheight = line_height
hjust = 0,
size = strip_text_size,
color = foreground_colour,
family = strip_text_family,
lineheight = line_height,
margin = margin(b = strip_text_size/2)
),
strip.text.x = element_text(
hjust = 0, size = strip_text_size, color = foreground_colour,
family = strip_text_family, lineheight = line_height
hjust = 0,
size = strip_text_size,
color = foreground_colour,
family = strip_text_family,
lineheight = line_height,
margin = margin(b = strip_text_size/2)
),
strip.background = element_rect(
fill = background_colour, color = NA
@ -214,25 +240,36 @@ finish_theme <- function(base_size,
fill = background_colour, color = NA
),
strip.text.y = element_text(
hjust = 0, size = strip_text_size, color = foreground_colour,
family = strip_text_family, lineheight = line_height
hjust = 0,
size = strip_text_size,
color = foreground_colour,
family = strip_text_family,
lineheight = line_height,
margin = margin(l = strip_text_size/2)
),
panel.spacing = panel_spacing,
panel.background = element_rect(color = NA, fill = background_colour),
plot.background = element_rect(color = NA, fill = background_colour),
plot.title.position = plot_title_position,
plot.margin = plot_margin,
plot.title = element_text(
hjust = 0, size = plot_title_size, margin = margin(b = plot_title_margin),
plot.title = ggtext::element_textbox_simple(
hjust = 0, size = plot_title_size,
margin = margin(b = plot_title_margin),
family = plot_title_family, lineheight = line_height
),
plot.subtitle = element_text(
hjust = 0, size = subtitle_size, margin = margin(b = subtitle_margin),
plot.subtitle = ggtext::element_textbox_simple(
hjust = 0, size = subtitle_size,
margin = margin(b = subtitle_margin),
family = subtitle_family, lineheight = line_height
),
plot.caption = element_text(
hjust = 1, size = caption_size, margin = margin(t = caption_margin),
family = caption_family, lineheight = line_height
plot.caption = ggtext::element_textbox(
hjust = 1,
size = caption_size,
margin = margin(t = caption_margin),
family = caption_family,
lineheight = line_height
),
) -> ret

2
R/theme-gs.R

@ -65,7 +65,7 @@ theme_gs <- function(
strip_text_size = 12,
strip_placement = "outer",
caption_size = 10,
caption_margin = 10,
caption_margin = 12,
axis_text_size = base_size,
axis_title_size = 10,
axis_title_just = "rt",

2
R/theme-inter.R

@ -65,7 +65,7 @@ theme_inter <- function(
strip_text_size = 12,
strip_placement = "outer",
caption_size = 9,
caption_margin = 8,
caption_margin = 11,
axis_text_size = base_size,
axis_title_size = 9,
axis_title_just = "rt",

2
R/theme-rc.R

@ -65,7 +65,7 @@ theme_rc <- function(
strip_text_size = 12,
strip_placement = "outer",
caption_size = 9,
caption_margin = 10,
caption_margin = 12,
axis_text_size = base_size,
axis_title_size = 9,
axis_title_just = "rt",

4
README.md

@ -7,7 +7,9 @@ by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keyb
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/hrbragg.svg?branch=master)](https://travis-ci.org/hrbrmstr/hrbragg)
Status](https://travis-ci.org/hrbrmstr/hrbragg.svg?branch=master)](https://travis-ci.org/hrbrmstr/hrbragg)
[![Coverage
Status](https://codecov.io/gh/hrbrmstr/hrbragg/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/hrbragg)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.6.0-blue.svg)
![License](https://img.shields.io/badge/License-MIT-blue.svg)

2
man/theme_gs.Rd

@ -15,7 +15,7 @@ theme_gs(
strip_text_size = 12,
strip_placement = "outer",
caption_size = 10,
caption_margin = 10,
caption_margin = 12,
axis_text_size = base_size,
axis_title_size = 10,
axis_title_just = "rt",

2
man/theme_inter.Rd

@ -15,7 +15,7 @@ theme_inter(
strip_text_size = 12,
strip_placement = "outer",
caption_size = 9,
caption_margin = 8,
caption_margin = 11,
axis_text_size = base_size,
axis_title_size = 9,
axis_title_just = "rt",

2
man/theme_rc.Rd

@ -15,7 +15,7 @@ theme_rc(
strip_text_size = 12,
strip_placement = "outer",
caption_size = 9,
caption_margin = 10,
caption_margin = 12,
axis_text_size = base_size,
axis_title_size = 9,
axis_title_just = "rt",

Loading…
Cancel
Save