Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
var f = fieldDefs[i];
// Otherwise, assign i-th field
switch (f.type) {
// TODO: "D", "G"
case Type.QUANTITATIVE:
assignQ(i, hasAggr, autoMode);
break;
case Type.TEMPORAL:
assignT(i, hasAggr, autoMode);
break;
case Type.ORDINAL:
/* falls through */
case Type.NOMINAL:
/* falls through */
default:
tf[i] = f;
assignField(i + 1, hasAggr, autoMode);
break;
}
}
export let dimensionScore:any = function(fieldDef, channel, mark, stats, opt){
var cardinality = vlFieldDef.cardinality(fieldDef, stats);
switch (channel) {
case vlChannel.X:
if (fieldDef.type === Type.NOMINAL || fieldDef.type === Type.ORDINAL) {
return D.pos - D.minor;
}
return D.pos;
case vlChannel.Y:
if (fieldDef.type === Type.NOMINAL || fieldDef.type === Type.ORDINAL) {
return D.pos - D.minor; // prefer ordinal on y
}
if (fieldDef.type === Type.TEMPORAL) {
return D.Y_T; // time should not be on Y
}
return D.pos - D.minor;
case vlChannel.COLUMN:
if (mark === 'text') return D.facet_text;
// prefer column over row due to scrolling issues
return cardinality <= opt.maxGoodCardinalityForFacets ? D.facet_good :
cardinality <= opt.maxCardinalityForFacets ? D.facet_ok : D.facet_bad;
case vlChannel.ROW:
if (mark === 'text') return D.facet_text;
return (cardinality <= opt.maxGoodCardinalityForFacets ? D.facet_good :