Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (dataType === 'nominal' || dataType === 'ordinal') {
switch (channelType) {
// For positional (x and y) ordinal and ordinal fields,
// "point" is the default scale type for all marks
// except bar and rect marks, which use "band" scales.
// https://vega.github.io/vega-lite/docs/scale.html
case 'XBand':
case 'YBand':
return ScaleType.BAND;
case 'X':
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) {
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:
return scaleQuantize<output>();
case ScaleType.THRESHOLD:
return scaleThreshold();
case ScaleType.BIN_ORDINAL:
return scaleOrdinal<{ toString(): string }, Output>();
case ScaleType.ORDINAL:
return scaleOrdinal<{ toString(): string }, Output>();
case ScaleType.POINT:
return scalePoint<{ toString(): string }>();
case ScaleType.BAND:
return scaleBand<{ toString(): string }>();
default:
return undefined;
}
}
</output></output></output></output></output>