@kit-data-manager/react-search-component
Version:
All-in-one component for rendering an elastic search UI for searching anything. Built-in support for visualizing related items in a graph and resolving unique identifiers.
64 lines (63 loc) • 1.99 kB
TypeScript
import { Edge, Node } from "@xyflow/react";
import { GraphNode } from "../../components/graph/GraphNode";
export declare abstract class GraphUtils {
static buildGraphFromNodes(nodes: GraphNode[]): {
initialNodes: {
id: string;
type: string;
position: {
x: number;
y: number;
};
data: Record<string, unknown>;
}[];
initialEdges: {
id: string;
source: string;
target: string;
}[];
};
static computeNodeLayout(nodes: (Node & {
type: string;
})[], edges: Edge[]): {
nodes: {
position: {
x: number;
y: number;
};
id: string;
data: Record<string, unknown>;
type: string;
sourcePosition?: import("@xyflow/system").Position;
targetPosition?: import("@xyflow/system").Position;
hidden?: boolean;
selected?: boolean;
dragging?: boolean;
draggable?: boolean;
selectable?: boolean;
connectable?: boolean;
deletable?: boolean;
dragHandle?: string;
width?: number;
height?: number;
initialWidth?: number;
initialHeight?: number;
parentId?: string;
zIndex?: number;
extent?: "parent" | import("@xyflow/system").CoordinateExtent;
expandParent?: boolean;
ariaLabel?: string;
origin?: import("@xyflow/system").NodeOrigin;
handles?: import("@xyflow/system").NodeHandle[];
measured?: {
width?: number;
height?: number;
};
style?: import("react").CSSProperties;
className?: string;
resizing?: boolean;
focusable?: boolean;
}[];
edges: Edge[];
};
}