Refactor edge drawing to connect to ports