Skip to content

Commit

Permalink
Fix: Removed gdfonts method to get Arial in plots, using css
Browse files Browse the repository at this point in the history
  • Loading branch information
JT-39 committed Sep 25, 2024
1 parent e1df4fc commit 6a01b25
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 120 deletions.
2 changes: 1 addition & 1 deletion R/fn_plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ set_plot_labs <- function(filtered_bds) {
#'
custom_theme <- function() {
list(
ggplot2::theme_minimal(base_family = "Arimo"),
ggplot2::theme_minimal(),
ggplot2::theme(
# Keeps title within chart
plot.title = ggtext::element_textbox(
Expand Down
5 changes: 0 additions & 5 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ shhh(library(shiny))
shhh(library(ggplot2))
shhh(library(ggiraph))

# Register font (for shinyapps.io)
gdtools::register_gfont("Arimo")

# Dependencies needed for testing or CI but not for the app -------------------
# Including them here keeps them in renv but avoids the app needlessly loading
# them, saving on load time.
Expand All @@ -43,8 +40,6 @@ if (FALSE) {
shhh(library(dfeR))
shhh(library(dfeshiny))
shhh(library(shinyGovstyle))
# Plotting
shhh(library(gfonts))
}


Expand Down
109 changes: 0 additions & 109 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -514,21 +514,6 @@
],
"Hash": "ab12c7b080a57475248a30f4db6298c0"
},
"crul": {
"Package": "crul",
"Version": "1.5.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R6",
"curl",
"httpcode",
"jsonlite",
"mime",
"urltools"
],
"Hash": "22e70c5046981d39b7bf7af74433e396"
},
"curl": {
"Package": "curl",
"Version": "5.2.1",
Expand Down Expand Up @@ -757,26 +742,6 @@
"Repository": "RSPM",
"Hash": "aa5e1cd11c2d15497494c5292d7ffcc8"
},
"fontBitstreamVera": {
"Package": "fontBitstreamVera",
"Version": "0.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "f6068021eff4aba735a9b2353516636c"
},
"fontLiberation": {
"Package": "fontLiberation",
"Version": "0.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "f918c5e723f86f409912104d5b7a71d6"
},
"fontawesome": {
"Package": "fontawesome",
"Version": "0.5.2",
Expand All @@ -789,18 +754,6 @@
],
"Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d"
},
"fontquiver": {
"Package": "fontquiver",
"Version": "0.2.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"fontBitstreamVera",
"fontLiberation"
],
"Hash": "fc0f4226379e451057d55419fd31761e"
},
"forcats": {
"Package": "forcats",
"Version": "1.0.0",
Expand Down Expand Up @@ -828,21 +781,6 @@
],
"Hash": "15aeb8c27f5ea5161f9f6a641fafd93a"
},
"gdtools": {
"Package": "gdtools",
"Version": "0.4.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"Rcpp",
"fontquiver",
"htmltools",
"systemfonts",
"tools"
],
"Hash": "e8e09897fee8d96f6bb02bf841177d20"
},
"generics": {
"Package": "generics",
"Version": "0.1.3",
Expand All @@ -869,23 +807,6 @@
],
"Hash": "ab2ca7d6bd706ed218d096b7b16d7233"
},
"gfonts": {
"Package": "gfonts",
"Version": "0.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"crayon",
"crul",
"glue",
"htmltools",
"jsonlite",
"shiny",
"utils"
],
"Hash": "a535d76cf92645364997a8751396d63b"
},
"ggiraph": {
"Package": "ggiraph",
"Version": "0.8.10",
Expand Down Expand Up @@ -1114,13 +1035,6 @@
],
"Hash": "04291cc45198225444a397606810ac37"
},
"httpcode": {
"Package": "httpcode",
"Version": "0.3.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "13641a1c6d2cc98801b76764078e17ea"
},
"httpuv": {
"Package": "httpuv",
"Version": "1.6.15",
Expand Down Expand Up @@ -2296,16 +2210,6 @@
],
"Hash": "39b1d69229e30314e7cba023c777f52d"
},
"triebeard": {
"Package": "triebeard",
"Version": "0.4.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"Rcpp"
],
"Hash": "642507a148b0dd9b5620177e0a044413"
},
"tzdb": {
"Package": "tzdb",
"Version": "0.4.0",
Expand All @@ -2331,19 +2235,6 @@
],
"Hash": "409328b8e1253c8d729a7836fe7f7a16"
},
"urltools": {
"Package": "urltools",
"Version": "1.7.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"Rcpp",
"methods",
"triebeard"
],
"Hash": "e86a704261a105f4703f653e05defa3e"
},
"usethis": {
"Package": "usethis",
"Version": "3.0.0",
Expand Down
1 change: 0 additions & 1 deletion ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ ui <- function(input, output, session) {
# Load javascript dependencies --------------------------------------------
shinyWidgets::useShinydashboard(),
shinyjs::useShinyjs(),
gdtools::addGFontHtmlDependency("Arimo"),

# Cookies -----------------------------------------------------------------
# Setting up cookie consent based on a cookie recording the consent:
Expand Down
9 changes: 5 additions & 4 deletions www/dfe_shiny_gov_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ p {
overflow-wrap: anywhere; /* email too big for smaller screens and needs to wrap */
}

/* make all text sans-serif (for ggiraph plots on shinyapps.io) */
text {
font-family: helvetica,arial,sans-serf;
}

/* heading text */
.govuk-header__link--service-name {
font-family: "Helvetica Neue", "Arial", sans-serif;
Expand Down Expand Up @@ -378,7 +383,3 @@ html {
width: 50vw !important;
align-self: center;
}

text {
font-family: helvetica,arial,sans-serf;
}

0 comments on commit 6a01b25

Please sign in to comment.