in src/utils/Data.js [89:106]
export function inferDataType(data, accessor = identity) {
if (!Array.isArray(data))
throw new Error('inferDataType expects a data array');
else if (data.every((d, i) => accessor(d, i) === undefined))
return 'categorical';
// should this be allowed?
else if (
data.every(
(d, i) => isNumber(accessor(d, i)) || accessor(d, i) === undefined,
)
)
return 'number';
else if (
data.every((d, i) => isDate(accessor(d, i)) || accessor(d, i) === undefined)
)
return 'time';
else return 'categorical';
}