Update color of dots in graph when transitioning

Hi! I’m new to working with transitions, and am struggling to visualize the “grouping” of points to a cluster for a simple exercise trying to visualize K-means clustering. I’m able to get the centroids to move around, but I’m unable to change the color which indicates which cluster the group of points belong to.

Here’s the notebook, would appreciate any help :slight_smile:

Nice concept! Adding this line of code works for me to make the dots’ fill color update based on their new cluster after each transition:

Although there seems to be some divergence between how the voronoi polygons get drawn and how the clusters are assigned, as you can see from some points not matching the background color here:

1 Like

Ooh awesome!! Tysm!

1 Like