function map(data,{ind} = {})
{
var width = 950,
height = 580;
var deffFillv,
defRb = "1.5px",
defFillb = "black",
defFillgL = "rgb(209, 209, 209)",
defFillgR = "grey",
defOpv = "0.4",
defFillbR = "none";
var div = d3.create('div')
const projection = d3.geoConicConformal().center([2.454071, 46.279229]).scale(2800);
var path = d3.geoPath().projection(projection);
var svg = div.append("svg").attr("width", width).attr("height", height);
var jourChoisi = dates_parsed[ind]
var cleanData = data.filter((d) => d.sexe == "0");
var datanest = d3.group(cleanData, (d) => d.date_parsed)
var cleanData2 = datanest.get(jourChoisi)
for (var j = 0; j < files.features.length; j++) {
var dep = files.features[j].properties.code;
var index = cleanData2.findIndex((d) => d.dep == dep)
files.features[j].properties.value = cleanData2[index].hosp;
}
var color = d3.scaleSequentialSqrt([0, 1], d3.interpolateTurbo);
color.domain([
d3.min(cleanData2, function (d) {
return +d.hosp;
}),
d3.max(cleanData2, function (d) {
return +d.hosp;
})
]);
var tooltip = d3.select("body")
.append("div")
.style("position", "absolute")
.style("z-index", "10")
.style("visibility", "hidden")
.attr("class", "tooltip")
.style("font-family", "Lato")
var path = d3.geoPath().projection(projection);
svg.selectAll('g')
.data(files.features)
.enter().append("path")
.attr("d", path)
.attr("stroke", "white")
.attr("id", function(d,i) { return `l${d.properties.code}`})
.style("fill",function (d) {
var value = d.properties.value;
if (value) {
return color(value);
}
else { return "black"}
})
.on('mouseover', function(e, d) {
tooltip.style("visibility", "visible").html(`${d.properties.nom} : ${d.properties.value}`).style("background",'#FFFFFF');;
})
.on("mousemove", function(e, d){return tooltip.style("top", (e.pageY-20)+"px").style("left",(e.pageX+20)+"px");})
.on('mouseout', function(e, d) {
tooltip.style("visibility", "hidden");
});
return div.node()
}