yangdx
commited on
Commit
·
6f4639a
1
Parent(s):
dc332df
Fix linting
Browse files
lightrag_webui/src/components/graph/PropertiesView.tsx
CHANGED
|
@@ -91,7 +91,6 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
|
|
| 91 |
|
| 92 |
if (state.sigmaGraph && state.rawGraph) {
|
| 93 |
try {
|
| 94 |
-
// 检查节点是否还存在
|
| 95 |
if (!state.sigmaGraph.hasNode(node.id)) {
|
| 96 |
return {
|
| 97 |
...node,
|
|
@@ -99,12 +98,9 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
|
|
| 99 |
}
|
| 100 |
}
|
| 101 |
|
| 102 |
-
// 获取所有边
|
| 103 |
const edges = state.sigmaGraph.edges(node.id)
|
| 104 |
|
| 105 |
-
// 处理每条边
|
| 106 |
for (const edgeId of edges) {
|
| 107 |
-
// 检查边是否还存在
|
| 108 |
if (!state.sigmaGraph.hasEdge(edgeId)) continue;
|
| 109 |
|
| 110 |
const edge = state.rawGraph.getEdge(edgeId, true)
|
|
@@ -112,7 +108,6 @@ const refineNodeProperties = (node: RawNodeType): NodeType => {
|
|
| 112 |
const isTarget = node.id === edge.source
|
| 113 |
const neighbourId = isTarget ? edge.target : edge.source
|
| 114 |
|
| 115 |
-
// 检查邻居节点是否存在
|
| 116 |
if (!state.sigmaGraph.hasNode(neighbourId)) continue;
|
| 117 |
|
| 118 |
const neighbour = state.rawGraph.getNode(neighbourId)
|
|
@@ -143,7 +138,6 @@ const refineEdgeProperties = (edge: RawEdgeType): EdgeType => {
|
|
| 143 |
|
| 144 |
if (state.sigmaGraph && state.rawGraph) {
|
| 145 |
try {
|
| 146 |
-
// 检查边是否还存在
|
| 147 |
if (!state.sigmaGraph.hasEdge(edge.id)) {
|
| 148 |
return {
|
| 149 |
...edge,
|
|
@@ -152,12 +146,10 @@ const refineEdgeProperties = (edge: RawEdgeType): EdgeType => {
|
|
| 152 |
}
|
| 153 |
}
|
| 154 |
|
| 155 |
-
// 检查源节点是否存在
|
| 156 |
if (state.sigmaGraph.hasNode(edge.source)) {
|
| 157 |
sourceNode = state.rawGraph.getNode(edge.source)
|
| 158 |
}
|
| 159 |
|
| 160 |
-
// 检查目标节点是否存在
|
| 161 |
if (state.sigmaGraph.hasNode(edge.target)) {
|
| 162 |
targetNode = state.rawGraph.getNode(edge.target)
|
| 163 |
}
|
|
|
|
| 91 |
|
| 92 |
if (state.sigmaGraph && state.rawGraph) {
|
| 93 |
try {
|
|
|
|
| 94 |
if (!state.sigmaGraph.hasNode(node.id)) {
|
| 95 |
return {
|
| 96 |
...node,
|
|
|
|
| 98 |
}
|
| 99 |
}
|
| 100 |
|
|
|
|
| 101 |
const edges = state.sigmaGraph.edges(node.id)
|
| 102 |
|
|
|
|
| 103 |
for (const edgeId of edges) {
|
|
|
|
| 104 |
if (!state.sigmaGraph.hasEdge(edgeId)) continue;
|
| 105 |
|
| 106 |
const edge = state.rawGraph.getEdge(edgeId, true)
|
|
|
|
| 108 |
const isTarget = node.id === edge.source
|
| 109 |
const neighbourId = isTarget ? edge.target : edge.source
|
| 110 |
|
|
|
|
| 111 |
if (!state.sigmaGraph.hasNode(neighbourId)) continue;
|
| 112 |
|
| 113 |
const neighbour = state.rawGraph.getNode(neighbourId)
|
|
|
|
| 138 |
|
| 139 |
if (state.sigmaGraph && state.rawGraph) {
|
| 140 |
try {
|
|
|
|
| 141 |
if (!state.sigmaGraph.hasEdge(edge.id)) {
|
| 142 |
return {
|
| 143 |
...edge,
|
|
|
|
| 146 |
}
|
| 147 |
}
|
| 148 |
|
|
|
|
| 149 |
if (state.sigmaGraph.hasNode(edge.source)) {
|
| 150 |
sourceNode = state.rawGraph.getNode(edge.source)
|
| 151 |
}
|
| 152 |
|
|
|
|
| 153 |
if (state.sigmaGraph.hasNode(edge.target)) {
|
| 154 |
targetNode = state.rawGraph.getNode(edge.target)
|
| 155 |
}
|