When attacking with Two-Weapon Fighting, can you break up your movement and attack a different target?

When you get the Extra Attack action, you can break up your movement and attack different targets at varying distances from your starting point.

Does the same apply with TWF? As in, can I approach my first target, use my attack action, then move, and use my bonus action to attack a different target?

From PHB 195:

“When you take the Attack action and attack with a light melee weapon that you’re holding in one hand, you can use a bonus action to attack with a different light melee weapon that you’re holding in the other hand.”

The key seems to be how to interpret “when:” either “immediately after” or “whenever (during your turn).”