Skip to content

Instantly share code, notes, and snippets.

@heracek
Created July 11, 2012 11:27
Show Gist options
  • Save heracek/3089768 to your computer and use it in GitHub Desktop.
Save heracek/3089768 to your computer and use it in GitHub Desktop.
just another inlet to tributary
var svg = d3.select("svg")
var rectBar = function(svg, x, y, width, height, color) {
return svg.append("svg:rect")
.attr("x", x + 0.5)
.attr("y", y + 0.5)
.attr("width", width)
.attr("height", height)
.style("fill", color)
.style("stroke", 'black')
.style('stroke-width', 1)
.style("opacity", 1);
};
var redBar = rectBar(svg, 5, 5, 130, 20, 'red');
var greenBar = rectBar(svg, 5 + 130, 5, 160, 20, 'green');
var sliderBar = rectBar(svg, 100, 0, 10, 30, 'brown');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment