Skip to content

Instantly share code, notes, and snippets.

View croogie's full-sized avatar

Michał Świtoń croogie

View GitHub Profile
@croogie
croogie / README.md
Last active August 29, 2015 14:18 — forked from mbostock/.block
D3: Named Transitions II

D3 3.5 allows concurrent transitions on the same element provided the transitions have different names. Here, the “position” transition moves the circles up or down, while the “size” transition makes the circles big or small. The names allow the two transitions to work concurrently without interrupting each other.

If named transitions aren’t used, then a later transition can interrupt an earlier transition, preventing it from completing. For example, if the size transition is started shortly after the position transition, it will prevent some of the circles from reaching the end position.

@croogie
croogie / README.md
Created April 6, 2015 11:39 — forked from mbostock/.block
D3: Non-Contiguous Cartogram

Unlike choropleth maps, cartograms encode data using area rather than color, resulting in distorted geographic boundaries. In this example, states are rescaled around their centroid, preserving local shape but not topology. Inspired by Zachary Johnson. Non-continguous cartogram design invented by Judy Olsen. U.S. state and county boundaries from the U.S. Census Bureau, simplified using GDAL and MapShaper.