block by patricksurry 7089206

Force layout with dynamic distance function

Full Screen

Click and drag to move states around. Move slider to modify distance function

Fork of mbostock’s force layout example (http://bl.ocks.org/mbostock/1073373) with a few experimental changes.

Create links between neighbouring states (inferred from topojson mesh) rather than from Voronoi triangles which add some unstable cross-country links like Maine-Washington. Parameterize distance function with a slider (0 = spatial similarity only, 1 = more variation based on type similarity).

index.html

d3.slider.css

d3.slider.js