Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_getScaleCfg(type, field, data) {
const cfg = {
field
};
const values = Util.Array.values(data, field);
cfg.values = values;
if (!Scale.isCategory(type) && type !== 'time') {
const range = Util.Array.getRange(values);
cfg.min = range.min;
cfg.max = range.max;
cfg.nice = true;
}
if (type === 'time') {
cfg.nice = false;
}
return cfg;
}