Skip to content

Instantly share code, notes, and snippets.

@syntagmatic
syntagmatic / README.md
Last active December 22, 2017 12:59 — forked from mbostock/.block
Hexbin Heightmap
@syntagmatic
syntagmatic / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block
VFINX 500 Treemap
@syntagmatic
syntagmatic / README.md
Last active August 29, 2015 14:02 — forked from mbostock/.block
Reddit Treemap 2
We couldn’t find that file to show.
@syntagmatic
syntagmatic / README.md
Last active August 29, 2015 14:02 — forked from mbostock/.block
Reddit Treemap
@syntagmatic
syntagmatic / README.md
Last active November 14, 2017 06:13 — forked from mbostock/.block
d3.horizon Example

Attempting to reimplement the stocks example from Cubism with the d3.horizon plugin.

A few notes so far:

  • d3.horizon does not expose d3.scales, which makes it hard to create axes
  • d3.horizon seems to expect an array of data which map to pixels. It would be more convenient the days in the year didn't have to be enumerated in this example, to fill in gaps. Without doing this, the chart appears to render fine but lacks gaps and is therefore wrong if the x-axis is a linear timecale.
@syntagmatic
syntagmatic / README.md
Last active December 25, 2015 08:09 — forked from mbostock/.block
Canvas Force-Directed Graph
@syntagmatic
syntagmatic / README.md
Last active July 18, 2019 10:59 — forked from mbostock/.block
Github Users Worldwide
@syntagmatic
syntagmatic / README.md
Last active December 23, 2015 13:59 — forked from mbostock/.block
Selecting Countries on a Canvas Globe

Uses a second canvas with different fill colors for each country to detect which country is highlighted.

@syntagmatic
syntagmatic / index.html
Last active May 31, 2016 23:27 — forked from mbecica/index.html
Hyperbolic Grid
<!DOCTYPE HTML>
<head>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<canvas width=1000 height=600></canvas>
<script type="text/javascript">
var canvas = d3.select("canvas").node();
var xgrid = 10,
ygrid = 10,
@syntagmatic
syntagmatic / README.md
Last active December 22, 2015 06:39 — forked from mbostock/.block
Voronoi Lookup

Added hover highlighting to Voronoi Mitchell’s best-candidate by searching for the closest point with d3.geom.quadtree.

An improvement would be rendering highlighted cells in a separate canvas, so that they could be cleared without redrawing the entire Voronoi. This version leaves artifacts behind which get eaten away by new voronoi cells.