function drawInit() {
const ctx = canvas.getContext('2d');
ctx.save();
ctx.clearRect(0, 0, width+2*padding, height+2*padding);
points.forEach(point => {
point.color = colorScale(point.seval);
});
for (let i = 0; i < points.length; ++i) {
const point = points[i];
ctx.fillStyle = point.color;
ctx.fillRect(padding+point.cartx, padding+point.carty, size, size);
}
ctx.fillStyle = "#FF0000"
ctx.beginPath();
ctx.arc(padding-20, height+padding+20, 20, 0, 2 * Math.PI);
ctx.fill();
ctx.fillStyle = "#00FF00"
ctx.beginPath();
ctx.arc(padding+(width/2)+2, padding-25, 20, 0, 2 * Math.PI);
ctx.fill();
ctx.fillStyle = "#0000FF"
ctx.beginPath();
ctx.arc(padding + width+20, height+padding+20, 20, 0, 2 * Math.PI);
ctx.fill();
ctx.restore();
}