concatDataset = datasets => {
  const fieldsArr = datasets.map(d => d.fields);
  let dataLength;
  const columnsArr = datasets.map((d, i) => {
    assert(d.columns[0].length > 0, `dataset[${i}] must by non-empty`);

    dataLength = dataLength || d.columns[0].length;
    assert(
      dataLength === d.columns[0].length,
      `datasets must have the same row count`
    );
    return d.columns;
  });
  return {
    fields: [].concat.apply([], fieldsArr),
    columns: [].concat.apply([], columnsArr),
  };
}
concat an array of datasets
@param {Array<Object>} datasets array of datasets, each contains {columns, fields}
@returns {Obeject} dataset, contains {columns, fields}