Skip to content

Commit

Permalink
feat: add pomogreen hc theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenuial committed Sep 23, 2024
1 parent 8005bf9 commit fb2b782
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export(ggeopal_to_gradient)
export(ggeosave)
export(ggeotheme)
export(hc_jerusalem_theme)
export(hc_pomogreen_theme)
export(hc_purple_theme)
export(hc_samarqand_theme)
export(hc_web_theme)
Expand Down
83 changes: 83 additions & 0 deletions R/highcharter_themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,89 @@ hc_samarqand_theme <- function(hc) {
highcharter::hc_add_theme(theme)
}

#' @rdname hc_purple_theme
#' @export
hc_pomogreen_theme <- function(hc) {
base_colors <- list(
main_color = "#2b323f",
axis_color = "#3a3e3f",
title_color = "#919c4c"
)

base_text_style <- list(
fontFamily = "Fira Sans",
fontWeight = "100",
fontSize = "24px",
color = base_colors$main_color
)

axis_title_style <- list(
fontFamily = "Fira Sans",
fontWeight = "300",
fontSize = "24px",
color = base_colors$axis_color
)

theme <- highcharter::hc_theme(
colors = wesanderson::wes_palette("GrandBudapest2"),
chart = list(
backgroundColor = "transparent"
),
title = list(
style = list(
color = base_colors$title_color,
fontFamily = "Fira Sans",
fontSize = "52px",
fontWeight = "400"
)
),
subtitle = list(
style = list(
color = base_colors$title_color,
fontFamily = "Fira Sans",
fontSize = "38px",
fontWeight = "300"
)
),
legend = list(
itemStyle = base_text_style,
itemHoverStyle = list(
color = base_colors$main_color
)
),
tooltip = list(
headerFormat = "<span style='font-size: 24px'>{point.key}</span><br/>",
style = list(
fontFamily = "Fira Sans",
fontWeight = "200",
fontSize = "28px"
)
),
caption = list(
style = base_text_style
),
xAxis = list(
labels = list(
style = base_text_style
),
title = list(
style = axis_title_style
)
),
yAxis = list(
labels = list(
style = base_text_style
),
title = list(
style = axis_title_style
)
)
)

hc |>
highcharter::hc_add_theme(theme)
}

#' @rdname hc_purple_theme
#' @export
hc_jerusalem_theme <- function(hc) {
Expand Down
3 changes: 3 additions & 0 deletions man/hc_purple_theme.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb2b782

Please sign in to comment.