Skip to content

map: legend/font #58

@MrichardsPSRC

Description

@MrichardsPSRC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions