Description Usage Arguments Note See Also Examples
Set projection
| 1 | set_projection(p, fun = htmlwidgets::JS())
 | 
| p | a datamaps object. | 
| fun | a JavaScript function. | 
Does not work in RStudio viewer, open in browser.
https://github.com/Anujarya300/bubble_maps
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | topo <- paste0("https://rawgit.com/Anujarya300/bubble_maps/",
  "master/data/geography-data/india.topo.json")
  
data <- data.frame(state = c("JH", "MH"), value = c(55, 28))
  
data %>% 
  datamaps(scope = "india") %>% 
  add_choropleth(state, value) %>% 
  config_geo(data.url = topo) %>% 
  set_projection(htmlwidgets::JS('
  function (element) {
    var projection = d3.geo.mercator()
    .center([78.9629, 23.5937])
    .scale(1000);
    var path = d3.geo.path().projection(projection);
    return { path: path, projection: projection };
  }
  ')
  )
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.