Open ekstroem opened 10 years ago
Oh I might add ...
If I run the standard example
library(rMaps)
d2 <- ichoropleth(Crime ~ State, data = violent_crime[violent_crime$Year==2010,])
then I get the correct output in RStudio on Mac.
Can you do the following, so that it is easier for me to help debug?
d1$save('index.html', cdn = TRUE)
index.html
and dk_kom.json
to a gist.If you dont want dk_kom.json
to be public, you can zip up the html and json files and email them to me so that I can take a look.
Thanks for looking at this. The files can be found at http://www.biostatistics.dk/rMaps/index.html and http://www.biostatistics.dk/rMaps/dk_kom.json
The relative link to dk_kom.json
in the html
file is incorrect. Can you update it in index.html
so that it points to the correct dk_kom.json
path?
Done. Changed the dataurl to ./dk_kom.json
I am able to view your html on a Mac in all browsers (Chrome/Firefox/Safari). I am not really sure what is happening at your end. Can you try and make sure you have the latest versions of all browsers?
Another thought that came to me is that I may not have updated the datamaps
js files local to rCharts
, which might be the interfering. Can you check if the charts show up when you save it with the option cdn = TRUE
?
Have the latest version of all browsers so not that.
When saving with option cdn=TRUE
I can see the map so that fixed that. Cheers!
However, if I want to weave it into a document I would type d1$print('chart4', include_assets = TRUE)
- and that does not produce anything when I use knit2html("filename")
.
On a possibly related note: when I just print the ichoropleth object d1
in RStudio I still just get the legend in the viewer.
I will investigate this over the weekend. I think the fix is just updating the local js/css assets for datamaps.
Hi all,
I need a bit of help trying to figure out why I get the correct output when running on linux but almost no output when running the same script on Mac.
When I run this code on my Mac in RStudio I only get the legend but no map.
If I instead save the plot instead of just viewing by
d1$print('chart4', include_assets = TRUE)
at the bottom of the file, and{r results = 'asis', comment = NA, echo=FALSE, fig.width=10, fig.height=10}
at the topknit2html("filename")
on the file I get an html file that shows up blank in Safari/Chrome/Firefox (still on Mac) but appears to contain all the data. Not even a legend.If I run the same code on my Ubuntu machine it just appears to work. Any clues?
Claus