mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-11-15 17:21:38 +03:00
B: Fix cst graph visualization
This commit is contained in:
parent
feb23337ae
commit
b2699839af
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user