@hydro-project/hydroscope
Version:
React-based graph visualization library for Hydro dataflow programs
61 lines • 2.24 kB
TypeScript
/**
* @fileoverview ELK Bridge - Clean interface between VisState and ELK
*
* This bridge implements the core architectural principle:
* - VisState contains ALL data (nodes, edges, containers)
* - ELK gets visible elements only through visibleEdges (hyperedges included transparently)
* - ELK returns layout positions that get applied back to VisState
*/
import { VisualizationState } from '../core/VisualizationState';
import type { LayoutConfig } from '../core/types';
export declare class ELKBridge {
private elk;
private layoutConfig;
constructor(layoutConfig?: LayoutConfig);
/**
* Update layout configuration
*/
updateLayoutConfig(config: LayoutConfig): void;
/**
* Convert VisState to ELK format and run layout
* Key insight: Include ALL visible edges (regular + hyper) with no distinction
*/
layoutVisState(visState: VisualizationState): Promise<void>;
/**
* Log ELK graph structure for debugging layout issues
*/
private logELKGraphStructure;
/**
* Validate ELK input data to prevent null reference errors
* NOTE: This should only validate format, not apply business rules
*/
private validateELKInput;
/**
* Convert VisState to ELK format
* HIERARCHICAL: Use proper ELK hierarchy to match ReactFlow parent-child relationships
*/
private visStateToELK;
/**
* Apply ELK results back to VisState
*/
private elkToVisState;
/**
* Update container dimensions and child positions from ELK result
*/
private updateContainerFromELK;
/**
* Update node position from ELK result
*/
private updateNodeFromELK;
/**
* Get containers requiring layout (moved from VisualizationState)
* This is ELK-specific logic for determining which containers need layout
*/
getContainersRequiringLayout(visState: VisualizationState, changedContainerId?: string): ReadonlyArray<any>;
/**
* Get container ELK fixed status (moved from VisualizationState)
* This is ELK-specific logic for tracking fixed positions
*/
getContainerELKFixed(visState: VisualizationState, containerId: string): boolean;
}
//# sourceMappingURL=ELKBridge.d.ts.map