Skip to content

Instantly share code, notes, and snippets.

@Vextasy
Created March 31, 2014 14:18
Show Gist options
  • Save Vextasy/9893308 to your computer and use it in GitHub Desktop.
Save Vextasy/9893308 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}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true}
var svg = d3.select("svg");
var data = tributary.pics.data.children;
data.forEach(function(d) {
d.data.created *= 1000
})
var extent = d3.extent(data, function(d) {
return d.data.created
})
var scale = d3.time.scale()
.domain(extent)
.range([10, 463]);
var brush = d3.svg.brush()
brush.x(scale)
var g = svg.append('g');
brush(b)
g.attr('transform', 'translate(50, 100)')
g.selectAll('rect').attr('height', 30);
g.selectAll('.background')
.style({fill: '#4b9e9e', visibility: 'visible'})
g.selectAll('.extent')
.style({fill: '#78c5c5', visibility: 'visible'})
g.selectAll('.resize rect')
.style({fill: '#276c86', visibility: 'visible'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment