Skip to content

Commit

Permalink
style: remove useless console
Browse files Browse the repository at this point in the history
  • Loading branch information
ObservedObserver committed Jun 27, 2023
1 parent 2bf7607 commit 4c17a6b
Show file tree
Hide file tree
Showing 19 changed files with 1 addition and 59 deletions.
2 changes: 0 additions & 2 deletions packages/rath-client/src/components/latiaoConsole/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ const LaTiaoEditor = observer(forwardRef<HTMLDivElement, LaTiaoEditorProps>(({
);
}
});

// console.log('扩展数据', {fields, f, data, rows});
},
);

Expand Down
2 changes: 0 additions & 2 deletions packages/rath-client/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export function useCertMail(email: string) {
setClock((c) => {
const nextC = c - 1;
if (nextC === 0) {
// console.log('[kanaries log] clock interval is cleared.');
clearInterval(int);
timerRef.current = undefined;
}
Expand Down Expand Up @@ -143,7 +142,6 @@ export function useCertPhone(phone: string) {
setClock((c) => {
const nextC = c - 1;
if (nextC === 0) {
// console.log('[kanaries log] clock interval is cleared.');
clearInterval(int);
}
return nextC;
Expand Down
3 changes: 0 additions & 3 deletions packages/rath-client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import { customLightTheme, mainTheme } from './theme';

inject();

// @ts-ignore
// window.Buffer = Buffer.Buffer;
// console.log('buffer', Buffer)
initializeIcons();

ReactDOM.render(
Expand Down
1 change: 0 additions & 1 deletion packages/rath-client/src/latiao/program/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ const resolveNode = (exp: CallExpression['arguments'][0], context: LaTiaoProgram
return resolveBinOp(exp, context, out);
}
default: {
// console.log('->', exp);
throw new LaTiaoSyntaxError(
'Unexpected token.',
exp,
Expand Down
1 change: 0 additions & 1 deletion packages/rath-client/src/lib/textPattern/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ function LCALabeling(tree: IPatternNode, depth: number): number {
}

function collectingCANodes(tree: IPatternNode, label: number, nodes: IPatternNode[]) {
// console.log(tree, tree.spe, label, nodes)
if (tree.specLabel === label) {
nodes.push(tree);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ const RExplainer: FC = () => {
const indexName = '__this_is_the_index_of_the_row__';
const data = visSample.map((row, i) => ({ ...row, [indexName]: i }));
const indicesA = applyFilters(data, subspaces[0].predicates).map(row => row[indexName]) as number[];
// console.log('indices');
// console.log(indicesA.join(','));
const indicesB = diffMode === 'two-group'
? applyFilters(data, subspaces[1].predicates).map(row => row[indexName]) as number[]
: diffMode === 'full' ? data.map(row => row[indexName]) as number[] : data.map(row => row[indexName] as number).filter(
Expand Down Expand Up @@ -179,8 +177,6 @@ const RExplainer: FC = () => {
}
}, [diffMode, editingGroupIdx]);

// console.log({ irResult });

return (
<Container>
{mainField && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@ const DiffChart: React.FC<DiffChartProps> = ({ title, data, subspaces, mainField
}, [mainField, title, mainFieldAggregation, mode, dimension]);

useEffect(() => {
// console.log(data.reduce<[number, number][]>((ctx, {[SelectedFlag]:num}) => {
// if (ctx.at(-1)?.[0] !== num) {
// ctx.push([num, 1]);
// } else {
// ctx.at(-1)![1] += 1;
// }
// return ctx;
// }, []).map(([k, v]) => `${k}{${v}}`).join(''));
viewRef.current?.change(
'dataSource',
viewRef.current.changeset().remove(() => true).insert(source),
Expand Down
5 changes: 0 additions & 5 deletions packages/rath-client/src/pages/causal/predict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ function getPredictAPIPath (path = "/api/train_test") {

export const execPredict = async (props: IPredictProps): Promise<IPredictResult | null> => {
try {
// console.log(props.trainTestSplitIndices.map(flag => ({
// [-1]: 'x',
// 0: 'T',
// 1: '_',
// }[flag])).join(''), props.trainTestSplitIndices.length)
const res = await fetch(getPredictAPIPath(), {
method: 'POST',
headers: {
Expand Down
8 changes: 0 additions & 8 deletions packages/rath-client/src/pages/causal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function conditionalMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
let score = 0;
const X = filteredDataSource.map(row => row[xField.fid]);
const Y = filteredDataSource.map(row => row[yField.fid]);
// console.log(X, Y)
if (xField.semanticType === 'quantitative' && yField.semanticType === 'quantitative') {
score = mic(X, Y);
}
Expand All @@ -35,7 +34,6 @@ export function conditionalMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
// 这里如果要用hack的temporal解法的话,需要用purennmic来做T-T类型。但是我们目前并不想提升T-T类型。不如等到之后时间系统改造完用正规的方法搞。
else score = nnMic(X, Y)
}
// console.log(score)
totalScore += score * filteredDataSource.length / dataSource.length;
}
// eslint-disable-next-line no-constant-condition
Expand All @@ -46,7 +44,6 @@ export function conditionalMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
let score = 0;
const X = filteredDataSource.map(row => row[xField.fid]);
const Y = filteredDataSource.map(row => row[yField.fid]);
// console.log(X, Y)
if (xField.semanticType === 'quantitative' && yField.semanticType === 'quantitative') {
score = mic(X, Y);
}
Expand Down Expand Up @@ -85,7 +82,6 @@ function conditionaExtremelMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
let score = 0;
const X = filteredDataSource.map(row => row[xField.fid]);
const Y = filteredDataSource.map(row => row[yField.fid]);
// console.log(X, Y)
if (xField.semanticType === 'quantitative' && yField.semanticType === 'quantitative') {
score = mic(X, Y);
}
Expand All @@ -102,7 +98,6 @@ function conditionaExtremelMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
// 这里如果要用hack的temporal解法的话,需要用purennmic来做T-T类型。但是我们目前并不想提升T-T类型。不如等到之后时间系统改造完用正规的方法搞。
else score = nnMic(X, Y)
}
// console.log(score)
// totalScore += score * filteredDataSource.length / dataSource.length;
totalScore = Math.min(score, totalScore)
}
Expand All @@ -114,7 +109,6 @@ function conditionaExtremelMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
let score = 0;
const X = filteredDataSource.map(row => row[xField.fid]);
const Y = filteredDataSource.map(row => row[yField.fid]);
// console.log(X, Y)
if (xField.semanticType === 'quantitative' && yField.semanticType === 'quantitative') {
score = mic(X, Y);
}
Expand All @@ -140,7 +134,6 @@ function conditionaExtremelMic (condField: IFieldMeta, xField: IFieldMeta, yFiel
}

export function getFieldRelationCheckedMatrix (mat: number[][], fields: IFieldMeta[], dataSource: IRow[]) {
// console.log('start')
let ans: number[][] = new Array(mat.length).fill(0).map(() => new Array(mat.length).fill(0));
for (let i = 0; i < mat.length; i++) {
for (let j = 0; j < mat[i].length; j++) {
Expand Down Expand Up @@ -179,7 +172,6 @@ export function getFieldRelationCheckedMatrix (mat: number[][], fields: IFieldMe
}
}
}
// console.log(JSON.stringify(ans, null, 2))
return ans;
}

Expand Down
2 changes: 0 additions & 2 deletions packages/rath-client/src/pages/collection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ const Collection: React.FC = (props) => {
<SearchBox
placeholder="Search"
onSearch={(newValue) => {
// const res = searchFilterView(newValue, collectionList)
// console.log(res)
setSearchContent(newValue);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,6 @@ const CardEditor: FC<CardProviderProps> = ({
))}
</>
),
// onDoubleClick: handleDoubleClick,
// onRootMouseDown(x, y) {
// // console.log({x,y})
// },
onClick: handleClick,
onFilter: handleFilter,
style: focused
Expand Down
1 change: 0 additions & 1 deletion packages/rath-client/src/pages/dashboard/source-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const SourcePanel: FC<DashboardPanelProps> = ({ page, card, sampleSize }) => {
[card, dashboardStore]
);

// console.log(JSON.parse(JSON.stringify(card)));
const [width, setWidth] = useState(0);
const ref = useRef<HTMLDivElement>(null);

Expand Down
4 changes: 0 additions & 4 deletions packages/rath-client/src/pages/dataConnection/olap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ const OLAPData: React.FC<OLAPDataProps> = (props) => {
});
}, [clickHouseStore]);

// useEffect(() => {
// fetch('https://localhost:2333/api/config/connection').then(res => res.json()).then(console.log)
// }, [])

return (
<div>
<Stack horizontal tokens={StackTokens}>
Expand Down
3 changes: 0 additions & 3 deletions packages/rath-client/src/pages/dataSource/selection/olap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ const OLAPData: React.FC<OLAPDataProps> = props => {
})
}, [clickHouseStore])

// useEffect(() => {
// fetch('https://localhost:2333/api/config/connection').then(res => res.json()).then(console.log)
// }, [])

return <div>
<Stack horizontal tokens={StackTokens}>
Expand Down
7 changes: 1 addition & 6 deletions packages/rath-client/src/pages/painter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,7 @@ const Painter: React.FC = (props) => {

setRealPainterSize((res.view as unknown as { _width: number })._width * painterSize);
if (!(painterSpec.encoding.x && painterSpec.encoding.y)) return;
// if(testConfig.printLog) {
// res.view.addDataListener('dataSource', (name, value) => {
// window.console.log("dataListener", name, value);
// window.console.log(testConfig);
// })
// }

const xField = painterSpec.encoding.x.field;
const yField = painterSpec.encoding.y.field;
const xFieldType = painterSpec.encoding.x.type as ISemanticType;
Expand Down
2 changes: 0 additions & 2 deletions packages/rath-client/src/pages/progressiveDashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ const ProgressiveDashboard: React.FC = (props) => {
},
[originSpecList, fieldMetas]
);
// recommendVisList里是确定性的推荐,不含wildcard
const recommendVisList = useMemo(() => {
if (cleanedData.length > 0 && fieldMetas.length > 0) {
// console.log(cleanedData, toJS(fieldMetas));
return autoSet(cleanedData, toJS(fieldMetas), originSpecList);
}
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const FeatSegment: React.FC = () => {
}}
/>
</Stack>
<h2>{featViews.views[i].imp}</h2>
<div className="chart-container">
<ReactVega
actions={mainVizSetting.debug}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const PattSegment: React.FC = () => {
}}
/>
</Stack>
<h2>{pattViews.views[i].imp}</h2>
<div className="chart-container">
<ReactVega
actions={mainVizSetting.debug}
Expand Down
1 change: 0 additions & 1 deletion packages/rath-client/src/workers/insight/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const diffGroups = (
const loss = ignoreLoss ? 0 : Math.abs(a - b) / 2;
return score + loss;
}, 0);
// console.log(dimension.name, aggregated1, aggregated2, group1, group2, diff);
return diff;
};

Expand Down

0 comments on commit 4c17a6b

Please sign in to comment.