Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createScaleFromType<output>(type: ScaleType) {
switch (type) {
case ScaleType.LINEAR:
return scaleLinear<output>();
case ScaleType.LOG:
return scaleLog<output>();
case ScaleType.POW:
return scalePow<output>();
case ScaleType.SQRT:
return scaleSqrt<output>();
case ScaleType.SYMLOG:
return undefined;
case ScaleType.TIME:
return scaleTime<output>();
case ScaleType.UTC:
return scaleUtc<output>();
case ScaleType.QUANTILE:
return scaleQuantile<output>();
case ScaleType.QUANTIZE:</output></output></output></output></output></output></output></output>
case 'Y':
case 'Numeric':
return ScaleType.POINT;
case 'Color':
case 'Category':
return ScaleType.ORDINAL;
default:
}
} else if (dataType === 'quantitative') {
switch (channelType) {
case 'XBand':
case 'YBand':
case 'X':
case 'Y':
case 'Numeric':
return ScaleType.LINEAR;
case 'Color':
return isBinned ? ScaleType.LINEAR : ScaleType.BIN_ORDINAL;
default:
}
} else if (dataType === 'temporal') {
switch (channelType) {
case 'XBand':
case 'YBand':
case 'X':
case 'Y':
case 'Numeric':
return ScaleType.TIME;
case 'Color':
return ScaleType.LINEAR;
default:
}