Hackout2 / epimap

Repo for the map team
4 stars 2 forks source link

rendering maps outside R studio #2

Open thibautjombart opened 9 years ago

thibautjombart commented 9 years ago

Trying the tutorial on github, I get:

> quickMap(cholera$deaths, col.by="Count", size.by="Count")
Warning message:
In writeMap(bbm, x.map, ...) :
  Cannot render in HTML viewer pane (require RStudio v.>0.98.5).
              Use 'directView' argument to render into your browser.

This was running R from a terminal, not inside RStudio which I suspect works. Would be cool to render to the default browser by default.

fkeck commented 9 years ago

You can pass the directView argument to quickMap via the "..." So this should work:

quickMap(cholera$deaths, col.by="Count", size.by="Count", directView = "browser")

Normally, rleafmap checks if the user is using Rstudio and adapts its behaviour. Something is wrong here, I will try to have a look.

thibautjombart commented 9 years ago

works, thanks!

joanna-lewis commented 8 years ago

Works for me too using directView = "browser", but not automatically. A couple of other rendering issues: I found that heatMap produced a graph that's initially very zoomed-out. Is this the behaviour you would expect? I also don't see any colours, even when heat.map in the top-right is ticked. Thanks! zoomed_out no_colour

fkeck commented 8 years ago

Are you using RStudio Joanna? Or something else? If you use Rstudio, do you get the map directly in the viewer pane?

For the zoom problem, it's normal (but not the best I agree). The problem is that rleafmap automatically set the zoom and position to fit all the data of the map. Here the result is not good because the largest element is the colored grid which cover a very large surface (even if not working you can see its geographical extent). A solution is to set manually setZoom.

I don't now why you don't see the colored grid. Looks like the image is not generated or the link is wrong. Could you send me the HTML which is generated by heatMap?

joanna-lewis commented 8 years ago

I'm using the Mac GUI (the one you get when you download R - I'm not even sure what it's called!) So the map is appearing in a browser (Firefox).

I'm attaching the html that was generated. _map.html.txt

fkeck commented 8 years ago

Ok, I couldn't reproduce the bug and I have no idea what's happening here. Do you have this png file created : [working directory]/_data/_rasters/_heatmap.png ? Can you try to open the HTML directly from your file manager, and with Safari ?

joanna-lewis commented 8 years ago

The colours are also missing when I open it in Safari, and the png file is not there (but the _rasters folder is). So looks like that is the problem.

fkeck commented 8 years ago

Hi Joanna, I suspect this is because I forced to use the png function with the cairo library and the latter may be not available for you. I just patched rleafmap to fix this issue. Can you try to reinstall rleafmap from GitHub

remove.packages("rleafmap")
devtools::install_github("fkeck/rleafmap")

And then try the example again.

thibautjombart commented 8 years ago

Incidentally, what is the official supported browser? On most shiny apps, and a few js app I have tested, chrome was substantially faster than firefox. It will probably be useful to put a disclaimer out: only xxx supported. We don't want to open the can of worms of browser specific issues.. ;)

On Thu, Oct 29, 2015 at 10:43 AM, fkeck notifications@github.com wrote:

Hi Joanna, I suspect this is because I forced to use the png function with the cairo library and the latter may be not available for you. I just patched rleafmap to fix this issue. Can you try to reinstall rleafmap from GitHub

remove.packages("rleafmap") devtools::install_github("fkeck/rleafmap")

And then try the example again.

— Reply to this email directly or view it on GitHub https://github.com/Hackout2/epimap/issues/2#issuecomment-152143763.

fkeck commented 8 years ago

Theoretically all the browsers supported by Leaflet are ok : Chrome, Firefox, Safari 5+, Opera 12+, IE 7–11. This can be added somewhere. I usually do my tests with Firefox and Chromium.

joanna-lewis commented 8 years ago

Awesome, it's working now :) Thank you! colours