Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to change fill color of nanoplot data area (bounded to data points) #1534

Merged
merged 6 commits into from Jan 13, 2024

Conversation

rich-iannone
Copy link
Member

The fill color for the area that bounds the data points in line plot type of nanoplot can now be changed through this PR. The default value is "#FF0000" ("red"), which is unchanged from before. This can be modified via nanoplot_options()'s data_area_fill_color argument.

Here is an example of this:

library(gt)
library(tidyverse)

illness |>
  dplyr::slice_head(n = 10) |>
  gt(rowname_col = "test") |>
  tab_header("Partial summary of daily tests performed on YF patient") |>
  tab_stubhead(label = md("**Test**")) |>
  cols_hide(columns = c(starts_with("norm"), starts_with("day"))) |>
  fmt_units(columns = units) |>
  cols_nanoplot(
    columns = starts_with("day"),
    new_col_name = "nanoplots",
    new_col_label = md("*Progression*"),
    options = nanoplot_options(data_area_fill_color = "lightgreen") 
  ) |>
  cols_align(align = "center", columns = nanoplots) |>
  cols_merge(columns = c(test, units), pattern = "{1} ({2})") |>
  tab_footnote(
    footnote = "Measurements from Day 3 through to Day 8.",
    locations = cells_column_labels(columns = nanoplots)
  )
data_area_fill_color

Fixes: #1521

@rich-iannone rich-iannone marked this pull request as ready for review January 13, 2024 02:02
@rich-iannone rich-iannone merged commit 0a19437 into master Jan 13, 2024
12 checks passed
@rich-iannone rich-iannone deleted the data-area-fill-color branch January 13, 2024 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New data_area_fill_color parameter for nanoplot_options
1 participant