This diagram is completely incorrect!
An S-trap is created by turning the pipe downward before venting it or, having too long of a horizontal run before the line is vented.
The diagrams below may offer some clarification.
Note use of an AAV is a poor substitute for a through the roof vent and may not be legal in all juristictions.
