Skip to content

Instantly share code, notes, and snippets.

@trinary
Created January 22, 2013 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trinary/4591566 to your computer and use it in GitHub Desktop.
Save trinary/4591566 to your computer and use it in GitHub Desktop.
ordinal domain, rangeRoundBands example from @mbostock's slides here: http://bost.ocks.org/mike/d3/workshop/
var x = d3.scale.ordinal()
.domain(["A", "B", "C", "D"])
.rangeRoundBands([0, 720], .2);
x("B"); // 206, bar position
x.rangeBand(); // 137, bar width
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment