Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Oct 30, 2018
1 parent 6c585c8 commit bc81231
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/model/ICategoricalColumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export function toCategory(cat: (string | Partial<ICategory>), value: number, ne
};
}

/** @internal */
export function compareCategory(a: ICategory | null, b: ICategory | null) {
const aNull = a == null || isNaN(a.value);
const bNull = b == null || isNaN(b.value);
Expand All @@ -72,14 +73,14 @@ export function compareCategory(a: ICategory | null, b: ICategory | null) {
return a.value - b.value;
}

/** @internal */
export function toCompareCategoryValue(v: ICategory | null) {
if (v == null) {
return null;
}
return [v.value, v.label.toLowerCase()];
}

export function toCategories(desc: ICategoricalDesc) {
function findMostFrequent(rows: IDataRow[], col: ICategoricalColumn): {cat: ICategory | null, count: number} {
const hist = new Map<ICategory | null, number>();

Expand Down Expand Up @@ -135,6 +136,7 @@ export function groupCompareCategory(a: IDataRow[], b: IDataRow[], col: ICategor
return aMostFrequent.cat.value - bMostFrequent.cat.value;
}

/** @internal */
export function toCategories(desc: ICategoricalDesc) {
if (!desc.categories) {
return [];
Expand Down Expand Up @@ -165,6 +167,7 @@ function isEmptyFilter(f: ICategoricalFilter | null) {
return f == null || (!f.filterMissing && (f.filter == null || f.filter === ''));
}

/** @internal */
export function isEqualCategoricalFilter(a: ICategoricalFilter | null, b: ICategoricalFilter | null) {
if (a === b) {
return true;
Expand Down Expand Up @@ -193,6 +196,7 @@ function arrayEquals<T>(a: T[], b: T[]) {
return a.every((ai, i) => ai === b[i]);
}

/** @internal */
export function isCategoryIncluded(filter: ICategoricalFilter | null, category: ICategory | null) {
if (filter == null) {
return true;
Expand Down

0 comments on commit bc81231

Please sign in to comment.