fix: typos

This commit is contained in:
wisonic
2025-08-07 17:28:32 +08:00
committed by wisonic-s
parent 123e0e5d83
commit 513a0af5a4
3 changed files with 27 additions and 27 deletions

View File

@@ -279,7 +279,7 @@ const calculateDepth = obj => {
let path = ''
const { x: depth, y } = obj
obj.child.forEach((item, index) => {
const { y: sibingLg, z } = item
const { y: siblingLg, z } = item
if (item.child?.length) {
let parent = (dfs(obj.child, 0) * 41.4) / 2 + (getY(obj.child) || 0) * 41.4
let children = (dfs(item.child, 0) * 41.4) / 2 + getY(item.child) * 41.4
@@ -291,7 +291,7 @@ const calculateDepth = obj => {
} else {
;[path1, path2] = [children, parent]
}
if (y >= sibingLg) {
if (y >= siblingLg) {
path1 = parent
path2 = children
}
@@ -301,22 +301,22 @@ const calculateDepth = obj => {
path += calculateDepth(item)
}
if (!item.child?.length) {
if (sibingLg >= y) {
if (siblingLg >= y) {
path += `M${24 + depth * 68} ${y * 40} L${24 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875
} L${68 + depth * 68} ${(sibingLg + 1) * 41.4 - 20.69921875}`
(siblingLg + 1) * 41.4 - 20.69921875
} L${68 + depth * 68} ${(siblingLg + 1) * 41.4 - 20.69921875}`
} else {
path += `M${24 + depth * 68} ${
(sibingLg +
(siblingLg +
(lg === 1 && index === 0 ? 0 : 1) +
(obj.child[index + 1]?.child?.length ? y - sibingLg - 1 : 0)) *
(obj.child[index + 1]?.child?.length ? y - siblingLg - 1 : 0)) *
41.4 +
20 +
(lg === 1 && index === 0 ? 26 : 0)
} L${24 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
(siblingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
} L${68 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
(siblingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
}`
}
}

View File

@@ -181,7 +181,7 @@ const calculateDepth = obj => {
let path = ''
const { x: depth, y } = obj
obj.child.forEach((item, index) => {
const { y: sibingLg, z } = item
const { y: siblingLg, z } = item
if (item.child?.length) {
let parent = (dfs(obj.child, 0) * 41.4) / 2 + (getY(obj.child) || 0) * 41.4
let children = (dfs(item.child, 0) * 41.4) / 2 + getY(item.child) * 41.4
@@ -193,7 +193,7 @@ const calculateDepth = obj => {
} else {
;[path1, path2] = [children, parent]
}
if (y >= sibingLg) {
if (y >= siblingLg) {
path1 = parent
path2 = children
}
@@ -203,22 +203,22 @@ const calculateDepth = obj => {
path += calculateDepth(item)
}
if (!item.child?.length) {
if (sibingLg >= y) {
if (siblingLg >= y) {
path += `M${24 + depth * 68} ${y * 40} L${24 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875
} L${68 + depth * 68} ${(sibingLg + 1) * 41.4 - 20.69921875}`
(siblingLg + 1) * 41.4 - 20.69921875
} L${68 + depth * 68} ${(siblingLg + 1) * 41.4 - 20.69921875}`
} else {
path += `M${24 + depth * 68} ${
(sibingLg +
(siblingLg +
(lg === 1 && index === 0 ? 0 : 1) +
(obj.child[index + 1]?.child?.length ? y - sibingLg - 1 : 0)) *
(obj.child[index + 1]?.child?.length ? y - siblingLg - 1 : 0)) *
41.4 +
20 +
(lg === 1 && index === 0 ? 26 : 0)
} L${24 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
(siblingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
} L${68 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
(siblingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
}`
}
}

View File

@@ -162,7 +162,7 @@ const calculateDepth = obj => {
let path = ''
const { x: depth, y } = obj
obj.child.forEach((item, index) => {
const { y: sibingLg, z } = item
const { y: siblingLg, z } = item
if (item.child?.length) {
let parent = (dfs(obj.child, 0) * 41.4) / 2 + (getY(obj.child) || 0) * 41.4
let children = (dfs(item.child, 0) * 41.4) / 2 + getY(item.child) * 41.4
@@ -174,7 +174,7 @@ const calculateDepth = obj => {
} else {
;[path1, path2] = [children, parent]
}
if (y >= sibingLg) {
if (y >= siblingLg) {
path1 = parent
path2 = children
}
@@ -184,22 +184,22 @@ const calculateDepth = obj => {
path += calculateDepth(item)
}
if (!item.child?.length) {
if (sibingLg >= y) {
if (siblingLg >= y) {
path += `M${24 + depth * 68} ${y * 40} L${24 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875
} L${68 + depth * 68} ${(sibingLg + 1) * 41.4 - 20.69921875}`
(siblingLg + 1) * 41.4 - 20.69921875
} L${68 + depth * 68} ${(siblingLg + 1) * 41.4 - 20.69921875}`
} else {
path += `M${24 + depth * 68} ${
(sibingLg +
(siblingLg +
(lg === 1 && index === 0 ? 0 : 1) +
(obj.child[index + 1]?.child?.length ? y - sibingLg - 1 : 0)) *
(obj.child[index + 1]?.child?.length ? y - siblingLg - 1 : 0)) *
41.4 +
20 +
(lg === 1 && index === 0 ? 26 : 0)
} L${24 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
(siblingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
} L${68 + depth * 68} ${
(sibingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
(siblingLg + 1) * 41.4 - 20.69921875 - (lg === 1 && index === 0 ? (z || 0) * 1.4 : 0)
}`
}
}