import React from 'react'; export type GraphViewLayoutName = 'breadthfirst' | 'circle' | 'concentric' | 'elk' | 'grid'; export type GraphViewElementEventType = 'press' | 'double-press' | 'select' | 'unselect' | 'pointer-enter' | 'pointer-leave'; export interface GraphViewNode { readonly id: string; readonly label?: string; readonly parentId?: string; readonly classes?: string; readonly data?: Readonly>; } export interface GraphViewEdge { readonly id?: string; readonly source: string; readonly target: string; readonly classes?: string; readonly data?: Readonly>; } export interface GraphViewStyleRule { readonly selector: string; readonly style: Readonly>; } export interface GraphViewPoint { readonly x: number; readonly y: number; } export interface GraphViewSize { readonly width: number; readonly height: number; } export interface GraphViewNodeRenderContext { readonly hovered: boolean; readonly node: GraphViewNode; readonly selected: boolean; readonly zoom: number; } export interface GraphViewRenderedNode { readonly hovered: boolean; readonly id: string; readonly position: GraphViewPoint; readonly selected: boolean; readonly zoom: number; } export interface GraphViewViewport { readonly zoom: number; readonly pan: GraphViewPoint; } export interface GraphViewFitOptions { /** Optimize existing layout spacing without rerunning its algorithm; whole-graph fits only. */ readonly optimizeSpacing?: boolean; readonly nodeIds?: readonly string[]; readonly padding?: number; } export interface GraphViewElementEvent { readonly id: string; readonly type: GraphViewElementEventType; } export interface GraphViewController { fit(options?: GraphViewFitOptions): void; getViewport(): GraphViewViewport; getZoomRange(): { readonly min: number; readonly max: number; }; setPan(pan: GraphViewPoint): void; setZoom(zoom: number): void; zoomBy(factor: number): void; } export interface GraphViewProps { readonly nodes: readonly GraphViewNode[]; readonly edges: readonly GraphViewEdge[]; readonly layout?: GraphViewLayoutName; readonly layoutOptions?: Readonly>; readonly spacingFactor?: number; readonly styleRules?: readonly GraphViewStyleRule[]; readonly selectedNodeIds?: readonly string[]; readonly renderNode?: (context: GraphViewNodeRenderContext) => React.ReactNode; readonly getNodeSize?: (node: GraphViewNode) => GraphViewSize | undefined; readonly fitPadding?: number; readonly minZoom?: number; readonly maxZoom?: number; readonly minReadableLabelSize?: number; readonly maxFitLabelSize?: number; /** Zoom values and bounds use the full-node fit as 1 when fit-relative is selected. */ readonly zoomMode?: 'absolute' | 'fit-relative'; /** Measure plain labels before layout instead of estimating width from character count. */ readonly sizeNodesToLabels?: boolean; readonly className?: string; readonly style?: React.CSSProperties; readonly ariaLabel?: string; readonly onReady?: (controller: GraphViewController) => void; readonly onLayoutComplete?: (controller: GraphViewController) => void; readonly onNodeEvent?: (event: GraphViewElementEvent) => void; readonly onEdgeEvent?: (event: GraphViewElementEvent) => void; readonly onViewportChange?: (viewport: GraphViewViewport) => void; readonly onSpacingFactorChange?: (spacingFactor: number) => void; } export type GraphViewCallbacks = Pick; /*** * Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal. * @config zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative * to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units. * @config sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode * text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners. * @config minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size. * @config maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs. * @config onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }). * Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering * and uses bounded collision checks including labels and compound siblings; it can recover uniformly * cramped layouts but cannot repair non-uniform overlaps. */ export declare function GraphView(props: GraphViewProps): React.JSX.Element; //# sourceMappingURL=GraphView.d.ts.map