Skip to content

Commit

Permalink
chore: typo (#5225)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 authored Dec 8, 2023
1 parent de9ba53 commit 78f77ce
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions packages/pc/src/graph/controller/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions packages/pc/src/util/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -188,4 +188,4 @@ export const getColorSetsBySubjectColors = (
sets.push(getColorsWithSubjectColor(sColor, backColor, theme, disableColor));
});
return sets;
};
};
10 changes: 5 additions & 5 deletions packages/pc/src/util/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -239,7 +239,7 @@ export const attributesToTextureData = (
});
return {
array: new Float32Array(dataArray),
count: Object.keys(attributteStringMap).length,
count: Object.keys(attributeStringMap).length,
};
};

Expand Down
16 changes: 8 additions & 8 deletions packages/react-node/src/Layout/getPositionsUsingYoga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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);
}
Expand All @@ -204,7 +204,7 @@ const constructNodes = (
return resultNode;
};

const caculateNodes = (
const calculateNodes = (
node: ContainerNode,
parentBoundaryBox: {
width: number;
Expand Down Expand Up @@ -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 {
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-node/src/ReactNode/Shape/Ellipse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 78f77ce

Please sign in to comment.