Fix linting

This commit is contained in:
yangdx
2025-03-16 03:06:33 +08:00
parent 7d4390af96
commit 6f60c34d1e

View File

@@ -91,7 +91,6 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
if (state.sigmaGraph && state.rawGraph) { if (state.sigmaGraph && state.rawGraph) {
try { try {
// 检查节点是否还存在
if (!state.sigmaGraph.hasNode(node.id)) { if (!state.sigmaGraph.hasNode(node.id)) {
return { return {
...node, ...node,
@@ -99,12 +98,9 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
} }
} }
// 获取所有边
const edges = state.sigmaGraph.edges(node.id) const edges = state.sigmaGraph.edges(node.id)
// 处理每条边
for (const edgeId of edges) { for (const edgeId of edges) {
// 检查边是否还存在
if (!state.sigmaGraph.hasEdge(edgeId)) continue; if (!state.sigmaGraph.hasEdge(edgeId)) continue;
const edge = state.rawGraph.getEdge(edgeId, true) const edge = state.rawGraph.getEdge(edgeId, true)
@@ -112,7 +108,6 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
const isTarget = node.id === edge.source const isTarget = node.id === edge.source
const neighbourId = isTarget ? edge.target : edge.source const neighbourId = isTarget ? edge.target : edge.source
// 检查邻居节点是否存在
if (!state.sigmaGraph.hasNode(neighbourId)) continue; if (!state.sigmaGraph.hasNode(neighbourId)) continue;
const neighbour = state.rawGraph.getNode(neighbourId) const neighbour = state.rawGraph.getNode(neighbourId)
@@ -143,7 +138,6 @@ const refineEdgeProperties = (edge: RawEdgeType): EdgeType => {
if (state.sigmaGraph && state.rawGraph) { if (state.sigmaGraph && state.rawGraph) {
try { try {
// 检查边是否还存在
if (!state.sigmaGraph.hasEdge(edge.id)) { if (!state.sigmaGraph.hasEdge(edge.id)) {
return { return {
...edge, ...edge,
@@ -152,12 +146,10 @@ const refineEdgeProperties = (edge: RawEdgeType): EdgeType => {
} }
} }
// 检查源节点是否存在
if (state.sigmaGraph.hasNode(edge.source)) { if (state.sigmaGraph.hasNode(edge.source)) {
sourceNode = state.rawGraph.getNode(edge.source) sourceNode = state.rawGraph.getNode(edge.source)
} }
// 检查目标节点是否存在
if (state.sigmaGraph.hasNode(edge.target)) { if (state.sigmaGraph.hasNode(edge.target)) {
targetNode = state.rawGraph.getNode(edge.target) targetNode = state.rawGraph.getNode(edge.target)
} }