Skip to content

Commit

Permalink
fix mege errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Nov 23, 2018
1 parent 7e24a4f commit 5b67208
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
15 changes: 4 additions & 11 deletions src/model/BooleansColumn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ArrayColumn, {IArrayColumnDesc, spliceChanged} from './ArrayColumn';
import ArrayColumn, {IArrayColumnDesc} from './ArrayColumn';
import {ISetColumn, toCategory} from './ICategoricalColumn';
import {IDataRow} from './interfaces';
import CategoricalColumn from './CategoricalColumn';
Expand Down Expand Up @@ -43,6 +43,9 @@ export default class BooleansColumn extends ArrayColumn<boolean> implements ISet
if (v == null) {
return NaN;
}
return v.reduce((a, b) => a + (b ? 1 : 0), 0);
}

getCategories(row: IDataRow) {
const categories = this.categories;
return super.getValues(row).map((v, i) => {
Expand All @@ -60,7 +63,6 @@ export default class BooleansColumn extends ArrayColumn<boolean> implements ISet
}

on(type: typeof BooleansColumn.EVENT_COLOR_MAPPING_CHANGED, listener: typeof colorMappingChanged | null): this;
on(type: typeof ArrayColumn.EVENT_SPLICE_CHANGED, listener: typeof spliceChanged | null): this;
on(type: typeof ValueColumn.EVENT_DATA_LOADED, listener: typeof dataLoaded | null): this;
on(type: typeof Column.EVENT_WIDTH_CHANGED, listener: typeof widthChanged | null): this;
on(type: typeof Column.EVENT_LABEL_CHANGED, listener: typeof labelChanged | null): this;
Expand Down Expand Up @@ -94,13 +96,4 @@ export default class BooleansColumn extends ArrayColumn<boolean> implements ISet
super.restore(dump, factory);
this.colorMapping = restoreColorMapping(dump.colorMapping, this.categories);
}

compare(a: IDataRow, b: IDataRow) {
const aVal = this.getValue(a);
const bVal = this.getValue(b);
if (aVal == null) {
return bVal == null ? 0 : FIRST_IS_MISSING;
}
return v.reduce((a, b) => a + (b ? 1 : 0), 0);
}
}
3 changes: 1 addition & 2 deletions src/model/CategoricalsColumn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ArrayColumn, {IArrayColumnDesc, spliceChanged} from './ArrayColumn';
import ArrayColumn, {IArrayColumnDesc} from './ArrayColumn';
import {ICategoricalDesc, ICategory, toCategories} from './ICategoricalColumn';
import {IDataRow} from './interfaces';
import {toolbar} from './annotations';
Expand Down Expand Up @@ -42,7 +42,6 @@ export default class CategoricalsColumn extends ArrayColumn<string | null> {
}

on(type: typeof CategoricalsColumn.EVENT_COLOR_MAPPING_CHANGED, listener: typeof colorMappingChanged | null): this;
on(type: typeof ArrayColumn.EVENT_SPLICE_CHANGED, listener: typeof spliceChanged | null): this;
on(type: typeof ValueColumn.EVENT_DATA_LOADED, listener: typeof dataLoaded | null): this;
on(type: typeof Column.EVENT_WIDTH_CHANGED, listener: typeof widthChanged | null): this;
on(type: typeof Column.EVENT_LABEL_CHANGED, listener: typeof labelChanged | null): this;
Expand Down

0 comments on commit 5b67208

Please sign in to comment.