Skip to content

Instantly share code, notes, and snippets.

@spsaaibi
Created April 18, 2013 15:42
Show Gist options
  • Save spsaaibi/5413756 to your computer and use it in GitHub Desktop.
Save spsaaibi/5413756 to your computer and use it in GitHub Desktop.
simpleaxis
{"description":"simpleaxis","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
//Create the SVG Viewport selection
var svgContainer = d3.select("body").append("svg")
.attr("width", 400)
.attr("height", 100);
//Create the Scale we will use for the Axis
var axisScale = d3.scale.linear()
.domain([0, 100])
.range([0, 400]);
//Create the Axis
var xAxis = d3.svg.axis()
.scale(axisScale);
//Create an SVG group Element for the Axis elements and call the xAxis function
var xAxisGroup = svgContainer.append("g")
.call(xAxis);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment