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
// 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, |
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
/** | |
* 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] |
NewerOlder