Skip to content

Instantly share code, notes, and snippets.

@Vintharas
Last active August 21, 2019 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vintharas/803c45d9d41eea4e43da0f48861919da to your computer and use it in GitHub Desktop.
Save Vintharas/803c45d9d41eea4e43da0f48861919da to your computer and use it in GitHub Desktop.
Simple example circle
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
<svg></svg>
</head>
<body>
<script>
var svg = d3.select("svg");
var circle = svg.append('circle')
.attr('cx', 50)
.attr('cy', 50)
.attr('r', 25)
.attr('fill', 'blue')
circle
.transition().duration(1000)
.attr('r', 50)
.attr('cx', 70)
.attr('cy', 70)
.transition().duration(1000)
.attr('r', 25)
.attr('cx', 50)
.attr('cy', 50)
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment