INNER CODE UNIT · TypeScript
implementGraph
grumpyp/aixplora · frontend/src/renderer/pages/graph/index.ts:21
export const implementGraph = () =>{
// Instantiate sigma:
const graph = new Graph();
graph.import(data);
const renderer = new Sigma(graph, container);
// Type and declare internal state:
interface State {
hoveredNode?: string;
searchQuery: string;
// State derived from query:
selectedNode?: string;
suggestions?: Set<string>;
// State derived from hovered node:
hoveredNeighbors?: Set<string>;
}