rete-auto-arrange-plugin
packageAuto arrange plugin. Layouts the graph using elk.js
class AutoArrangePlugin<Schemes extends ExpectedSchemes, T extends unknown>
Parameter | Extends | Description |
---|---|---|
Schemes | ExpectedSchemes | |
T | unknown |
Extends Scope<never, BaseArea
Adds a preset to the plugin, which will be used to layout the node ports and customize the layout options
addPreset(preset: Preset): void
Parameter | Type | Description |
---|---|---|
preset | Preset | Preset to add |
Returns void
Method to layout the graph
layout(props: { applier: Applier<Schemes, T>, options: LayoutOptions } & Partial<Context<Schemes>>): Promise<{ demonstration: string, result: ElkNode, source: string }>
Parameter | Type | Description |
---|---|---|
props | { applier: Applier<Schemes, T>, options: LayoutOptions } & Partial<Context<Schemes>> | Options for the layout |
Returns Promise<{ demonstration: string, result: ElkNode, source: string }>
Debug information about the layout
Standard applier. Applies the layout to the nodes and their children immediately
class StandardApplier<S extends ExpectedSchemes, K extends unknown>
Parameter | Extends | Description |
---|---|---|
S | ExpectedSchemes | |
K | unknown |
Extended by TransitionApplier
Extends Applier<S, K>
appliers/list/transition/index.ts
Transition applier. Applies the layout to the nodes and their children with transition
class TransitionApplier<S extends ExpectedSchemes, K extends unknown>
Parameter | Extends | Description |
---|---|---|
S | ExpectedSchemes | |
K | unknown |
Extends StandardApplier<S, K>
appliers/list/transition/index.ts
constructor(props: TransitionApplierProps): TransitionApplier<S, K>
Parameter | Type | Description |
---|---|---|
props | TransitionApplierProps | Transition applier props |
Returns TransitionApplier<S, K>
appliers/list/transition/index.ts
Transition applier props
type TransitionApplierProps = {
duration: number;
needsLayout: Function;
onTick: Function;
timingFunction: Function;
};
Built-in presets. Responsible for node port positioning.
Classic preset. Input ports are positioned on the left bottom side of the node, output ports are positioned on the right top side of the node.
setup(props: { bottom: number, spacing: number, top: number }): Preset
Parameter | Type | Description |
---|---|---|
props | { bottom: number, spacing: number, top: number } |
Returns Preset