Skip to content

Commit

Permalink
responsive choropleth
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasalmeida committed Oct 5, 2014
1 parent 401c08b commit 84e2b18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions jobs/pqiSuffolk.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ openHealth.getScript(["//cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js","ht
openHealth.getJSON("jobs/zips_suffolk_HD_geo.json",function(zipMap){
console.log("map loaded");
var C_Map = dc.geoChoroplethChart("#suffolkYearPie");
var C_Pie = dc.pieChart("#suffolkChoropleth");
var C_Obs = dc.barChart("#suffolkObservedPqi");
var C_Exp = dc.barChart("#suffolkExpectedPqi");
//var C_Pie = dc.pieChart("#suffolkChoropleth");
//var C_Obs = dc.barChart("#suffolkObservedPqi");
//var C_Exp = dc.barChart("#suffolkExpectedPqi");


var cf=crossfilter(dt);
Expand All @@ -46,12 +46,16 @@ openHealth.getScript(["//cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js","ht
.dimension(zips)
.projection(d3.geo.albersUsa().scale(28000).translate([-8200,2400]))
.group(G_zips)
.overlayGeoJson(zipMap.features, "zips", function (d) {
.overlayGeoJson(zipMap.features, "zip", function (d) {
return d.properties.ZCTA5CE10;
})
.title(function(d) {
return "zip: " + d.patient_zipcode;
})
.colorAccessor(function(d, i){return Math.random()*1000})
dc.renderAll();

document.getElementByID("jobMsg").textContent="";
document.getElementById("jobMsg").textContent="";

4

Expand Down
2 changes: 1 addition & 1 deletion openHealth.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ this.sodaAll=function(url,q,fun,xx,fun0){ // version of soda2 that keeps reading
}

this.sodas=function(urls,q,fun,xx){ // version of sodaAll with multiple urls, for example, to load from a list of zip codes
console.log(urls[0]);
//console.log(urls[0]);
//var urlsi = urls;
if(!xx){xx=[]}
if(urls.length>0){ // keep going
Expand Down

0 comments on commit 84e2b18

Please sign in to comment.