js/plugins/trimTimeline.js
function getXPosAdjustedForKink(pos) {   
    var first = clinicalTimelineUtil.getLowerBoundIndex(ticksToShow, pos);
    var second = first + 1;

    if (second > ticksToShow.length - 1) {
      return tickCoordinatesKink[first];
    }
    return tickCoordinatesKink[first] + (pos - ticksToShow[first]) * (tickCoordinatesKink[second] - tickCoordinatesKink[first]) / (ticksToShow[second] - ticksToShow[first]);
  }
function getXPosAdjustedForKink(pos) {   
    var first = clinicalTimelineUtil.getLowerBoundIndex(ticksToShow, pos);
    var second = first + 1;

    if (second > ticksToShow.length - 1) {
      return tickCoordinatesKink[first];
    }
    return tickCoordinatesKink[first] + (pos - ticksToShow[first]) * (tickCoordinatesKink[second] - tickCoordinatesKink[first]) / (ticksToShow[second] - ticksToShow[first]);
  }
function getXPosAdjustedForKink ( pos ) { var first = clinicalTimelineUtil . getLowerBoundIndex ( ticksToShow , pos ) ; var second = first + 1 ; if ( second > ticksToShow . length - 1 ) { return tickCoordinatesKink [ first ] ; } return tickCoordinatesKink [ first ] + ( pos - ticksToShow [ first ] ) * ( tickCoordinatesKink [ second ] - tickCoordinatesKink [ first ] ) / ( ticksToShow [ second ] - ticksToShow [ first ] ) ; }
returns updated x coordinate for the data elements according to th trimmed timeline
@param  {int} pos starting time of the clinical timeline element
@return {int}     updated x coordinate post-trimming
returns updated x coordinate for the data elements according to th trimmed timeline