Skip to content
📍 datamaps htmlwidget for R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
docs
inst/htmlwidgets
man
revdep
vignettes
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
LICENSE
NAMESPACE
NEWS.md
README.md
_pkgdown.yml
appveyor.yml
cran-comments.md

README.md

datamaps

Travis-CI Build Status AppVeyor Build Status CRAN CRAN_Status_Badge

proxies

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

Installation

# CRAN release
install.packages("datamaps")

# Development version
devtools::install_github("JohnCoene/datamaps")

Development version includes 2 plugins, add_icons and add_markers.

Info

  • See website for demos.
  • Includes proxies to update the visualisation without re-drawing entire map.
  • See NEWS.md 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.

Examples

Example proxy.

demo

library(shiny)

ui <- fluidPage(

  textInput(
    "from",
    "Origin",
    value = "USA"
  ),
  textInput(
    "to",
    "Destination",
    value = "RUS"
  ),
  actionButton(
    "submit",
    "Draw arc"
  ),
  datamapsOutput("map")
)

server <- function(input, output){

  arc <- reactive({
    data.frame(from = input$from, to = input$to)
  })

 output$map <- renderDatamaps({
   datamaps()
 })

 observeEvent(input$submit, {
   datamapsProxy("map") %>%
     add_data(arc()) %>%
     update_arcs_name(from, to)
 })

}

shinyApp(ui, server)
}
You can’t perform that action at this time.