block by nitaku 8031205

Fractal tree depth map (random, Gosper)

Full Screen

Full source, including python scripts, here.

An original extension of the fractal treemap technique shown in the previous example, this map shows the depth of each leaf (hexagon) using a color encoding. The result resembles an orographic, physical map (with tree depth in place of terrain elevation), while the fractal treemap resembles a political map.

The regions, forming a sort of contour map, are computed offline by running gosper_depth_contour_lines.py, a slightly modified version of the gosper_regions.py script that creates the treemap.

run gosper_regions.py
gosperify('tree_48207.csv', 'hexes.wkt.csv', 'depth_regions.json') # input tree, input tiling, output file
topojson --cartesian --no-quantization -p depth -o depth_regions.topo.json depth_regions.json

The random tree is the same of the previous example, containing 48,207 leaves (the script took about 10 hours to finish!).

The colors of the quantize scale are taken from Gretchen N. Peterson’s Cartographer’s Toolkit (page 38). The halo that makes the numbers in the legend readable is created by defining four text-shadows in CSS, a technique found here.

The obtained map is somehow uninteresting, showing an apparently uniform distribution of mountains and valleys. This has obviously something to do with the fact that the tree is randomly generated. A more interesting experiment will be to create such a map from real data.

As a way to obtain more readable regions, a depth-based tree ordering algorithm could be performed prior to feeding the tree into the system. This way, higher-depth regions (mountains) should be placed near to each other.

index.js

index.html

gosper_depth_contour_lines.py

index.coffee

index.css

index.sass