Drawing the graph with d3 (v4), you can put the zoom function by simple coding, you can control with mouse drag and mouse wheel. However, when I use the zoom function, I want to return to the state before using the zoom function, and such function can be easily returned to the next coding.
svg.transition (). call (zoom.transform, d3.zoomIdentity);
This will return you to before you use the zoom feature. I do not know version 3 (v3) of d3, but it seems to have been simplified to version 4 (v4).