Skip to content

Commit 8866681

Browse files
user can control strip text color x and y
1 parent 1ad6e37 commit 8866681

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* added the possibility to select the shapes manually via `interval_shape` and `bsv_shape`
1010
* added capability for user to reverse color legend separately via `legend_color_reverse`
1111
* added capability for user to specify text for legend titles via `interval_legend_title` and `shape_legend_title` as well as to control text size via `legend_title_size`
12+
* added capability for user to specify facet text color via `x_facet_text_col` and `y_facet_text_col`
1213

1314
# coveffectsplot 1.0.3
1415
* fixed a bug when ref_value when not equal 1 affecting y axis limits

R/forest_plot.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ label_wrap <- function(width) {
5353
#' @param y_facet_text_vjust Facet text vertical justification.
5454
#' @param x_facet_text_hjust Facet text horizontal justification.
5555
#' @param y_facet_text_hjust Facet text horizontal justification.
56+
#' @param x_facet_text_col Facet text color default to black.
57+
#' @param y_facet_text_col Facet text color default to black.
5658
#' @param xy_facet_text_bold Bold Facet text. Logical TRUE FALSE.
5759
#' @param x_label_text_size X axis labels size.
5860
#' @param y_label_text_size Y axis labels size.
@@ -361,6 +363,8 @@ forest_plot <- function(
361363
y_facet_text_vjust = 0.5,
362364
x_facet_text_hjust = 0.5,
363365
y_facet_text_hjust = 0.5,
366+
x_facet_text_col = "black",
367+
y_facet_text_col = "black",
364368
xy_facet_text_bold = TRUE,
365369
x_label_text_size = 16,
366370
y_label_text_size = 16,
@@ -478,7 +482,8 @@ forest_plot <- function(
478482
angle= x_facet_text_angle,
479483
face = ifelse(xy_facet_text_bold,"bold","plain"),
480484
hjust = x_facet_text_hjust,
481-
vjust = x_facet_text_vjust
485+
vjust = x_facet_text_vjust,
486+
color = x_facet_text_col
482487
)
483488
table.x.strip.text <- x.strip.text
484489

@@ -491,7 +496,8 @@ forest_plot <- function(
491496
angle= y_facet_text_angle,
492497
face = ifelse(xy_facet_text_bold,"bold","plain"),
493498
hjust = y_facet_text_hjust,
494-
vjust = y_facet_text_vjust
499+
vjust = y_facet_text_vjust,
500+
color = y_facet_text_col
495501
)
496502
table.y.strip.text <- y.strip.text
497503
}

inst/shiny/server.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ function(input, output, session) {
255255
y_facet_text_vjust = ..(input$y_facet_text_vjust),
256256
x_facet_text_hjust = ..(input$x_facet_text_hjust),
257257
y_facet_text_hjust = ..(input$y_facet_text_hjust),
258+
x_facet_text_col = ..(input$x_facet_text_col),
259+
y_facet_text_col = ..(input$y_facet_text_col),
258260
xy_facet_text_bold = ..(input$boldfacettext),
259261
x_label_text_size = ..(input$xlablesize),
260262
y_label_text_size = ..(input$ylablesize),

inst/shiny/ui.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ fluidPage(
249249
showColour = "both",allowTransparent=TRUE, returnName = TRUE),
250250
div( actionButton("stripbackfillreset", "Reset Strip Background Fill"),
251251
style="text-align: right"),
252+
colourpicker::colourInput("y_facet_text_col",
253+
"Facet Text Color Y:",
254+
value="black",
255+
showColour = "both",allowTransparent=TRUE, returnName = TRUE),
256+
colourpicker::colourInput("x_facet_text_col",
257+
"Facet Text Color X:",
258+
value="black",
259+
showColour = "both",allowTransparent=TRUE, returnName = TRUE),
252260
checkboxInput('removestrip', "Show Strip Background",value = TRUE),
253261
conditionalPanel(condition = "!input.colourbyparamname",
254262
colourpicker::colourInput("colourpointrange",

man/forest_plot.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)