Skip to main content
100%

K-Means as a force

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Dec 26, 2016
Created on Dec 25, 2016

A thousand colored circles of varying sizes drift on a canvas, continuously regrouping into distinct clusters as they move. The example runs a K-Means clustering algorithm inside a d3.forceSimulation loop, with each tick reassigning every node to its nearest of 20 cluster centers and then moving those centers toward their group’s barycenter. Rendered using Canvas 2D, the visualization combines force-based collision detection and positioning forces with the clustering logic, displaying the emergent dynamic partitioning of the dataset in real time.

AI-generated description

Computing K-Means within a d3.forceSimulation loop.

Forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/31ce330646fa8bcb7289ff3b97aab3f5'>Collision Detection</a>

gpl-3.0 Licensed

Similar vizzes