How to rotate svg screen using a mouse click in D3? any working example? [closed]

I want to rotate the whole SVG screen using a mouse click on the middle of the screen or a button click. The idea is, when I will click the button using the mouse, my whole screen will rotate 90 degrees.
I have found many examples in the stackoverflow where a particular box or arrow is rotated. But I want to rotate the full screen.
Any working example would be great.