function columnsAndFieldsFromX(x) {
  const columns = [];
  let fields = [];

  const xFieldNames = Object.keys(x[0]);
  xFieldNames.forEach(fieldName => {
    const featureData = x.map(row => row[fieldName]);
    const field = computeFeatureMeta(fieldName, featureData);
    if (field.type !== null) {
      columns.push(featureData);
      fields.push(computeFeatureMeta(fieldName, featureData));
    }
  });

  return {
    columns,
    fields,
  };
}
get columns and fields from feature data
@param {Array<Object>} x feature data, objects are rows, object keys are feature names
@return {Object} {columns - array of array of columns; fields: array of field metadata} in the same order