function* slowPlot (ms) {
const node = document.getElementsByTagName('svg')[1];
while (node.firstChild) {
node.removeChild(node.firstChild);
}
const newLine = document.createElementNS("http://www.w3.org/2000/svg","line");
newLine.setAttribute("x1","0");
newLine.setAttribute("x2",X_MAX);
newLine.setAttribute("y1","0");
newLine.setAttribute("y2",Y_MAX);
newLine.setAttribute("stroke","purple");
node.appendChild(newLine);
let index = 0;
for (const point of randomPoints) {
const newPoint = document.createElementNS("http://www.w3.org/2000/svg","circle")
newPoint.setAttribute("cx",point.x);
newPoint.setAttribute("cy",point.y);
newPoint.setAttribute("r","2");
newPoint.setAttribute("fill","white");
newPoint.style.stroke = guess(trainedWeights, point) === 1 ? 'blue' : 'red';
newPoint.style.strokeWidth = "1";
index ++
yield Promises.tick(ms, node.appendChild(newPoint))
}
}