Retracts: graphs and ordered sets from the metric point of view