Practicing event-driven JS with d3