export declare type NodeId = string | number; export declare type LinkId = string | number; export declare type GraphNode = { id: NodeId; data: D; }; export declare type GraphLink = { id?: LinkId; source: NodeId; target: NodeId; }; export declare type GraphNodeInfo = { title: string; linkIds?: LinkId[]; type?: string; neighbors?: NodeId[]; }; export declare type NoteGraphData = { nodes: Array<{ id: NodeId; }>; links: GraphLink[]; }; /** * Part of the GraphViewModel that can be provided as data input */ export interface GraphViewData { /** data for d3 ForceGraph */ graphData: NoteGraphData; nodeInfos: { [K in NodeId]: GraphNodeInfo; }; focusedNode?: NodeId | null; } /** * states of the NoteGraphView */ export interface GraphViewModel extends GraphViewData { selectedNodes: Set; /** For computing highlight */ focusNodes: Set; hoverNode: NodeId | null; /** For computing highlight */ focusLinks: Set; }