All examples By author By category About

puzzler10

d3v4 - zoom and drag circles - drag adjusted for zoom

Example of zoom and drag in d3 v4.

This example has a modified drag function so that when you zoom in, you're still able to drag the circles to the correct mouse location. Here's an example of the drag problem.

It's not an easy way to do this task. Read this for an easier and better way, as well as an explanation of this code.