Skip to content

Instantly share code, notes, and snippets.

View index.html
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>
<script>
var svg = d3.select("body")
.append("svg")
.attr("width", 960)
@Andrew-Reid
Andrew-Reid / funkyline.js
Created Jan 1, 2020
D3 line module test w/Canvas
View funkyline.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3'], factory) :
(global = global || self, factory(global.d3 = global.d3 || {}, global.d3$1));
}(this, function (exports, d3$1) { 'use strict';
function funkyLine(context) {
var referenceMargin = 10;
var interval = 10;
@Andrew-Reid
Andrew-Reid / LondonReligions.geojson
Last active Dec 18, 2019
D3-Fuse Clustering with pie charts
View LondonReligions.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View d3-fuse.js
/*v0.0.2*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-quadtree')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3)); }(this, (function (exports,d3Quadtree) { 'use strict';
var c = function(f) { return (typeof f == "function") ? f : (function() { return f; }) }
var fuse = function(n) {
var nodes = n || [], padding = 0, pi = Math.PI;
@Andrew-Reid
Andrew-Reid / index.html
Last active Jun 28, 2019
Transitioning Numbers
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<div></div>
<script src="https://d3js.org/d3.v4.js"></script>
<script>
var svg = d3.select("div")
.append("svg")
@Andrew-Reid
Andrew-Reid / d3-slippy.js
Last active Feb 5, 2019
d3 geographic tile sets
View d3-slippy.js
// Andrew Reid 2018
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3));
}(this, function (exports) { 'use strict';
function geoTile() {
// Basic Constants
@Andrew-Reid
Andrew-Reid / d3-slippy.js
Last active Feb 4, 2019
Moon Color Hillshade Tileset
View d3-slippy.js
// Andrew Reid 2018
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3));
}(this, function (exports) { 'use strict';
function geoTile() {
// Basic Constants
@Andrew-Reid
Andrew-Reid / d3-slippy.js
Last active Feb 2, 2019
D3-slippy map with canvas tiles
View d3-slippy.js
// Andrew Reid 2018
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3));
}(this, function (exports) { 'use strict';
function geoTile() {
// Basic Constants
@Andrew-Reid
Andrew-Reid / index.html
Last active Sep 17, 2018
A Fair Number of Transitions
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<canvas id="canvas" width="960" height="960"></canvas>
<script>
var total = 100000;
var points = new Array(total);
var lengths = [];
for (var i = 0; i < total; i++) {
@Andrew-Reid
Andrew-Reid / d3-slippy.js
Last active Feb 19, 2019
d3-slippy: Constraining Zoom/Pan
View d3-slippy.js
// Andrew Reid 2018
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3));
}(this, function (exports) { 'use strict';
function geoTile() {
// Basic Constants