Skip to content

Commit

Permalink
Fix in/out edge support that got overwritten by commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauratinnel committed Sep 21, 2024
1 parent a069345 commit fc7f4da
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/logics/graphImpl/cytoImpl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cy, { NodeDefinition, Singular } from "cytoscape";
import edgehandles from 'cytoscape-edgehandles';
import cxtmenu from 'cytoscape-cxtmenu';
import { EdgeData, getColor, GraphData, GraphOptions, GraphTypes, NodeData } from "../utils";
import { EdgeData, getColor, GraphData, GraphOptions, GraphTypes, NodeData, traverseQuery } from "../utils";
import cola, { ColaLayoutOptions } from "cytoscape-cola";
import store, { AppDispatch } from "../../app/store";
import { removeNodes, setSelectedEdge, setSelectedNode, updateColorMap } from "../../reducers/graphReducer";
Expand Down Expand Up @@ -139,7 +139,20 @@ export function getCytoGraph(container?: HTMLElement, data?: GraphData, options?
},
enabled: true // whether the command is selectable
},
], // function( ele ){ return [ /*...*/ ] }, // a function that returns commands or a promise of commands
{ // example command
content: 'Incoming Edges', // html/text content to be displayed in the menu
select: function (ele: Singular) { // a function to execute when the command is selected
traverseQuery(ele.id(), "in")
},
enabled: true // whether the command is selectable
},
{ // example command
content: 'Outgoing Edges', // html/text content to be displayed in the menu
select: function (ele: Singular) { // a function to execute when the command is selected
traverseQuery(ele.id(), "out")
},
enabled: true // whether the command is selectable
}, ], // function( ele ){ return [ /*...*/ ] }, // a function that returns commands or a promise of commands
})

layout.start()
Expand Down

0 comments on commit fc7f4da

Please sign in to comment.