UNPKG

@eclipse-glsp/layout-elk

Version:

Integration of ELK graph layout algorithms in GLSP Node Server

53 lines 2.4 kB
import { LayoutOptions } from 'elkjs/lib/elk.bundled'; import { ContainerModule } from 'inversify'; import { ElementFilter } from './element-filter'; import { LayoutConfigurator } from './layout-configurator'; type Constructor<T> = new (...args: any[]) => T; /** * Configuration options for the {@link configureELKLayoutModule} function. */ export interface ElkModuleOptions { /** * The set of elk algorithms that is used by the {@link GlspElkLayoutEngine}. */ algorithms: string[]; /** * Additional default layout options. This options are passed to the underlying {@link ElkFactory}. * In addition, they are used to configure the {@link FallbackGlspLayoutConfigurator}. */ defaultLayoutOptions?: LayoutOptions; /** * The custom {@link LayoutConfigurator} class that should be bound. If this option is not set * the {@link FallbackLayoutConfigurator} is bound instead. */ layoutConfigurator?: Constructor<LayoutConfigurator>; /** * The custom {@link ElementFilter} class that should be bound. If this option is not set, the default implementation * is bound. */ elementFilter?: Constructor<ElementFilter>; /** * A flag to indicate whether a WebWorker context is provided. If this option is set, a feature is mocked that would * only be available in a node environment. */ isWebWorker?: boolean; } /** * Utility method to create a DI module that provides all necessary bindings to use the {@link GlspElkLayoutEngine} in a node GLSP server * implementation. A set of configuration options is provided to enable easy customization. In most cases at least * the custom {@link layoutConfigurator} binding should be provided (in addition to the required `algorithms' property) via these options. * * The constructed module is not intended for standalone use cases and only works in combination with a GLSPDiagramModule. * * * The following bindings are provided: * - {@link ILayoutConfigurator} * - {@link IElementFilter} * - {@link LayoutEngine} * - {@link ElkFactory} * * @param options The configuration options * @returns A DI module that can be loaded as additional module when configuring a diagram module for a GLSP server. */ export declare function configureELKLayoutModule(options: ElkModuleOptions): ContainerModule; export {}; //# sourceMappingURL=di.config.d.ts.map