Built with blockbuilder.org
xxxxxxxxxx
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<script>
var width = 700,
height = 580;
var svg = d3.select( "body" )
.append( "svg" )
.attr( "width", width )
.attr( "height", height );
var projection = d3.geoConicConformal().center([2.454071, 46.279229]).scale(2800)
var path = d3.geoPath()
.projection(projection);
var color = d3.scaleLinear()
.domain([0,4000])
//.range(["green","black","red"])
.range(["white","green"])
.nice();
d3.json("regions.json", function(region) {
d3.csv("GrippeFrance2014.csv", function(data) {
console.log(data);
console.log(region);
for (var j = 0; j < region.features.length; j++) {
var r = region.features[j];
for (var i = 0; i < data.length; i++) {
var d = data[i];
if ((j==2) && (i==2)) {
console.log(d);
console.log(r);
};
if (d.region==r.properties.nom) {
region.features[j].properties.malades = +d["somme2014"];
};
};
};
svg.selectAll("path")
.data(region.features)
.enter()
.append("path")
.attr("d", path)
.attr('fill',function(d) {
return color(d.properties.malades)
});
});
});
</script>
</body>
Modified http://d3js.org/d3.v4.min.js to a secure url
https://d3js.org/d3.v4.min.js