

Visualizing sorting algorithms with Hilbert curve - simonb
http://corte.si/posts/code/sortvis-fruitsalad/index.html

======
ZeroGravitas
What's the reasoning for not just using points from a continuous spectrum? His
approach tries to both make adjacent colors distinct while also making them
blend well with nearby colors, which he admits are contradictory goals.

~~~
jacabado
The reason is one wouldn't be able to distinguish, at least as easily as in
his visualizations, single data points.

It's a clever way to automatically create visual classifications of random-
sized collections of data points. The goals are not contradictory, they just
constraint each other.

~~~
ZeroGravitas
I understand that it helps separate colours from their neighbours, but I don't
understand why that helps this particular visualisation. Particularly if
there's no obvious way to determine at a glance whether the colour is 'higher'
or 'lower' than the one next to it.

For the sorting diagrams these colours start out random and end up sorted, in
neither case, nor in the transition period in-between, do I see an obvious
benefit to this method of choosing colors.

~~~
cortesi
Hey, as I say in the post - I make no claims whatsoever for the
visualisations. They were strictly for fun, and I'm a bit surprised to find
them on HN. However... choosing colours along the Hilbert traversal of the RGB
cube is good if you want a sequence of many colours that are maximally
distinct, where similar colours (here "similarity" is their distance from each
other in the RGB cube) are as close as possible to each other in the sequence.
In fact, the Hilbert curve's properties guarantee that this sequence will be
near optimal - we don't know how to do better without restricting ourselves to
some subset of the RGB cube.

~~~
ZeroGravitas
That's cool. I'm interested, but totally unschooled, when it comes to
visualisation stuff so I just thought I was missing something that would be
obvious to others.

I'm now wondering if this could be applied to choosing colours for auto-
generated pie charts, bar charts or map keys and similar.

------
sp332
Upvoted for "Mallory-Chicken Impetus."

