code: function mergeData(timeserieses, range) {
    const reference = {revisions: {}};
    let cell;
    for (const timeseries of timeserieses) {
      for (const datum of timeseries) {
        if (datum.revision < range.min) {
          if (!reference.revision ||
              datum.revision < reference.revision) {
            reference.revision = datum.revision;
            // This might overwrite some or all of reference.revisions.
            Object.assign(reference.revisions, datum.revisions);
          }
          continue;
        }
  
        if (!cell) {
          cell = {...datum};
          cell.timestampRange = new tr.b.math.Range();
          if (cell.timestamp) {
            cell.timestampRange.addValue(cell.timestamp.getTime());
          }
          if (!cell.revisions) cell.revisions = {};
          continue;
        }
  
        TimeseriesMerger.mergeStatistics(cell, datum);
        if (datum.timestamp) {
          cell.timestampRange.addValue(datum.timestamp.getTime());
        }
  
        // TODO Uncomment when Histograms are displayed.
        // mergeHistograms(cell, datum);
  
        if (datum.revision > cell.revision) {
          cell.revision = datum.revision;
          Object.assign(cell.revisions, datum.revisions);
        }
  
        // TODO merge annotations
      }
    }
    return {reference, cell};
  }
docs: Merge across timeseries and data points to produce two data points {reference, cell}. This is different from TimeseriesMerger, which produces a series of data points for ChartTimeseries.