rete-dock-plugin
packageDock plugin. Allows to create nodes from the dock by dragging or clicking.
class DockPlugin<Schemes extends BaseSchemes>
Parameter | Extends | Description |
---|---|---|
Schemes | BaseSchemes |
Extends Scope<never, Area2DInherited<Schemes, never>>
Emits render
Add node to the dock.
add(create: () => Schemes["Node"], index: number): void
Parameter | Type | Description |
---|---|---|
create | () => Schemes["Node"] | Function that creates node. |
index | number | Index of the node in the dock, optional. |
Returns void
Add preset to the dock plugin.
addPreset(preset: Preset): void
Parameter | Type | Description |
---|---|---|
preset | Preset | Preset that will manage dock items. |
Returns void
Remove node from the dock.
remove(create: () => Schemes["Node"]): void
Parameter | Type | Description |
---|---|---|
create | () => Schemes["Node"] | Function that creates node. Must be the same as in add method. |
Returns void
Presets for the dock plugin
Classic preset for the dock plugin. Creates container for list of nodes and containers each node.
setup(props: { area: AreaPlugin<BaseSchemes, T>, scale: number, size: number }): Preset
Parameter | Type | Description |
---|---|---|
props | { area: AreaPlugin<BaseSchemes, T>, scale: number, size: number } | Preset properties |
Returns Preset