Skip to content

Instantly share code, notes, and snippets.

@ejfox
Created October 15, 2012 06:29
Show Gist options
  • Select an option

  • Save ejfox/3891073 to your computer and use it in GitHub Desktop.

Select an option

Save ejfox/3891073 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7034722222222245,"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}
// Responsive color tributary example
// Resize code panel to see effect
var sw = tributary.sw * 1.1;//parseInt(d3.select("svg").style("width"))
//make z sin waves extend past the width a little
//sw += .1 * sw
var sh = tributary.sh;//parseInt(d3.select("svg").style("height"))
var svg = d3.select("svg")
.append("svg:g")
var chart = svg.append("g").attr("id", "chart")
var color = d3.scale.linear()
.domain([0, 1300])
//.interpolate(d3.interpolateRgb)
.interpolate(d3.interpolateHsl)
.range(['#D40067', "#29B0FF"])
chart.append("rect").attr({
width: 1300,
height: 1300,
fill: color(sw)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment