import { ApiEdge } from "./apiEdge"; import { ApiNode } from "./apiNode"; import { CategoryId } from "./category"; import { NodeCollection } from "./collection-node/nodeCollection"; import { EdgeId } from "./edge"; import { FindNeighborsOptions, Neighbor } from "./findNeighbors"; import { GraphSnapshot, GraphSnapshotOptions } from "./graphSnapshot"; import { TransformFunction } from "./transform/transform"; import { LayoutFunction, NodeIdToPosition } from "./layout/layout"; import { TweenLayoutOverrides } from "./layout/tween/tweenLayout"; import { NodeId } from "./node"; import { Properties } from "./properties"; import { EdgeStyle, EdgeStyles, NodeStyle, NodeStyles } from "./styles"; export interface GraphMergeOptions { /** * If true, nodes in the target which are not in the source will be deleted. */ deleteMissingNodesAndEdges?: boolean; propertyMergeStrategy?: PropertyMergeStrategy; } export declare enum PropertyMergeStrategy { /** * Copy properties from the source to the target. Properties in the target which are not in the source are kept. */ ASSIGN = 0, /** * Erase properties in the target and then copy properties from the source to the target. */ REPLACE = 1, /** * Don't touch properties in the target */ KEEP = 2 } export interface LayoutGraph { clear(): void; clone(): LayoutGraph; getAllNodes(): ApiNode[]; getNodes(): ApiNode[]; getVisibleNodes(): ApiNode[]; getNode(id: NodeId): ApiNode | undefined; addNode(node: ApiNode): ApiNode; addNodes(nodes: ApiNode[]): ApiNode[]; removeNode(id: NodeId): ApiNode | undefined; removeNodes(ids: NodeId[]): ApiNode[]; getAllEdges(): ApiEdge[]; getEdges(): ApiEdge[]; applySnapshot(snapshot: GraphSnapshot): void; getSnapshot(options?: GraphSnapshotOptions): GraphSnapshot; getVisibleEdges(): ApiEdge[]; getEdge(id: EdgeId): ApiEdge | undefined; addEdge(edge: ApiEdge): ApiEdge; addEdges(edges: ApiEdge[]): ApiEdge[]; removeEdge(id: EdgeId): ApiEdge | undefined; removeEdges(ids: EdgeId[]): ApiEdge[]; findNeighbors(id: NodeId, options?: FindNeighborsOptions): Neighbor[]; applyTransform(transform: TransformFunction): void; assign(graph: LayoutGraph): LayoutGraph; replace(graph: LayoutGraph): LayoutGraph; merge(graph: LayoutGraph, options: GraphMergeOptions): LayoutGraph; setNodeCategory(id: NodeId, category: CategoryId): void; setNodeCollection(id: NodeId, collection: NodeCollection): void; setNodeProperties(id: NodeId, properties: Properties): void; setEdgeProperties(id: EdgeId, properties: Properties): void; getNodeStyles(id: NodeId): Partial; getEdgeStyles(id: EdgeId): Partial; setNodeStyles(id: NodeId, styles: Partial): void; setEdgeStyles(id: EdgeId, styles: Partial): void; getNodeStyle(id: NodeId, key: K): Partial[K]; setNodeStyle(id: NodeId, key: K, value: NodeStyles[K]): void; getEdgeStyle(id: EdgeId, key: K): Partial[K]; setEdgeStyle(id: EdgeId, key: K, value: EdgeStyles[K]): void; applyLayout(layout: LayoutFunction, tweenOverrides?: TweenLayoutOverrides): Promise; showNodes(ids: NodeId[]): void; hideNodes(ids: NodeId[]): void; showEdges(ids: EdgeId[]): void; hideEdges(ids: EdgeId[]): void; } export declare class BaseGraph implements LayoutGraph { applyLayout(computeLayout: LayoutFunction, tweenOverrides?: TweenLayoutOverrides): Promise; applyTransform(transform: TransformFunction): void; /** * `assign` copies the source graph into this graph, similar to Object.assign(target, source). * `assign` uses Object.assign to merge properties and replaces node styles. * Useful when you get a Neo4j result and want to overlay it on the graph workspace. */ assign(source: LayoutGraph): LayoutGraph; /** * Useful when you want to replace the target graph with another one. */ replace(source: LayoutGraph): LayoutGraph; /** * `merge` takes a source graph and merges it into this graph. * New nodes and edges from the source graph are added. * Attributes (e.g. `properties`, `styles`, `category`) of nodes with same id are copied. * Attributes (e.g. `properties`, `styles`, `relationship`) of edges with same id are copied. * If deleteMissingNodesAndEdges is true, then any nodes and edges in the source graph that are not in the target graph (this graph) will be **deleted**. * If deleteMissingNodesAndEdges is false, then any nodes and edges in the source graph that are not in the target graph (this graph) will be **kept**. */ merge(source: LayoutGraph, options?: GraphMergeOptions): LayoutGraph; clear(): void; clone(): LayoutGraph; getAllNodes(): ApiNode[]; getVisibleNodes(): ApiNode[]; getNode(_id: string): ApiNode | undefined; addNode(_node: Readonly): ApiNode; addNodes(_nodes: Readonly[]): ApiNode[]; removeNode(_id: string): ApiNode | undefined; removeNodes(_ids: string[]): ApiNode[]; getAllEdges(): ApiEdge[]; getVisibleEdges(): ApiEdge[]; getEdge(_id: string): ApiEdge | undefined; addEdge(_edge: Readonly): ApiEdge; addEdges(_edges: Readonly[]): ApiEdge[]; removeEdge(_id: string): ApiEdge | undefined; removeEdges(_ids: string[]): ApiEdge[]; findNeighbors(_id: string, _options?: FindNeighborsOptions): Neighbor[]; setNodeCategory(_id: string, _category: CategoryId): void; setNodeCollection(_id: string, _collection: NodeCollection): void; setNodeProperties(_id: string, _properties: Properties): void; setEdgeProperties(_id: string, _properties: Properties): void; showNodes(_ids: string[]): void; hideNodes(_ids: string[]): void; showEdges(_ids: string[]): void; hideEdges(_ids: string[]): void; getNodes(): ApiNode[]; getEdges(): ApiEdge[]; getNodeStyles(_id: string): Partial; getEdgeStyles(_id: string): Partial; setNodeStyles(_id: string, _styles: Partial): void; setEdgeStyles(_id: string, _styles: Partial): void; getNodeStyle(_id: string, _key: K): Partial[K]; setNodeStyle(_id: string, _key: K, _value: NodeStyles[K]): void; getEdgeStyle(_id: string, _key: K): Partial[K]; setEdgeStyle(_id: string, _key: K, _value: EdgeStyles[K]): void; applySnapshot(_snapshot: GraphSnapshot): void; getSnapshot(partialOptions?: GraphSnapshotOptions): GraphSnapshot; }