Skip to content

Instantly share code, notes, and snippets.

View chabb's full-sized avatar
🏠
Working from home

Chabbey François chabb

🏠
Working from home
View GitHub Profile
@chabb
chabb / README.md
Last active August 29, 2015 14:04
Building Quadtree

This shows the building of the quadtree as points are added. The animation shows the traversal of the tree. A margin test is used to determine the good leaf to choose.

@chabb
chabb / README.md
Created August 5, 2014 18:24
Selection Sort

Selection Sort

This animation demonstrates the selection sort.

The main problem was to chain was to chain transition. I was doing a data join at every iteration, which discarded my current transition.

Instead, i just chained transition, and acceded the current state of the array in the transition.

Array is shuffled at the end of the algorithm. Note the filter() call on the transitions. Without the filter, sort() function would be called ten times, as there is ten .rect elements.

@chabb
chabb / README.md
Created August 6, 2014 06:36
Insertion Sort

Insertion Sort

This animation demonstrates the insertion sort.

@chabb
chabb / README.md
Created August 6, 2014 07:04
Bubble sort

Bubble Sort

This animation demonstrates Bubble sorting.

@chabb
chabb / README.md
Last active August 29, 2015 14:05
Quadtree points and parent nodes

I am toying with the d3 quadtree. A reference to the parent node have been added to each node. This visualisation traverses the points and highlight parent nodes

@chabb
chabb / README.md
Last active August 29, 2015 14:05
Quadtree, node removal

This visualisation removes point from the quadtree, and collapses nodes as necessary

@chabb
chabb / README.md
Last active August 29, 2015 14:05
k-Nearest-Neighbors

k-Nearest-Neighbors

Based on this tutorial

k is randomly choosen at every iteration.

@chabb
chabb / README.md
Last active March 21, 2017 12:27
Color scale

Color scale and pivot

You can easily create a color scale that map a particular domain of values. In this example, the number from 1 to 20 are mapped to the colors from white to blue.

You can even define a pivot in your scale; the color reaches its maximumal value at a given point of the domain, and then go back.

Click on the button to change the pivot

@chabb
chabb / README.md
Last active August 29, 2015 14:05
sin(2t), radial projection

This is a graph of the sin(2t) function in a radial view.

The curve is animated without interpolating the path.

See this example