This example demonstrates accelerated two-dimensional filtering enabled by d3.geom.quadtree. A quadtree recursively subdivides square cells into four equal-sized subcells. Each leaf node of the quadtree contains a single point. If a given quadtree cell does not intersect the brush extent, then none of the points contained in that subtree can be selected, and thus do not need to be scanned. Above, orange indicates points that are scanned but not selected. Without a quadtree, all points would need to be scanned!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title></title> | |
<style type="text/css"> | |
.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap: break-word; } | |
.body_foreground { color: #AAAAAA; } | |
.body_background { background-color: #000000; } | |
.body_foreground > .bold,.bold > .body_foreground, body.body_foreground > pre > .bold { color: #FFFFFF; font-weight: normal; } |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title></title> | |
<style type="text/css"> | |
.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap: break-word; } | |
.body_foreground { color: #AAAAAA; } | |
.body_background { background-color: #000000; } | |
.body_foreground > .bold,.bold > .body_foreground, body.body_foreground > pre > .bold { color: #FFFFFF; font-weight: normal; } |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title></title> | |
<style type="text/css"> | |
.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap: break-word; } | |
.body_foreground { color: #AAAAAA; } | |
.body_background { background-color: #000000; } | |
.body_foreground > .bold,.bold > .body_foreground, body.body_foreground > pre > .bold { color: #FFFFFF; font-weight: normal; } |
#!/usr/bin/env node | |
var readline = require('readline'); | |
var devnull = require('dev-null'); | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: devnull() | |
}); |
Quick TopoJSON vector tile demo map, derived from an earlier GeoJSON demo. Original README follows.
A goofy slippy map of various vector tile data sources. With some fun colours, greetz to Aaron and Mike and Mike and the whole Prettymaps crew.
[+d3](javascript:(function()%7Bfunction callback()%7Bfunction noop() %7B%7D%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"http%3A%2F%2Fd3js.org%2Fd3.v3.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)())
(defn debounce [func wait immediate] | |
(let [timeout (atom nil)] | |
(fn [] | |
(this-as this | |
(let [context this | |
args js/arguments | |
later (fn [] | |
(reset! timeout nil) | |
(when-not immediate | |
(.apply func context args)))] |
2012 Mango Movement by Origin
This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.