Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JohnCoene/datamaps

📍 datamaps htmlwidget for R
https://github.com/JohnCoene/datamaps

datamaps htmlwidgets r visualization

Last synced: 3 months ago
JSON representation

📍 datamaps htmlwidget for R

Awesome Lists containing this project

README

        

# datamaps

[![Travis-CI Build Status](https://travis-ci.org/JohnCoene/datamaps.svg?branch=master)](https://travis-ci.org/JohnCoene/datamaps)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/JohnCoene/datamaps?branch=master&svg=true)](https://ci.appveyor.com/project/JohnCoene/datamaps)
[![CRAN](https://img.shields.io/cran/v/datamaps.svg)](https://img.shields.io/cran/v/datamaps.svg)
[![CRAN_Status_Badge](http://cranlogs.r-pkg.org/badges/grand-total/datamaps)](http://cranlogs.r-pkg.org/badges/grand-total/datamaps)

![proxies](https://raw.githubusercontent.com/JohnCoene/projects/master/img/datamaps_proxy.gif)

R htmlwidget for [datamaps](http://datamaps.github.io/), plot choropleth, overlay arcs and bubbles, customise options, easily interact with Shiny proxies.

* [Installation](#installation)
* [Details](#info)
* [Examples](#examples)
* [Shiny Proxies](#shiny-proxies)
* [Proxies demo](http://shiny.john-coene.com/datamaps/)
* [Website](http://datamaps.john-coene.com)

## Installation

```R
# 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](http://datamaps.john-coene.com/) 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](http://shiny.john-coene.com/datamaps/)

```R
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)
}
```