Skip to content

Instantly share code, notes, and snippets.

View HarryStevens's full-sized avatar

Harry Stevens HarryStevens

View GitHub Profile
@1wheel
1wheel / README.md
Created March 3, 2018 05:24
flying-beeswarm

See beeswarm-path for a tidier implementation of beeswarm along a path.

@1wheel
1wheel / .gitignore
Last active September 13, 2018 01:11
rollup-nestby
node_modules
d3.js
@tophtucker
tophtucker / .DS_Store
Last active September 24, 2023 01:27
Measure text
@Thanaporn-sk
Thanaporn-sk / .block
Last active April 29, 2018 22:53
Individual to stacked area charts
license: mit
@emeeks
emeeks / d3.sankey.js
Last active September 14, 2020 16:49
Sankey Particles IV
d3.sankey = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
nodes = [],
links = [];
sankey.nodeWidth = function(_) {
if (!arguments.length) return nodeWidth;
<script type="text/javascript">
$(document).ready(function() {
// The event listener for the file upload
document.getElementById('txtFileUpload').addEventListener('change', upload, false);
// Method that checks that the browser supports the HTML5 File API
function browserSupportFileUpload() {
var isCompatible = false;
if (window.File && window.FileReader && window.FileList && window.Blob) {
@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
00622,17.991245, -67.153993
@jpoehls
jpoehls / gist:5521004
Created May 5, 2013 14:43
hasOwnProperty() example
function rightWay(obj) {
for (var key in obj) {
// Ignore properties that are inherited.
if (!obj.hasOwnProperty(key)) {
continue;
}
console.log(key);
}
}
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};