Skip to content

Instantly share code, notes, and snippets.

@Andrew-Reid
Andrew-Reid / index.html
Last active February 22, 2020 14:56
Leaflet and Popup with D3
<!DOCTYPE html>
<html>
<head>
<title>Leaflet with D3 popups</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.13.0/d3.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" crossorigin=""></script>
@Andrew-Reid
Andrew-Reid / chevronArcv2.js
Last active January 6, 2020 08:55
Chevrons and Arcs 2
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-path'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3));
}(this, (function (exports,d3Path) { 'use strict';
var constant$1 = function(x) {
return function constant() {
return x;
};
@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 October 26, 2019 07:07
Tidy Tree vs Dendogram
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.node circle {
fill: #fff;
stroke: steelblue;
@Andrew-Reid
Andrew-Reid / buffer.json
Last active October 23, 2019 22:43
Text Along Topojson Features
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 / 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 / Thumbs.db
Last active February 19, 2019 23:37
Pie Chart Rotation on Click
@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