Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (scaleType !== 'auto' && scaleType !== 'linear') {
return null;
}
if (tickCount && type === 'number' && originalDomain && (
originalDomain[0] === 'auto' || originalDomain[1] === 'auto')) {
// Calculate the ticks by the number of grid when the axis is a number axis
const domain = scale.domain();
const tickValues = getNiceTickValues(domain, tickCount, allowDecimals);
scale.domain(calculateDomainOfTicks(tickValues, type));
return { niceTicks: tickValues };
} if (tickCount && type === 'number') {
const domain = scale.domain();
const tickValues = getTickValuesFixedDomain(domain, tickCount, allowDecimals);
return { niceTicks: tickValues };
}
return null;
};
if (tickCount && type === 'number' && originalDomain && (
originalDomain[0] === 'auto' || originalDomain[1] === 'auto')) {
// Calculate the ticks by the number of grid when the axis is a number axis
const domain = scale.domain();
if (!domain.length) {
return null;
}
const tickValues = getNiceTickValues(domain, tickCount, allowDecimals);
scale.domain(calculateDomainOfTicks(tickValues, type));
return { niceTicks: tickValues };
} if (tickCount && type === 'number') {
const domain = scale.domain();
const tickValues = getTickValuesFixedDomain(domain, tickCount, allowDecimals);
return { niceTicks: tickValues };
}
return null;
};