diff --git a/rsconcept/frontend/src/features/rsform/models/graph-api.ts b/rsconcept/frontend/src/features/rsform/models/graph-api.ts index 5c1697d1..683a1902 100644 --- a/rsconcept/frontend/src/features/rsform/models/graph-api.ts +++ b/rsconcept/frontend/src/features/rsform/models/graph-api.ts @@ -57,11 +57,11 @@ export function applyLayout(nodes: Node[], edges: Edge[], subLabels }); } -export function inferEdgeType(schema: IRSForm, source: number, target: number): GraphType | null { +export function inferEdgeType(schema: IRSForm, source: number, target: number): GraphType { const isDefinition = schema.graph.hasEdge(source, target); const isAttribution = schema.attribution_graph.hasEdge(source, target); if (!isDefinition && !isAttribution) { - return null; + return 'definition'; } else if (isDefinition && isAttribution) { return 'full'; } else if (isDefinition) { diff --git a/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-term-graph/tg-flow.tsx b/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-term-graph/tg-flow.tsx index badc2397..c1375a7b 100644 --- a/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-term-graph/tg-flow.tsx +++ b/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-term-graph/tg-flow.tsx @@ -88,7 +88,7 @@ export function TGFlow() { filteredGraph.nodes.forEach(source => { source.outputs.forEach(target => { const edgeType = inferEdgeType(schema, source.id, target); - if (edgeType && newNodes.find(node => node.id === String(target))) { + if (newNodes.find(node => node.id === String(target))) { const color = filter.graphType === 'full' ? colorGraphEdge(edgeType) : colorGraphEdge(filter.graphType); newEdges.push({ id: String(edgeID),