Open timelyportfolio opened 10 years ago
I got on the issues to report the need to fail on numeric keys due to CSS selector requirements. My solution was similarly to regex prepend a Z, as I was dealing with zipcodes.
Another quantile issue is what to do to display distinct datasets, with totally different domains. I had ratio and absolute data sliced into a common set of quantiles, the middle of which was (0.194,323]
. Perhaps another option for multiple fills and legends that swap with the data. I'm not sure at what point this becomes a datamaps question.
Some +1s:
+1 to setting data = newData[firstkey];
I don't know rCharts' opts, but the proposed solution sounds reasonable
+1 to #29 , and +1 that "a custom config.yml ... is not a good universal solution"
This project is very exciting! Hope to see an ichoropleth to rule them all!
I agree with all the suggestions made here. I will get back to the drawing board on ichoropleth
to refactor it so that it can handle all the issues raised. Thanks again @timelyportfolio and @bhtucker for bringing these up. Nothing better than having a detailed to-do list to write focused code :smiley:
The
ichoropleth
function is beautiful, but as I worked on recreating this USDA map in this Gist I found a couple issues. Some might be unique to the particular dataset, but handling these might make the function more robust:quantile
function incut
can result in duplicate values causing a fail with error. The simple solution is just wrap in aunique
, but I want to make sure this does not cause other problems. For this case, theunique
solution worked fine. I tried to checklattice
use but r-forge seems down currently.cut
, I got lots of#NA
, which I handled withinclude.lowest = TRUE
ichoropleth
sendsdata
andnewData
which with big datasets results in significant duplication and much larger file size. Should this be handled on the javascript side. I manually deleted thedata
and then in javascript setdata
to the first key innewData
. I wonder if data should not be included inparams
oropts
and be separate like most of therCharts
libraries. Then in JS transform the data as needed for the config in Datamaps.updateChoropleth
requires non-numeric id, since the CSS selector cannot be numeric. I used regex to append "c" (could be anything) to the id in topojson, and then in R did the same for the data so they match.datamaps.none
, but this is not a good universal solution. I like the suggested method in the referenced issue, and I guess it will fall within the Datamaps ref class.Thanks again @ramnathv for this. Map making is so easy now it is unbelievable.