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

API for rete-scopes-plugin package

Scopes

index.ts

Signal types produced by ConnectionPlugin instance

ts
type Scopes =
  | { data: Object; type: "scopepicked" }
  | { data: Object; type: "scopereleased" }
  | { data: Object; type: "scopeupdated" };

ScopesPlugin

index.ts

Scope plugin. Responsible for user interaction with scopes (nested nodes, groups)

ts
class ScopesPlugin<Schemes extends ExpectedScheme, T extends unknown>
ParameterExtendsDescription
SchemesExpectedScheme
Tunknown

Extends Scope<Scopes, Requires, Root>

Emits scopepicked scopereleased

Listens nodetranslated noderemoved

addPreset

index.ts

Adds a preset to the plugin.

ts
addPreset(preset: Preset): void
ParameterTypeDescription
presetPresetPreset that is responsible for user interactions with scopes (e.g. assigning nodes to scopes)

Returns void

Presets

presets/index.ts

Presets for scopes plugin.

classic

presets/classic/index.ts

setup

presets/classic/index.ts

Classic preset allowing capturing a node by long-pressing it and dropping it onto another node to make it a nested.

ts
setup(): Preset

Emits scopepicked scopereleased

Listens nodepicked nodetranslated nodedragged

Returns Preset Preset

Props

index.ts

Props for ScopesPlugin class.

ts
type Props = { exclude: Function; padding: Function; size: Function };