Skip to content

Instantly share code, notes, and snippets.

@nachocab
Created May 19, 2013 16:33
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 nachocab/5608169 to your computer and use it in GitHub Desktop.
Save nachocab/5608169 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"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}
var margin = {top: 200, right: 10, bottom: 200, left: 10},
width = 960 - margin.right - margin.left,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.linear()
.domain([.05, .95])
.range([0, width]);
var y = d3.scale.linear()
.range([0, height]);
var svg = d3.select("svg")
.attr("width", width + margin.right + margin.left)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.append("rect")
.attr("width", width)
.attr("height", height);
svg.append("g")
.attr("class", "x grid")
.attr("transform", "translate(0," + height + ")")
.call(d3.svg.axis().scale(x).tickSubdivide(1).tickSize(-height));
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(d3.svg.axis().scale(x));
body {
font: 10px sans-serif;
}
rect {
fill: #ddd;
}
.grid line {
stroke: #fff;
}
.grid line.minor {
stroke-width: .5px;
}
.grid text {
display: none;
}
.axis line {
stroke: #000;
}
path {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment