alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
handle errors in the graph rendering
author
Wesley Finck
date
4 months ago
(Mar 4, 2026, 7:55 PM -0800)
commit
c2eedec9
c2eedec9182539b80e3b9b7aab95ab9f763305b2
parent
73a7ce87
73a7ce87975bb2188624d2b49ca53d8d0363dcd7
+14
-4
1 changed file
Expand all
Collapse all
Unified
Split
src
webapp
features
graph
lib
queries
useGraphData.tsx
+14
-4
src/webapp/features/graph/lib/queries/useGraphData.tsx
View file
Reviewed
···
52
52
};
53
53
});
54
54
55
55
+
// Create a set of valid node IDs for edge validation
56
56
+
const validNodeIds = new Set(processedNodes.map((node) => node.id));
57
57
+
55
58
// Step 3: Process edges (add value for thickness if needed)
56
56
-
const processedEdges: ExtendedGraphEdge[] = query.data.edges.map(
57
57
-
(edge) => ({
59
59
+
// Filter out edges that reference non-existent nodes
60
60
+
const processedEdges: ExtendedGraphEdge[] = query.data.edges
61
61
+
.filter((edge) => {
62
62
+
const sourceId =
63
63
+
typeof edge.source === 'string' ? edge.source : edge.source;
64
64
+
const targetId =
65
65
+
typeof edge.target === 'string' ? edge.target : edge.target;
66
66
+
return validNodeIds.has(sourceId) && validNodeIds.has(targetId);
67
67
+
})
68
68
+
.map((edge) => ({
58
69
...edge,
59
70
value: 1, // Default thickness, can be customized based on edge type
60
60
-
}),
61
61
-
);
71
71
+
}));
62
72
63
73
return {
64
74
nodes: processedNodes,