Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (enc.row || enc.col) { //have facet(s)
// don't use facets before filling up x,y
if (!enc.x || !enc.y) return false;
if (opt.omitNonTextAggrWithAllDimsOnFacets) {
// remove all aggregated charts with all dims on facets (row, col)
if (genEncs.isAggrWithAllDimOnFacets(enc)) return false;
}
}
if (enc.x && enc.y) {
var isDimX = !!isDimension(enc.x),
isDimY = !!isDimension(enc.y);
if (isDimX && isDimY && !vl.enc.isAggregate(enc)) {
// FIXME actually check if there would be occlusion #90
return false;
}
if (opt.omitTranpose) {
if (isDimX ^ isDimY) { // dim x mea
if (!dimMeaTransposeRule(enc)) return false;
} else if (enc.y.type===T || enc.x.type === T) {
if (enc.y.type===T && enc.x.type !== T) return false;
} else { // show only one OxO, QxQ
if (enc.x.name > enc.y.name) return false;
}
}
return true;
}
it('should be generated', function () {
var shorthand = 'row=1,O|text=avg_2,Q',
enc = vl.enc.fromShorthand(shorthand),
marktypes = getMarkTypes(enc, {}, opt);
expect(marktypes.indexOf('text')).to.gt(-1);
});
beforeEach(function() {
f = fixture['QxT'];
encs = genEncs([], f.fields, f.stats, opt);
encShorthands = encs.map(vl.enc.shorthand);
});
it('should show only vertical bar/plots', function() {
it('should be generated', function () {
var shorthand = 'row=1,O|text=mean_2,Q',
encoding = vl.enc.fromShorthand(shorthand),
marktypes = getMarkTypes(encoding, {}, opt);
expect(marktypes.indexOf('text')).to.gt(-1);
});
beforeEach(function() {
f = fixture['#xB(Q)'];
encodings = genEncodings([], f.fields, f.stats, opt);
encShorthands = encodings.map(vl.enc.shorthand);
});
beforeEach(function() {
f = fixture['#xB(Q)'];
encs = genEncs([], f.fields, f.stats, opt);
encShorthands = encs.map(vl.enc.shorthand);
});
beforeEach(function() {
f = fixture['#xT'];
encodings = genEncodings([], f.fields, f.stats, opt);
encShorthands = encodings.map(vl.enc.shorthand);
});