Skip to content

Commit

Permalink
feat: new highchart jerusalem theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenuial committed Aug 27, 2024
1 parent 440f7f3 commit 95c4d20
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 2 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^data-raw$
^docs$
^pkgdown$
^Makefile$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Config/Needs/website: nenuial/geopkg
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export(ggeopal_pal_to_gradient)
export(ggeopal_to_gradient)
export(ggeosave)
export(ggeotheme)
export(hc_jerusalem_theme)
export(hc_purple_theme)
export(hc_samarqand_theme)
export(hc_web_theme)
Expand Down
1 change: 0 additions & 1 deletion R/ggplot_themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ ggeotheme <- function(
color = ggeodata$themes[[theme]][[mode]]$line
),
panel.grid = ggplot2::element_blank(),

plot.background = ggplot2::element_rect(fill = "transparent", color = NA),
plot.caption = ggplot2::element_text(
family = ggeodata$themes[[plot]]$caption$family,
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_jerusalem_theme <- function(hc) {
base_colors <- list(
main_color = "#FAE3A0",
axis_color = "#c0d9eb",
title_color = "#699CB6"
)

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_web_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 95c4d20

Please sign in to comment.