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

map: legend/font #58

Open
MrichardsPSRC opened this issue Apr 20, 2023 · 0 comments
Open

map: legend/font #58

MrichardsPSRC opened this issue Apr 20, 2023 · 0 comments

Comments

@MrichardsPSRC
Copy link

image

The legend could be improved by moving the NA below the values/colorscale. Similarly in the Asian blog post map:
image

The legend and labels in the map should probably also be Poppins font - I found a solution online for the NA issue and Christy helped me supplement to fix the font issues with this code, which is added as the last lines before printing the map:

# fix the legend NA placement (https://github.com/rstudio/leaflet/issues/615)
css_fix <- "div.info.legend.leaflet-control br {clear: both;} html * {font-family: Poppins !important;}" # CSS to correct spacing and font family
html_fix <- htmltools::tags$style(type = "text/css", css_fix)  # Convert CSS to HTML
medinc_map %<>% htmlwidgets::prependContent(html_fix)      # Insert into leaflet HTML code

In the map I generated it makes it look like this (ignore the different color palette):
image

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

No branches or pull requests

1 participant