Cluster datapoints into lines