Create Interactive Web Maps with the 'JavaScript Datamaps' Library

Easily create interactive choropleth maps then add bubbles and arcs by coordinates or region name. These maps can be used directly from the console, from 'RStudio', in 'Shiny' apps and 'R Markdown' documents. 'Shiny' proxies allow to interactively add arcs and bubbles, change choropleth values, or change labels.

Travis-CI Build Status AppVeyor Build Status CRAN CRAN_Status_Badge


R htmlwidget for datamaps, plot choropleth, overlay arcs and bubbles, customise options, easily interact with Shiny proxies.


# CRAN release
# Development version

Development version includes 2 plugins, add_icons and add_markers.


  • See website for demos.
  • Includes proxies to update the visualisation without re-drawing entire map.
  • See for new features and bug fixes

Shiny Proxies

  • update_bubbles - update bubbles.
  • update_choropleth - update choropleth values.
  • update_labels - update labels.
  • update_legend - update the legend.
  • update_arcs - update arcs by coordinates.
  • update_arcs_name - update arcs by name.
  • delete_map - delete the map.


Example proxy.


ui <- fluidPage(
    value = "USA"
    value = "RUS"
    "Draw arc"
server <- function(input, output){
  arc <- reactive({
    data.frame(from = input$from, to = input$to)
 output$map <- renderDatamaps({
 observeEvent(input$submit, {
   datamapsProxy("map") %>%
     add_data(arc()) %>%
     update_arcs_name(from, to)
shinyApp(ui, server)


datamaps 0.0.3

  • Support for icons and marker plugins added.
  • longitude and latitude arguments renamed to lon and lat respectively.

datamaps 0.0.2

  • Better shiny reactivity
  • Resizing - datamaps init default responsive = TRUE and width, height to 100%
  • Bug where the map would get redrawn on input change in Shiny fixed.
  • Fixed shiny bug where map would get redrawn instead of updated.
  • Added support for custom topo.json, see set_projection

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.0.3 by John Coene, a year ago

Report a bug at

Browse source code at

Authors: John Coene [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports htmlwidgets, magrittr

Suggests shiny, knitr, rmarkdown, RColorBrewer, countrycode, dplyr

See at CRAN