Skip to content

Instantly share code, notes, and snippets.

@remysucre
Last active June 27, 2018 18:48
Show Gist options
  • Save remysucre/3e7eb64114670ca6b717ebd19886ad6a to your computer and use it in GitHub Desktop.
Save remysucre/3e7eb64114670ca6b717ebd19886ad6a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Examples of D3 transitions</title>
<style>
svg {
border: 1px solid black;
}
fieldset {
min-width: 0;
width: 50%;
}
</style>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
function runTransitions(){
var pathTransition = d3.select("path").transition();
var rectTransition = d3.select("rect").transition();
var circleTransition = d3.select("circle").transition();
pathTransition.attr("transform", "translate(250, 50)").duration(1000);
rectTransition.attr("transform", "translate(150)").duration(1000);
circleTransition.attr("transform", "translate(150)").duration(1000);
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment