Skip to content

Instantly share code, notes, and snippets.

@mlem
mlem / README.md
Last active October 21, 2015 23:38 — forked from mbostock/.block
Hexagon Mesh

Click and drag above to paint red hexagons. A black outline will appear around contiguous clusters of red hexagons. This outline is constructed using topojson.mesh, part of the TopoJSON client API. A filter is specified so that the mesh only contains boundaries that separate filled hexagons from empty hexagons.

The hexagon grid itself is represented as TopoJSON, but is constructed on-the-fly in the browser. Since TopoJSON requires quantized coordinates, the hexagon grid is represented as integers, with each hexagon of dimensions 3×2. Then a custom projection is used to transform these irregular integer hexagons to normal hexagons of the desired size.

@mlem
mlem / yinyang.css
Last active August 26, 2015 09:38 — forked from felipecabargas/yinyang.css
Yin-Yang Pure CSS
#olaquehace {
width: 100px; height: 200px;
background: #F6020C;
border-color: #00F900;
border-style: solid;
border-width: 2px 100px 2px 2px;
border-radius: 100%;
position: relative;
}