View base64.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function encode(s) { | |
var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", | |
o = []; | |
for (var i = 0, n = s.length; i < n;) { | |
var c1 = s.charCodeAt(i++), | |
c2 = s.charCodeAt(i++), | |
c3 = s.charCodeAt(i++); | |
o.push(c.charAt(c1 >> 2)); | |
o.push(c.charAt(((c1 & 3) << 4) | (c2 >> 4))); | |
o.push(c.charAt(i < n + 2 ? ((c2 & 15) << 2) | (c3 >> 6) : 64)); |
View perlin-worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onmessage = function(e) { | |
var data = e.data.data = [], | |
n = Math.pow(2, 7 - e.data.zoom), | |
x0 = e.data.column * n, | |
y0 = e.data.row * n, | |
w = e.data.size.x, | |
h = e.data.size.y; | |
for (var y = 0, i = 0; y < h; y++) { | |
for (var x = 0; x < w; x++) { |
View app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: polymaps | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /state/.* | |
script: main.py | |
- url: /county/.* |
View jsonp.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Queue.js b/src/Queue.js | |
index d243c13..616dbc6 100644 | |
--- a/src/Queue.js | |
+++ b/src/Queue.js | |
@@ -99,5 +99,41 @@ po.queue = (function() { | |
return {abort: abort}; | |
} | |
- return {text: text, xml: xml, json: json, image: image}; | |
+ function jsonp(src, callback) { |
View gist:619560
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote add mbostock git@github.com:mbostock/polymaps.git | |
git fetch mbostock | |
git merge --no-commit --no-ff mbostock/master | |
mate -w src/start.js | |
make | |
git add . | |
git commit |
View gist:672899
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Pointing</title> | |
<script type="text/javascript" src="http://github.com/mbostock/protovis/raw/v3.3.1/protovis.js"></script> | |
<style type="text/css"> | |
#fig { | |
width: 450px; | |
height: 425px; | |
} |
View transition-end.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3_transitionPrototype.end = function() { | |
var subgroups = [], | |
subgroup, | |
subnode, | |
node; | |
for (var j = -1, m = this.length; ++j < m;) { | |
subgroups.push(subgroup = []); | |
for (var group = this[j], i = -1, n = group.length; ++i < n;) { | |
if (node = group[i]) { |
View pie.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3.mbostock.pie = function() { | |
var pie = {}, | |
parent, | |
data; | |
var svg = d3.create("svg:svg"); | |
function redraw() { | |
return pie; | |
} |
View adopt.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/create.js b/src/core/create.js | |
new file mode 100644 | |
index 0000000..a284a67 | |
--- /dev/null | |
+++ b/src/core/create.js | |
@@ -0,0 +1,5 @@ | |
+d3.create = function(name) { | |
+ return d3.select((name = d3.ns.qualify(name)).local | |
+ ? document.createElementNS(name.space, name.local) | |
+ : document.createElement(name)); |
View dabblet.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; |
OlderNewer