Commits

Don Park committed c48b15a

color specific countries

Comments (0)

Files changed (1)

sinatra/views/heatmap.erb

 <script src="/scripts/d3.min.js"></script>
 <script src="/scripts/d3.geo.min.js"></script>
 <script>
-var data; // loaded asynchronously
-var path = d3.geo.path();
-
-var map = d3.select("#worldmap");
-
-map.selectAll(".landxx").style("fill", function() {
-       return "hsl(" + Math.random() * 360 + ",100%,50%)" })
-
+ // list of ['us', count]
+ data = [['us', 200], ['cn', 200]]
+ data.forEach(function(i) {
+    jQuery("."+i[0]).css("fill","rgb("+i[1]+",0,0)")
+ })
+ 
 </script>