B: Fix cst graph visualization

This commit is contained in:
Ivan 2025-10-15 11:56:56 +03:00
parent feb23337ae
commit b2699839af
2 changed files with 3 additions and 3 deletions

View File

@ -57,11 +57,11 @@ export function applyLayout(nodes: Node<TGNodeState>[], 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) {

View File

@ -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),