Skip to content

Commit

Permalink
fix: networkMap() refinements
Browse files Browse the repository at this point in the history
Fixes GR10/GR2.5 and hydrocarbons appearing in the legend
  • Loading branch information
jack-davison committed Apr 28, 2024
1 parent 36d813b commit 973f143
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

* "illegal" file path characters can now be used in the columns provided to the `type` argument of the `polarMap()` family. Most relevant to most users is that this will allow them to provide their own custom HTML tags - e.g., for formatting superscripts, subscripts, and so on.

* The colours in the legend of `networkMap()` now better align with the actual colours of the markers, and the layer control menu when `control = "variable"` is now presented in a nicer order with clearer labels.

# openairmaps 0.8.1

This is a minor release of `{openairmaps}`, released mainly to fix an issue with `{ggmap}` but also adding some new functionality for polar marker maps.
Expand Down
5 changes: 3 additions & 2 deletions R/network_networkMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ networkMap <-
map,
position = control.position,
options = leaflet::layersControlOptions(collapsed = control.collapsed, autoZIndex = FALSE),
baseGroups = quickTextHTML(sort(control_vars)),
baseGroups = sort(quickTextHTML(control_vars)),
overlayGroups = names(provider)
) %>%
leaflet::hideGroup(group = names(provider)[[-1]])
Expand Down Expand Up @@ -477,7 +477,8 @@ prepNetworkData <- function(source, year) {
"135TMB",
"c2PENTEN",
"MEPENT",
"3MEPENT"
"3MEPENT",
"NAPHTH"
)

meta <- dplyr::filter(
Expand Down
3 changes: 3 additions & 0 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ quickTextHTML <- function(text) {
text <- gsubic("pmcoarse", "PM<sub>coarse</sub>", text)
text <- gsubic("pmf", "PM<sub>fine</sub>", text)
text <- gsubic("pmfine", "PM<sub>fine</sub>", text)
text <- gsubic("gr25", "PM<sub>2.5</sub>&nbsp(grav.)", text)
text <- gsubic("gr2.5", "PM<sub>2.5</sub>&nbsp(grav.)", text)
text <- gsubic("gr10", "PM<sub>10</sub>&nbsp(grav.)", text)

# units
text <- gsub("ug/m3", "\u00B5g&nbspm<sup>-3</sup>", text)
Expand Down

0 comments on commit 973f143

Please sign in to comment.