This is a simple example showing how you can calculate the necessary angle of rotation from a touch interaction utilizing d3.touches. The slope of the initial position of the line created from the first two touch fingertips is stored and compared to the slope of the current position of the line from those two inputs.
Notice that you need to use three fingers to signal that you’re “rotating” (instead of, say, zooming or panning) even though the actual rotation calculation ignores the third fingertip.