zoomfunction for ld-plot is working

ld plot is now working and has a resonable scaling in unzoomed and zoomed mode of the arc plot.
Overly complicated now?

    if(arr.length == 0)
      return [];
    arr = arr.sort( function (a, b) { return a.id - b.id; });
    var ret = [arr[0]];
    for (var i = 1; i < arr.length; i++) {
       if (arr[i-1] !== arr[i]) {
           ret.push(arr[i]);
       }
    }
    return ret;