Skip to content

Instantly share code, notes, and snippets.

View RandomEtc's full-sized avatar
🦕

Tom Carden RandomEtc

🦕
View GitHub Profile
@RandomEtc
RandomEtc / README.md
Last active October 12, 2015 16:08 — forked from mbostock/.block
Tissot's Indicatrices
@RandomEtc
RandomEtc / README.md
Last active February 12, 2017 15:39
Advanced object constancy.

Fine-grained control of randomly entering and exiting things in D3.js, for impeccable object constancy. Adapted from an example co-authored with Mike Bostock.

@RandomEtc
RandomEtc / README.md
Last active December 17, 2015 05:59 — forked from mbostock/.block

An exploration of Mike Bostock's take on Ben Fry’s zipdecode, inspired by Nelson Minar’s reimplementation. This one uses deeply nested SVG elements and classes to target only the things that need to change.

Nesting the SVG made DOM creation bearable, but this is still too slow. Use Mike's canvas approach if you're looking for the "best" way to do this.

@RandomEtc
RandomEtc / circles.js
Created August 12, 2013 16:35
Sketch for a 'watch' function on d3 selctions...
var data = [ ],
width = 500,
height = 500,
id = 0;
function addRandom() {
data.push({
x: width * Math.random(),
y: height * Math.random(),
r: 10 * Math.random(),
@RandomEtc
RandomEtc / tile_maps.rb
Created December 30, 2013 07:40
Mercator Map Tile functions for Ruby
TILE_SIZE = 256.0
PX_TO_COORD = 1.0 / TILE_SIZE
RAD_2_DEG = 180.0 / Math::PI
DEG_2_RAD = Math::PI / 180.0
TWO_PI = Math::PI * 2.0
MAX_ZOOM = 20
module TileMaps
def lng_lat_to_mercator(lng, lat)
# turn degrees into radians
@RandomEtc
RandomEtc / README.md
Last active May 9, 2017 19:24
D3 Bar Chart Update Pattern
@RandomEtc
RandomEtc / index.html
Created January 29, 2015 19:37
Line graph noodling
<!DOCTYPE html>
<meta charset="utf-8">
<style>
html, body { margin: 0; }
.line {
fill: none;
stroke-width: 2.0;
}
.axis .tick line, .axis path.domain {
@RandomEtc
RandomEtc / .gitignore
Last active July 11, 2018 04:42
D3 Australia Conformal Conic
australian-states.json
ne_10m_admin_1_states_provinces_lakes.geojson
ne_10m_admin_1_states_provinces_lakes.geojson.gz
@RandomEtc
RandomEtc / index.html
Created January 21, 2016 05:45 — forked from anonymous/index.html
Ember Starter Kit // source http://emberjs.jsbin.com/nibosocevi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://builds.emberjs.com/tags/v1.13.5/ember-template-compiler.js"></script>
<script src="http://builds.emberjs.com/tags/v1.13.5/ember.debug.js"></script>
<style id="jsbin-css">