Skip to main content
100%

Animation

✓ Published0🌍 Public
RRobinL
Last edited Jul 14, 2013
Created on Jul 14, 2013

A small orange square is animated across an SVG canvas using a simple repeating timer. The code draws a single rectangle with d3, then updates its horizontal x position every 10 milliseconds via setInterval, incrementing the coordinate each tick. The animation moves the square steadily from left to right without any interaction, pausing or restarting. This example demonstrates the most basic form of programmatic animation in d3, relying on JavaScript's global timer rather than d3's transition system.

AI-generated description

Similar vizzes