Skip to content

Instantly share code, notes, and snippets.

@Andrew-Reid
Andrew-Reid / index.html
Created March 15, 2021 03:43
Key function
<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 January 1, 2020 05:30
D3 line module test w/Canvas
(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 December 18, 2019 06:10
D3-Fuse Clustering with pie charts
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Andrew-Reid
Andrew-Reid / d3-fuse.js
Last active December 18, 2019 02:16
D3-Fuse Demo
/*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 June 28, 2019 23:36
Transitioning Numbers
<!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 February 5, 2019 22:03
d3 geographic tile sets
// 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 February 4, 2019 20:05
Moon Color Hillshade Tileset
// 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 February 2, 2019 02:12
D3-slippy map with canvas tiles
// 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 September 17, 2018 03:28
A Fair Number of Transitions
<!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 February 19, 2019 05:57
d3-slippy: Constraining Zoom/Pan
// 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