Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active December 18, 2015 07:49
Show Gist options
  • Save mbostock/b4e46124258d1b75accb to your computer and use it in GitHub Desktop.
Save mbostock/b4e46124258d1b75accb to your computer and use it in GitHub Desktop.
Transition Test
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>
var width = 960,
height = 500;
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
var slider = svg.append("g")
.attr("class", "slider");
slider.append("rect")
.attr("width", 100)
.attr("height", 100);
slider.transition()
.duration(1000)
.attr("transform", "translate(100,0)");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment