API for rete-dock-plugin package - Rete.js

API for rete-dock-plugin package

DockPlugin

index.ts

Dock plugin. Allows to create nodes from the dock by dragging or clicking.

ts
class DockPlugin<Schemes extends BaseSchemes>
ParameterExtendsDescription
SchemesBaseSchemes

Extends Scope<never, Area2DInherited<Schemes, never>>

Emits render

add

index.ts

Add node to the dock.

ts
add(create: () => Schemes["Node"], index: number): void
ParameterTypeDescription
create() => Schemes["Node"]Function that creates node.
indexnumberIndex of the node in the dock, optional.

Returns void

addPreset

index.ts

Add preset to the dock plugin.

ts
addPreset(preset: Preset): void
ParameterTypeDescription
presetPresetPreset that will manage dock items.

Returns void

remove

index.ts

Remove node from the dock.

ts
remove(create: () => Schemes["Node"]): void
ParameterTypeDescription
create() => Schemes["Node"]Function that creates node. Must be the same as in add method.

Returns void

DockPresets

presets/index.ts

Presets for the dock plugin

classic

presets/classic/index.ts

setup

presets/classic/index.ts

Classic preset for the dock plugin. Creates container for list of nodes and containers each node.

ts
setup(props: { area: AreaPlugin<BaseSchemes, T>, scale: number, size: number }): Preset
ParameterTypeDescription
props{ area: AreaPlugin<BaseSchemes, T>, scale: number, size: number }Preset properties

Returns Preset