0

I met some problems in displaying a map in a shiny using the package highcharter. When I try to display it in my RStudio Viewer, all is ok, my map is fine.

Whereas, when I try to display it in my shiny app via the functions highchartOutput(in the server) and renderHighchart(in the ui).

The "highcharter code" of my map in pretty simple, and it's not the problem because I can display it in my viewer, but I show it anyway here :

  carte <- highchart(type = "map") %>%
    hc_title(text = "Test") %>%
    hc_add_series_map(Map,as.data.frame(Dat),value='N',joinBy=c('name','LIB_DEP'))%>%
    hc_mapNavigation( enableMouseWheelZoom=T) -> carte

  carte

I bet the problem comes from the .js libraries I load, but not sure about it.

Anyone could help me ?

Thanks.

Mez13
  • 168
  • 1
  • 3
  • 13
  • Can you put a _reproducible minimal_ example? If we cannont reproduce the problem we cannot detect how is wrong. – jbkunst Apr 05 '17 at 17:26
  • @jbkunst thank you for your answer. It would be awful to post all my code here, and without the data you can not simply launch it and wait for errors. But I will do my best to be clear. Basically this, http://www.highcharts.com/blog/post/223-visualizing-the-gender-of-us-senators/, was my pattern. I used this code, I took my map (french territory) and my data. I can display an highmap in my RStudio Viewer, all works very well. My issue : my map doesn't display in my shiny. I guess there is a problem of .js code sourcing. What is the "standard method" to display an highmap in a shiny? – Mez13 Apr 05 '17 at 18:55
  • You're right : don't post your whole code! Just make a small example so we can reproduce your issue by just copy/pasting and without having to think/guess too much. If files are needed that can't be replaced by fake data or data included in a package, post them on dropbox. – HubertL Apr 06 '17 at 00:17
  • @HubertL SERVER output$carte_dep <- renderHighchart({ Map <- "www/Contours_geo/fr-all-all.geo.json" %>% jsonlite::fromJSON(simplifyVector = FALSE) carte <- highchart(type = "map") %>% hc_title(text = "Test") %>% hc_add_series_map(Map,as.data.frame(Dat),value='N',joinBy=c('name','LIB_DEP'))%>% hc_mapNavigation( enableMouseWheelZoom=T) -> carte carte }) UI box(width = 12,status = "primary" ,highchartOutput("carte_dep") ) This is a simple version. – Mez13 Apr 06 '17 at 07:38
  • This is a simple version that is NOT working : please include all `library()` and make sure the code works when copied/pasted in a new environment – HubertL Apr 06 '17 at 18:40
  • I think I found the issue. This is a problem of compatibilty between RCharts and Highcharter, I think it's not so simple to use both packages in the same shiny app – Mez13 Apr 07 '17 at 08:39
  • Yep, surely `rCharts` load other version (possibily an old one) that `highcharter` is loading. – jbkunst Apr 11 '17 at 19:51
  • Yes...too bad that the newest package (I think it's highcharter, not sure of it) is not aligned with the oldest one. I guess there is also competition in R packages....Anyway. Thanks for your help – Mez13 Apr 13 '17 at 07:26

0 Answers0