Files
eosphoros-ai--db-gpt/web/components/chart/autoChart/advisor/utils.ts
T
wehub-resource-sync d13100ebf3
Update draft releases / main (push) Has been cancelled
Build and push docs image / build-image (push) Has been cancelled
Build Web Application / build-web (macos-latest) (push) Has been cancelled
Build Web Application / build-web (ubuntu-latest) (push) Has been cancelled
Python Code Quality Checks / build (push) Has been cancelled
Test Python / test-python (macos-latest, 3.10) (push) Has been cancelled
Test Python / test-python (macos-latest, 3.11) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.10) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.11) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:27:08 +08:00

47 lines
1.0 KiB
TypeScript

import type { Advice } from '@antv/ava';
import { isNull } from 'lodash';
export function defaultAdvicesFilter(props: { advices: Advice[] }) {
const { advices } = props;
return advices;
}
export const compare = (f1: any, f2: any) => {
if (isNull(f1.distinct) || isNull(f2.distinct)) {
if (f1.distinct! < f2!.distinct!) {
return 1;
}
if (f1.distinct! > f2.distinct!) {
return -1;
}
return 0;
}
return 0;
};
export function hasSubset(array1: any[], array2: any[]): boolean {
return array2.every(e => array1.includes(e));
}
export function intersects(array1: any[], array2: any[]): boolean {
return array2.some(e => array1.includes(e));
}
export function LOM2EncodingType(lom: string) {
switch (lom) {
case 'Nominal':
return 'nominal';
case 'Ordinal':
return 'ordinal';
case 'Interval':
return 'quantitative';
case 'Time':
return 'temporal';
case 'Continuous':
return 'quantitative';
case 'Discrete':
return 'nominal';
default:
return 'nominal';
}
}