transposeData = dataArray => {
  assert(
    dataArray.length && dataArray[0].length,
    'cannot transpose an array with dimension 0'
  );
  // instantiate an array of dataArray[0].length number of subarrays
  const result = dotRange(dataArray[0].length).map(_ => []);
  dataArray.forEach(arr => {
    arr.forEach((ele, j) => {
      result[j].push(ele);
    });
  });
  return result;
}
transpose an array of arrays of data
@param {Array<Array>} dataArray array of arrays of data
@returns array of arrays of data, elements at dataArray[i][j] will be at result[j][i]