Skip to content

Instantly share code, notes, and snippets.

View jdarling's full-sized avatar

Jeremy Darling jdarling

View GitHub Profile
@jdarling
jdarling / randomcolors.js
Created June 5, 2014 20:22
Generation of complementary colors
// Adapted from http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
var randomColor = (function(){
var golden_ratio_conjugate = 0.618033988749895;
var h = Math.random();
var hslToRgb = function (h, s, l){
var r, g, b;
if(s == 0){
@jdarling
jdarling / index.html
Last active November 16, 2022 14:13
Reuseable D3 MindMap (left/right tree)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
.node circle {
cursor: pointer;
fill: #fff;
stroke: steelblue;
@jdarling
jdarling / data.json
Last active November 6, 2023 16:03
D3 MindMap
{
"name": "Root",
"children": [
{
"name": "Branch 1",
"children": [
{"name": "Leaf 3"},
{"name": "Leaf 4"}
]
},
@jdarling
jdarling / gist:5624526
Last active December 17, 2015 14:29
Quick and dirty process management that we used to use. Shared for the Node.js Meetup
var _children = [];
var Beaker = function(){
};
isNumeric = function(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
};
Beaker.startChild = function(fileName, callback){
@jdarling
jdarling / Object.observe.poly.js
Created November 30, 2012 02:00
Initial Object.observe polyfill/shim trying to be compliant
/*
Migrated to: https://github.com/jdarling/Object.observe
Tested against Chromium build with Object.observe and acts EXACTLY the same,
though Chromium build is MUCH faster
Trying to stay as close to the spec as possible,
this is a work in progress, feel free to comment/update
http://wiki.ecmascript.org/doku.php?id=harmony:observe
@jdarling
jdarling / data.json
Created June 13, 2012 15:40
Using D3 to create a Bullseye or Layered Harvey Ball charts
[
{
"name":"Test App 1",
"children":[
{"name":"Configurations","progress":1},
{"name":"UI","progress":1},
{"name":"Backend","progress":0.25}
]
},
{
@jdarling
jdarling / bracket.json
Created April 26, 2012 21:55
D3 Bracket Layout - data
{
"name": "Overall Winner",
"winners": [
{
"name": "Winner Left 1",
"winners": [
{"name": "Winner Left 3"},
{"name": "Winner Left 4"}
]
},