I was confused how rangeRoundBands differed from rangeBands so made this example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Underscore function to rotate an array | |
* See also _.cycle https://gist.github.com/901648 | |
* | |
* _.rotate([1, 2, 3, 4, 5]); | |
* => [2, 3, 4, 5, 1] | |
* _.rotate([1, 2, 3, 4, 5], 3); | |
* => [4, 5, 1, 2, 3] | |
* _.rotate([1, 2, 3, 4, 5], -3); | |
* => [3, 4, 5, 1, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<style type="text/css"> | |
body { | |
font: 10px sans-serif; | |
margin: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from https://github.com/mbostock/d3/blob/master/src/svg/axis.js | |
var circleLegend = function() { | |
'use strict'; | |
var scale, | |
orient = 'left', | |
tickPadding = 3, | |
tickExtend = 5, | |
tickArguments_ = [10], | |
tickValues = null, |
I love D3's Quantitative Scales and wanted a simple way to create and use scales in that style.
var centigradeToFahrenheit = new Scale().domain(-40, 0).range(-40, 32);
var fahrenheitToCentigrade = new Scale().domain(-40, 32).range(-40, 0);
centigradeToFahrenheit(35); // 95 hot!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* base58.js | |
* - encodes integers to and decodes from a base58 (or your own) base58 alphabet | |
* - based on Flickr's url shortening | |
* | |
* usage: | |
* base58.encode(integer); | |
* base58.decode(string); | |
* | |
* (c) 2012 inflammable/raromachine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: cc-by-4.0 |
I hereby claim:
- I am aubergene on github.
- I am aubergene (https://keybase.io/aubergene) on keybase.
- I have a public key whose fingerprint is CFF8 6FAB 5F1B A3A5 0640 7579 94D4 9589 076F 86CF
To claim this, I am signing this object:
I wanted to recreate the three example arrows on this page in SVG. So far the middle one is elluding me.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
border: "no" | |
license: cc-by-4.0 |
OlderNewer