Skip to content

Instantly share code, notes, and snippets.

@russelllim22
Last active September 4, 2021 10:41
Show Gist options
  • Save russelllim22/292b1159c8d2ea75b066f2a008b39afd to your computer and use it in GitHub Desktop.
Save russelllim22/292b1159c8d2ea75b066f2a008b39afd to your computer and use it in GitHub Desktop.
<head>
<script src="https://d3js.org/d3.v6.min.js"></script>
</head>
<body>
<svg>
<circle cx=50 cy=50 r=20 stroke=darkblue fill=lightblue></circle>
</svg>
<script>
d3.select("#blueCircle") // select the element using a css selector
.transition()
.duration(3000) // this transition will last 1500 seconds
.attr("cx", 250) // transition the cx attribute to 250
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment