Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
espressoroaster committed Aug 7, 2016
1 parent 1f3e040 commit 82edc38
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {ENUMERATOR_INDEX} from '../src/enumerator';
import {QueryConfig, DEFAULT_QUERY_CONFIG} from './config';
import {SpecQueryModel} from './model';
import {Property} from './property';
import {EncodingQuery, ScaleQuery} from './query/encoding';
import {EncodingQuery} from './query/encoding';
import {SpecQuery} from './query/spec';
import {Schema} from './schema';
import {Dict} from './util';
Expand Down Expand Up @@ -37,12 +37,12 @@ export function generate(specQ: SpecQuery, schema: Schema, opt: QueryConfig = DE
ENCODING_QUERY_INDEX[channel] = specQM.getEncodingQueryByChannel(channel);
});

const y_encQ = ENCODING_QUERY_INDEX[Channel.Y];
if (y_encQ !== undefined) {
const yEncQ = ENCODING_QUERY_INDEX[Channel.Y];
if (yEncQ !== undefined) {
if (ENCODING_QUERY_INDEX[Channel.ROW] ||
schema.cardinality(y_encQ) > 10) {
schema.cardinality(yEncQ) > 10) {

if (y_encQ.scale === undefined) {
if (yEncQ.scale === undefined) {
specQM.setEncodingProperty(
specQM.getEncodingQueryIndexByChannel(Channel.Y),
Property.SCALE,
Expand All @@ -51,7 +51,7 @@ export function generate(specQ: SpecQuery, schema: Schema, opt: QueryConfig = DE
);
}

if (y_encQ.scale) {
if (yEncQ.scale) {
specQM.setEncodingProperty(
specQM.getEncodingQueryIndexByChannel(Channel.Y),
Property.SCALE_BANDSIZE,
Expand All @@ -62,12 +62,12 @@ export function generate(specQ: SpecQuery, schema: Schema, opt: QueryConfig = DE
}
}

const x_encQ = ENCODING_QUERY_INDEX[Channel.X];
if (x_encQ !== undefined) {
const xEncQ = ENCODING_QUERY_INDEX[Channel.X];
if (xEncQ !== undefined) {
if (ENCODING_QUERY_INDEX[Channel.COLUMN] ||
schema.cardinality(x_encQ) > 10) {
schema.cardinality(xEncQ) > 10) {

if (x_encQ.scale === undefined) {
if (xEncQ.scale === undefined) {
specQM.setEncodingProperty(
specQM.getEncodingQueryIndexByChannel(Channel.X),
Property.SCALE,
Expand All @@ -76,7 +76,7 @@ export function generate(specQ: SpecQuery, schema: Schema, opt: QueryConfig = DE
);
}

if (x_encQ.scale) {
if (xEncQ.scale) {
specQM.setEncodingProperty(
specQM.getEncodingQueryIndexByChannel(Channel.X),
Property.SCALE_BANDSIZE,
Expand All @@ -95,11 +95,11 @@ export function generate(specQ: SpecQuery, schema: Schema, opt: QueryConfig = DE
answerSet = answerSet.map(function(specQM) {
ENCODING_QUERY_INDEX[Channel.COLOR] = specQM.getEncodingQueryByChannel(Channel.COLOR);

const color_encQ = ENCODING_QUERY_INDEX[Channel.COLOR];
if ((color_encQ !== undefined) && (color_encQ.type === Type.NOMINAL) &&
(schema.cardinality(color_encQ) > 10)) {
const colorEncQ = ENCODING_QUERY_INDEX[Channel.COLOR];
if ((colorEncQ !== undefined) && (colorEncQ.type === Type.NOMINAL) &&
(schema.cardinality(colorEncQ) > 10)) {

if (color_encQ.scale === undefined) {
if (colorEncQ.scale === undefined) {
specQM.setEncodingProperty(
specQM.getEncodingQueryIndexByChannel(Channel.COLOR),
Property.SCALE,
Expand All @@ -108,7 +108,7 @@ export function generate(specQ: SpecQuery, schema: Schema, opt: QueryConfig = DE
);
}

if (color_encQ.scale) {
if (colorEncQ.scale) {
specQM.setEncodingProperty(
specQM.getEncodingQueryIndexByChannel(Channel.COLOR),
Property.SCALE_RANGE,
Expand Down

0 comments on commit 82edc38

Please sign in to comment.