From 78f77cef90a92c353d35c10553e5987aae05ce17 Mon Sep 17 00:00:00 2001 From: Simon He <57086651+Simon-He95@users.noreply.github.com> Date: Fri, 8 Dec 2023 20:25:26 +0800 Subject: [PATCH] chore: typo (#5225) --- packages/pc/src/graph/controller/event.ts | 8 ++++---- packages/pc/src/util/color.ts | 4 ++-- packages/pc/src/util/layout.ts | 10 +++++----- .../src/Layout/getPositionsUsingYoga.ts | 16 ++++++++-------- .../react-node/src/ReactNode/Shape/Ellipse.tsx | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/pc/src/graph/controller/event.ts b/packages/pc/src/graph/controller/event.ts index f72c8cedfd0..afa38e50935 100644 --- a/packages/pc/src/graph/controller/event.ts +++ b/packages/pc/src/graph/controller/event.ts @@ -83,16 +83,16 @@ export default class EventController extends AbstractEvent { const { target } = evt; const eventType = evt.type; - switch(eventType) { - // solve G's problem: mousemove and mosueup are not triggered with drag and dragend + switch (eventType) { + // solve G's problem: mousemove and mouseup are not triggered with drag and dragend case 'drag': this.onCanvasEvents(Object.assign({}, evt, { type: 'mousemove' })); break; case 'dragend': this.onCanvasEvents(Object.assign({}, evt, { type: 'mouseup' })); break; - // solve G's problem: mousedown on other DOMs, mouseup on canvas, click event is triggered unexpectly - case 'mousedown': + // solve G's problem: mousedown on other DOMs, mouseup on canvas, click event is triggered unexpectedly + case 'mousedown': this.mousedown = true; break; case 'mouseup': diff --git a/packages/pc/src/util/color.ts b/packages/pc/src/util/color.ts index 55ef6b32336..4ccceb867c8 100644 --- a/packages/pc/src/util/color.ts +++ b/packages/pc/src/util/color.ts @@ -2,7 +2,7 @@ import color from 'color'; import { generate } from '@ant-design/colors'; /** - * get the mix color of backColor and frontColor with alpah + * get the mix color of backColor and frontColor with alpha * @param backColor background color * @param frontColor foreground color * @param frontAlpha the opacity of foreground color @@ -188,4 +188,4 @@ export const getColorSetsBySubjectColors = ( sets.push(getColorsWithSubjectColor(sColor, backColor, theme, disableColor)); }); return sets; -}; \ No newline at end of file +}; diff --git a/packages/pc/src/util/layout.ts b/packages/pc/src/util/layout.ts index 4679ff05d75..e029a0c4d34 100644 --- a/packages/pc/src/util/layout.ts +++ b/packages/pc/src/util/layout.ts @@ -222,13 +222,13 @@ export const attributesToTextureData = ( ): { array: Float32Array; count: number } => { const dataArray = []; const attributeNum = attributeNames.length; - const attributteStringMap = {}; + const attributeStringMap = {}; items.forEach((item) => { attributeNames.forEach((name, i) => { - if (attributteStringMap[item[name]] === undefined) { - attributteStringMap[item[name]] = Object.keys(attributteStringMap).length; + if (attributeStringMap[item[name]] === undefined) { + attributeStringMap[item[name]] = Object.keys(attributeStringMap).length; } - dataArray.push(attributteStringMap[item[name]]); + dataArray.push(attributeStringMap[item[name]]); // insure each node's attributes take inter number of grids if (i === attributeNum - 1) { while (dataArray.length % 4 !== 0) { @@ -239,7 +239,7 @@ export const attributesToTextureData = ( }); return { array: new Float32Array(dataArray), - count: Object.keys(attributteStringMap).length, + count: Object.keys(attributeStringMap).length, }; }; diff --git a/packages/react-node/src/Layout/getPositionsUsingYoga.ts b/packages/react-node/src/Layout/getPositionsUsingYoga.ts index 229cbc6dfed..b35c5a0d0dc 100644 --- a/packages/react-node/src/Layout/getPositionsUsingYoga.ts +++ b/packages/react-node/src/Layout/getPositionsUsingYoga.ts @@ -165,7 +165,7 @@ const constructNodes = ( while (childrenArr[0]) { const children = childrenArr.pop() || []; const parent = parentArr.pop(); - const newChilren: ContainerNode[] = []; + const newChildren: ContainerNode[] = []; for (let i = 0; i < children?.length; i += 1) { const node = children[i]; @@ -187,14 +187,14 @@ const constructNodes = ( childrenArr.push(node.children); } - newChilren.push(containerNode); + newChildren.push(containerNode); } if (!parent) { - resultNode = newChilren[0]; - basicContainer.insertChild(newChilren[0].container, 0); + resultNode = newChildren[0]; + basicContainer.insertChild(newChildren[0].container, 0); } else { - parent.children = newChilren; + parent.children = newChildren; for (let j = 0; j < parent.children.length; j += 1) { parent.container.insertChild(parent.children[j].container, j); } @@ -204,7 +204,7 @@ const constructNodes = ( return resultNode; }; -const caculateNodes = ( +const calculateNodes = ( node: ContainerNode, parentBoundaryBox: { width: number; @@ -245,7 +245,7 @@ const caculateNodes = ( const children: LayoutedNode[] = []; for (let i = 0; i < restNode.children.length; i += 1) { - children.push(caculateNodes(restNode.children[i], actualBondary)); + children.push(calculateNodes(restNode.children[i], actualBondary)); } return { @@ -269,7 +269,7 @@ const getPositionUsingYoga = (root: RawNode): LayoutedNode => { constructNodes(root, basicContainer) || ({ ...root, container: basicContainer } as ContainerNode); basicContainer.calculateLayout(); - const result = caculateNodes(newNodes, { + const result = calculateNodes(newNodes, { width: 0, height: 0, x: 0, diff --git a/packages/react-node/src/ReactNode/Shape/Ellipse.tsx b/packages/react-node/src/ReactNode/Shape/Ellipse.tsx index 71b0909062e..9696d66c290 100644 --- a/packages/react-node/src/ReactNode/Shape/Ellipse.tsx +++ b/packages/react-node/src/ReactNode/Shape/Ellipse.tsx @@ -4,12 +4,12 @@ import { CommonShapeProps } from './common'; export interface EllipseStyle extends CommonShapeProps { /** - * @description.en-US The horizontal raidus of the ellipse. + * @description.en-US The horizontal radius of the ellipse. * @description.zh-CN 椭圆的水平半径 */ rx: number; /** - * @description.en-US The vertical raidus of the ellipse. + * @description.en-US The vertical radius of the ellipse. * @description.zh-CN 椭圆的纵向半径 */ ry: number;