ramnathv / rCharts

Interactive JS Charts from R
http://rcharts.io
Other
1.19k stars 655 forks source link

Request for Leaflet Choropleth Example #105

Open pssguy opened 11 years ago

pssguy commented 11 years ago

If you ever have the time

ramnathv commented 11 years ago

Choropleths are on my list of things to support in rCharts. I will leave this issue open to serve me as a reminder.

pssguy commented 10 years ago

I've got a bit lost with where you are with choropleth support within rCharts. I seem to recall reading that you have now linked with the DataMaps package as well as Leaflet so is that a better way to go?

I have just been trying out the new choroplethr package. Quite promising but does not have ability to render individual states as yet

ramnathv commented 10 years ago

You are right in that I have added bindings for DataMaps in rCharts and it is easier to do minimalistic choropleth maps using DataMaps. I have seen the choroplethr package and it does a terrific job massaging the data and throwing it into ggplot2. I might try to figure out a way to intercept the data sent out to ggplot2 by choroplethr, and then use the DataMaps binding to render it as an interactive map.

I haven't found a good chunk of time to enhance the mapping functionality in rCharts, but hope to get to it soon. Ideally, I need to figure out a way to find more volunteers to focus on specific libraries, which will help speed up development.

pssguy commented 10 years ago

re chloroplethr, it is pretty straightforward to extend the examples in the blog post to other ACS tables - and presumably to any other US datasets with breakdown by state/county. Longer term a clickable map that drills down to the finer detail would be great

I'd like to help but other than develop more Shiny apps based on rCharts and singing your praises, I'm out of my depth. Don't you have students you could press into service?

ramnathv commented 10 years ago

Yes. I have looked through the choroplethr code and adapting its functionality for interactive maps should be straightforward.

I do have students, but working on supply chain and operations management problems. So, can't press them into service for an R project :)

pssguy commented 10 years ago

After supply chain and operations management problems I would have thought R projects would be light relief for the weekends. I guess you live in Canada's fun city Good to hear the adaptation wont be too difficult

ramnathv commented 10 years ago

Hehe. R only projects would be certainly game. The trouble is the need to be proficient in both JS and R :)

znmeb commented 10 years ago

Truila have just released a choropleth package that does about 90 percent of what I'm trying to do with census data. The package is at https://github.com/trulia/choroplethr. My package is at https://github.com/znmeb/pdxcensusdata.

I've got code now to dump a SpatialPolygonDataFrame to a GeoJSON file. So I think the pieces can be pasted together from my code, Trulia's and rCharts. The biggest thing I need now is documentation on how to call the Leaflet parts of rCharts. I was considering forking the bikeshare mapping app and trying to hack that into a census data mapper. ;-)

timelyportfolio commented 10 years ago

One more to consider kartograph for choropleth mapping with an example here. Also wanted to make sure that everyone is aware of the leaflet plugins.