From 4c17a6b54eab8f77689329979c953731f075e8be Mon Sep 17 00:00:00 2001 From: ObservedObserver <270001151@qq.com> Date: Tue, 27 Jun 2023 17:08:48 +0800 Subject: [PATCH] style: remove useless console --- .../rath-client/src/components/latiaoConsole/editor.tsx | 2 -- packages/rath-client/src/hooks/index.ts | 2 -- packages/rath-client/src/index.tsx | 3 --- packages/rath-client/src/latiao/program/parse.ts | 1 - packages/rath-client/src/lib/textPattern/index.ts | 1 - .../src/pages/causal/exploration/explainer/RExplainer.tsx | 4 ---- .../src/pages/causal/exploration/explainer/diffChart.tsx | 8 -------- packages/rath-client/src/pages/causal/predict.ts | 5 ----- packages/rath-client/src/pages/causal/utils.ts | 8 -------- packages/rath-client/src/pages/collection/index.tsx | 2 -- .../src/pages/dashboard/renderer/card-editor.tsx | 4 ---- packages/rath-client/src/pages/dashboard/source-panel.tsx | 1 - packages/rath-client/src/pages/dataConnection/olap.tsx | 4 ---- .../rath-client/src/pages/dataSource/selection/olap.tsx | 3 --- packages/rath-client/src/pages/painter/index.tsx | 7 +------ .../rath-client/src/pages/progressiveDashboard/index.tsx | 2 -- .../src/pages/semiAutomation/predictZone/featSegment.tsx | 1 - .../src/pages/semiAutomation/predictZone/pattSegment.tsx | 1 - packages/rath-client/src/workers/insight/utils.ts | 1 - 19 files changed, 1 insertion(+), 59 deletions(-) diff --git a/packages/rath-client/src/components/latiaoConsole/editor.tsx b/packages/rath-client/src/components/latiaoConsole/editor.tsx index 23cf1c0a8..209ae9b20 100644 --- a/packages/rath-client/src/components/latiaoConsole/editor.tsx +++ b/packages/rath-client/src/components/latiaoConsole/editor.tsx @@ -166,8 +166,6 @@ const LaTiaoEditor = observer(forwardRef(({ ); } }); - - // console.log('扩展数据', {fields, f, data, rows}); }, ); diff --git a/packages/rath-client/src/hooks/index.ts b/packages/rath-client/src/hooks/index.ts index e364a4187..d18b1810c 100644 --- a/packages/rath-client/src/hooks/index.ts +++ b/packages/rath-client/src/hooks/index.ts @@ -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; } @@ -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; diff --git a/packages/rath-client/src/index.tsx b/packages/rath-client/src/index.tsx index 5403f0908..bc26e6560 100644 --- a/packages/rath-client/src/index.tsx +++ b/packages/rath-client/src/index.tsx @@ -21,9 +21,6 @@ import { customLightTheme, mainTheme } from './theme'; inject(); -// @ts-ignore -// window.Buffer = Buffer.Buffer; -// console.log('buffer', Buffer) initializeIcons(); ReactDOM.render( diff --git a/packages/rath-client/src/latiao/program/parse.ts b/packages/rath-client/src/latiao/program/parse.ts index be2e6c2cb..92e55f737 100644 --- a/packages/rath-client/src/latiao/program/parse.ts +++ b/packages/rath-client/src/latiao/program/parse.ts @@ -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, diff --git a/packages/rath-client/src/lib/textPattern/index.ts b/packages/rath-client/src/lib/textPattern/index.ts index 127313af5..7c1b172cc 100644 --- a/packages/rath-client/src/lib/textPattern/index.ts +++ b/packages/rath-client/src/lib/textPattern/index.ts @@ -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 { diff --git a/packages/rath-client/src/pages/causal/exploration/explainer/RExplainer.tsx b/packages/rath-client/src/pages/causal/exploration/explainer/RExplainer.tsx index 0f5413939..89d97cc90 100644 --- a/packages/rath-client/src/pages/causal/exploration/explainer/RExplainer.tsx +++ b/packages/rath-client/src/pages/causal/exploration/explainer/RExplainer.tsx @@ -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( @@ -179,8 +177,6 @@ const RExplainer: FC = () => { } }, [diffMode, editingGroupIdx]); - // console.log({ irResult }); - return ( {mainField && ( diff --git a/packages/rath-client/src/pages/causal/exploration/explainer/diffChart.tsx b/packages/rath-client/src/pages/causal/exploration/explainer/diffChart.tsx index dde6ee358..612cb7455 100644 --- a/packages/rath-client/src/pages/causal/exploration/explainer/diffChart.tsx +++ b/packages/rath-client/src/pages/causal/exploration/explainer/diffChart.tsx @@ -214,14 +214,6 @@ const DiffChart: React.FC = ({ 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), diff --git a/packages/rath-client/src/pages/causal/predict.ts b/packages/rath-client/src/pages/causal/predict.ts index 834200567..c99405563 100644 --- a/packages/rath-client/src/pages/causal/predict.ts +++ b/packages/rath-client/src/pages/causal/predict.ts @@ -58,11 +58,6 @@ function getPredictAPIPath (path = "/api/train_test") { export const execPredict = async (props: IPredictProps): Promise => { 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: { diff --git a/packages/rath-client/src/pages/causal/utils.ts b/packages/rath-client/src/pages/causal/utils.ts index 68d1c471d..17af6ce2d 100644 --- a/packages/rath-client/src/pages/causal/utils.ts +++ b/packages/rath-client/src/pages/causal/utils.ts @@ -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); } @@ -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 @@ -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); } @@ -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); } @@ -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) } @@ -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); } @@ -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++) { @@ -179,7 +172,6 @@ export function getFieldRelationCheckedMatrix (mat: number[][], fields: IFieldMe } } } - // console.log(JSON.stringify(ans, null, 2)) return ans; } diff --git a/packages/rath-client/src/pages/collection/index.tsx b/packages/rath-client/src/pages/collection/index.tsx index b57646d70..f5b1bec71 100644 --- a/packages/rath-client/src/pages/collection/index.tsx +++ b/packages/rath-client/src/pages/collection/index.tsx @@ -68,8 +68,6 @@ const Collection: React.FC = (props) => { { - // const res = searchFilterView(newValue, collectionList) - // console.log(res) setSearchContent(newValue); }} /> diff --git a/packages/rath-client/src/pages/dashboard/renderer/card-editor.tsx b/packages/rath-client/src/pages/dashboard/renderer/card-editor.tsx index a22bddbf7..34b72752c 100644 --- a/packages/rath-client/src/pages/dashboard/renderer/card-editor.tsx +++ b/packages/rath-client/src/pages/dashboard/renderer/card-editor.tsx @@ -443,10 +443,6 @@ const CardEditor: FC = ({ ))} ), - // onDoubleClick: handleDoubleClick, - // onRootMouseDown(x, y) { - // // console.log({x,y}) - // }, onClick: handleClick, onFilter: handleFilter, style: focused diff --git a/packages/rath-client/src/pages/dashboard/source-panel.tsx b/packages/rath-client/src/pages/dashboard/source-panel.tsx index c1d1e1e7e..4a792373e 100644 --- a/packages/rath-client/src/pages/dashboard/source-panel.tsx +++ b/packages/rath-client/src/pages/dashboard/source-panel.tsx @@ -58,7 +58,6 @@ const SourcePanel: FC = ({ page, card, sampleSize }) => { [card, dashboardStore] ); - // console.log(JSON.parse(JSON.stringify(card))); const [width, setWidth] = useState(0); const ref = useRef(null); diff --git a/packages/rath-client/src/pages/dataConnection/olap.tsx b/packages/rath-client/src/pages/dataConnection/olap.tsx index f91eea4ed..2914f5a97 100644 --- a/packages/rath-client/src/pages/dataConnection/olap.tsx +++ b/packages/rath-client/src/pages/dataConnection/olap.tsx @@ -110,10 +110,6 @@ const OLAPData: React.FC = (props) => { }); }, [clickHouseStore]); - // useEffect(() => { - // fetch('https://localhost:2333/api/config/connection').then(res => res.json()).then(console.log) - // }, []) - return (
diff --git a/packages/rath-client/src/pages/dataSource/selection/olap.tsx b/packages/rath-client/src/pages/dataSource/selection/olap.tsx index 02b15ec9f..42a0274e4 100644 --- a/packages/rath-client/src/pages/dataSource/selection/olap.tsx +++ b/packages/rath-client/src/pages/dataSource/selection/olap.tsx @@ -90,9 +90,6 @@ const OLAPData: React.FC = props => { }) }, [clickHouseStore]) - // useEffect(() => { - // fetch('https://localhost:2333/api/config/connection').then(res => res.json()).then(console.log) - // }, []) return
diff --git a/packages/rath-client/src/pages/painter/index.tsx b/packages/rath-client/src/pages/painter/index.tsx index 568f92dd1..0ef54b6ff 100644 --- a/packages/rath-client/src/pages/painter/index.tsx +++ b/packages/rath-client/src/pages/painter/index.tsx @@ -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; diff --git a/packages/rath-client/src/pages/progressiveDashboard/index.tsx b/packages/rath-client/src/pages/progressiveDashboard/index.tsx index 6773fbd94..5edd194f7 100644 --- a/packages/rath-client/src/pages/progressiveDashboard/index.tsx +++ b/packages/rath-client/src/pages/progressiveDashboard/index.tsx @@ -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 []; diff --git a/packages/rath-client/src/pages/semiAutomation/predictZone/featSegment.tsx b/packages/rath-client/src/pages/semiAutomation/predictZone/featSegment.tsx index 0db6ac266..485f4d589 100644 --- a/packages/rath-client/src/pages/semiAutomation/predictZone/featSegment.tsx +++ b/packages/rath-client/src/pages/semiAutomation/predictZone/featSegment.tsx @@ -61,7 +61,6 @@ const FeatSegment: React.FC = () => { }} /> -

{featViews.views[i].imp}

{ }} /> -

{pattViews.views[i].imp}