draw = (context, points, t) => {
mutable nbtotal = points.length;
if (points.length > nbCities) {
points = points.slice();
d3.quickselect(
points,
nbCities,
0,
points.length - 1,
(a, b) => b.size - a.size
);
points.splice(nbCities, points.length - 1)
}
if (background){
context.globalAlpha = 1
context.drawImage(image, 0, 0, width, height)
context.fill()
}
mutable nbrendered = points.length;
const cities = points.map(p => contours.get(p.id)).filter(p => p)
const listes = d3.nest()
.key(d => d.properties.LISTE)
.entries(cities)
context.lineJoin = "round"
context.lineCap = "round"
context.lineWidth = 0.2/t.k
context.strokeStyle = "white"
const path = d3.geoPath(null, context)
listes.forEach(c => {
context.beginPath()
const geo = {type: "FeatureCollection", features: c.values}
context.fillStyle = color(c.key)
path(geo)
context.fill()
context.stroke()
context.closePath
})
}