Click and drag to add randomized new data points to the canvas.
"SPACE" to restart cluster centers from a new location.
"UP" to increase the number of clusters.
"DOWN" to decrease the number of clusters.

Gray lines show the paths that the cluster centers followed to the final locations.

Source code: kmeans

Built with Processing