import { ForceLayoutMode, HierarchicalLayoutMode, IOgmaConfig, LkEdgeData, LkNodeData, PopulatedVisualization, VizEdge, VizNode } from '@linkurious/rest-client'; import type { Edge, EdgeList, Filter, ForceLayoutOptions, HierarchicalLayoutOptions, NodeId, NodeList, NonObjectPropertyWatcher, RadialLayoutOptions, RawEdge, RawGraph } from '@linkurious/ogma'; import OgmaLib from '@linkurious/ogma'; import { StylesViz } from './features/styles'; import { TransformationsViz } from './features/transformations'; import { CaptionsViz } from './features/captions'; import { OgmaStore } from './features/OgmaStore'; import { NodeGroupingTransformation } from './features/nodeGrouping'; export { default as Ogma } from '@linkurious/ogma'; export declare const ANIMATION_DURATION = 750; interface AddItemOptions { batchSize?: number; virtual?: boolean; } export declare class LKOgma extends OgmaLib { private _configuration; LKStyles: StylesViz; LKCaptions: CaptionsViz; LKTransformation: TransformationsViz; nodeCategoriesWatcher: NonObjectPropertyWatcher; edgeTypeWatcher: NonObjectPropertyWatcher; store: OgmaStore; LkNodeGroupingTransformation: NodeGroupingTransformation; private _reactive; constructor(_configuration: IOgmaConfig, _baseUrl?: string); /** * Initialize the Ogma instance with the configuration and the base url * @param init used to know if the instance is initialized for the first time (used in setConfigOgma) * @param baseUrl base url used for relative image urls * @private */ private initOgmaLinkuriousParser; /** * Initialize selection behavior */ initSelection(): void; private setStyles; private setCaptions; /** * Returns Ogma Layout parameters according to visualization layout settings * */ getForceLayoutParams(mode: ForceLayoutMode, duration?: number): ForceLayoutOptions; getRadialLayoutParams(rootNode: string, duration?: number): RadialLayoutOptions; getHierarchicalLayoutParams(mode: HierarchicalLayoutMode, rootNode: string, duration?: number): HierarchicalLayoutOptions; /** * Initialize graph. * add nodes and edges to the viz and init the selection. */ init(visualization: { nodes: Array; edges: Array; }): Promise; initVisualization(visualization: PopulatedVisualization): Promise; /** * Adding nodes then adding edges to the graph */ addGraphAfterValidation(graph: RawGraph): Promise<{ nodes: NodeList; edges: EdgeList; }>; /** * Adding edges to the graph after filtering disconnected ones */ addEdges(edges: Array>, options?: AddItemOptions): Promise; /** * Return the list of non filtered nodes */ getNonFilteredNodes(items?: Array): NodeList; /** * Return the list of filtered nodes * @param items items to check if they are filtered * @param filter type of nodes to check if they are filtered ( nodes that are visible, raw nodes (none virtual) or all nodes) */ getFilteredNodes(items?: Array, filter?: 'visible' | 'raw' | 'all'): NodeList; /** * Return the list of non filtered edges */ getNonFilteredEdges(items?: Array | Filter | Edge[] | EdgeList): EdgeList; /** * Return the list of filtered edges */ getFilteredEdges(items?: Array | Filter | Edge[] | EdgeList, filter?: 'visible' | 'raw' | 'all'): EdgeList; /** * Do a full reset on ogma and streams of ogma */ shutDown(): void; /** * Reset the Ogma instance so that it can be used fresh in the next visulization */ clearOgmaState(): void; /** * Updates the Ogma config when config changes in LKE. If init, options were already set by the Ogma.reset() */ setConfigOgma(configuration?: IOgmaConfig, init?: boolean, baseUrl?: string): void; /** * An override of the Ogma method getSelectedNodes * originally it was returning only the visible selected nodes * but we need to return all selected nodes, including the one that are part of collapsed groups */ getSelectedNodes(): NodeList; /** * An override of the Ogma method clearSelection * originally it was unselecting only the visible selected nodes * but we need also to unselect invisible nodes, including the one that are part of collapsed groups */ clearSelection(): void; }