Aller au contenu

NodeEditor

Ce contenu n’est pas encore disponible dans votre langue.

Classes

NodeEditor

A graph editor for visual programming.

A low level class that manages nodes and connections.

Extends

Constructors

new NodeEditor()
new NodeEditor(__namedParameters): NodeEditor
Parameters

__namedParameters = {}

__namedParameters.id?: string

Returns

NodeEditor

Overrides

BaseNodeEditor<Schemes>.constructor

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:102

Properties

__scope
__scope: object;
parents
parents: [];
produces
produces: Root<Schemes>;
Inherited from

BaseNodeEditor.__scope

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:49

clearing
clearing: boolean;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:304

connectionsMap
connectionsMap: SvelteMap<string, Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>>;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:80

factory?
optional factory: NodeFactory;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:27

id
id: string;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:77

name
readonly name: "Node Editor" = 'Node Editor';
Overrides

BaseNodeEditor.name

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:39

nameStore
nameStore: Readable<string>;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:59

nodesMap
nodesMap: SvelteMap<string, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:79

onChangeNameListeners
onChangeNameListeners: (name) => void[] = [];
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:72

parent?
optional parent: any;
Inherited from

BaseNodeEditor.parent

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:48

previewedNodes
previewedNodes: SvelteSet<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:32

selectedInputs
selectedInputs: object[];
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:86

selectedOutputs
selectedOutputs: object[];
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:92

signal
signal: Signal<any>;
Inherited from

BaseNodeEditor.signal

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:47

variables
variables: Record<string, Variable>;
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:31

Accessors

area
get area(): undefined | AreaPlugin<Schemes, AreaExtra>
Returns

undefined | AreaPlugin<Schemes, AreaExtra>

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:28

connections
get connections(): Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>[]
Returns

Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>[]

Overrides

BaseNodeEditor.connections

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:98

graphId
get graphId(): string
set graphId(id): void
Parameters

id: undefined | string

Returns

string

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:47

graphName
get graphName(): string
set graphName(n): void
Parameters

n: string

Returns

string

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:52

nodes
get nodes(): Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>[]
Returns

Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>[]

Overrides

BaseNodeEditor.nodes

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:82

Methods

addConnection()
addConnection(conn): Promise<boolean>

Adds a connection to the editor.

Parameters

conn: Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>

connection to add

Returns

Promise<boolean>

Whether the connection was added

Overrides

BaseNodeEditor.addConnection

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:205

addExecConnection()
addExecConnection(source, target): Promise<boolean>
Parameters

source: Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

target: Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

Returns

Promise<boolean>

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:220

addNewConnection()
addNewConnection(
source,
sourceOutput,
target,
targetInput): Promise<undefined | Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>>
Parameters

source: string | Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

sourceOutput: string

target: string | Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

targetInput: string

Returns

Promise<undefined | Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>>

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:229

addNode()
addNode(node): Promise<boolean>

Adds a node to the editor.

Parameters

node: Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

node to add

Returns

Promise<boolean>

Whether the node was added

Overrides

BaseNodeEditor.addNode

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:188

addOnChangeNameListener()
addOnChangeNameListener(listener): void
Parameters

listener

Returns

void

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:73

addPipe()
addPipe(middleware): void
Parameters

middleware: Pipe<Root<Schemes>>

Returns

void

Inherited from

BaseNodeEditor.addPipe

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:54

clear()
clear(): Promise<boolean>

Clear all nodes and connections

Returns

Promise<boolean>

Whether the editor was cleared

Emits

clear

Emits

clearcancelled

Emits

cleared

Overrides

BaseNodeEditor.clear

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:306

emit()
emit<C>(context): Promise<
| undefined
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>
| Extract<object, C>>
Type Parameters

C extends Root<Schemes>

Parameters

context: C

Returns

Promise< | undefined | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C> | Extract<object, C>>

Inherited from

BaseNodeEditor.emit

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:59

getConnection()
getConnection(id): undefined | Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>

Gets a connection by id.

Parameters

id: string

id of the connection

Returns

undefined | Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>

The connection or undefined

Overrides

BaseNodeEditor.getConnection

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:135

getConnections()
getConnections(): Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>[]

Gets all connections.

Returns

Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>[]

An array of all connections in the editor

Overrides

BaseNodeEditor.getConnections

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:143

getNode()
getNode(id): undefined | Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

Gets a node by id.

Parameters

id: string

id of the node

Returns

undefined | Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

The node or undefined

Overrides

BaseNodeEditor.getNode

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:117

getNodes()
getNodes(): Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>[]

Gets all nodes.

Returns

Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>[]

An array of all nodes in the editor

Overrides

BaseNodeEditor.getNodes

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:125

hasConnection()
hasConnection(id)
hasConnection(id): boolean

Returns whether the editor has a connection with the given id.

Parameters

id: string

id of the connection to check for

Returns

boolean

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:169

hasConnection(connection)
hasConnection(connection): boolean

Returns whether the editor has a connection.

Parameters

connection: Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>

connection to check for

Returns

boolean

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:174

hasNode()
hasNode(id)
hasNode(id): boolean

Returns whether the editor has a node with the given id.

Parameters

id: string

id of the node to check for

Returns

boolean

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:151

hasNode(node)
hasNode(node): boolean

Returns whether the editor has a node.

Parameters

node: Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

node to check for

Returns

boolean

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:156

hasParent()
hasParent(): boolean
Returns

boolean

Inherited from

BaseNodeEditor.hasParent

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:60

parentScope()
parentScope()
parentScope<T, P>(): Scope<T, P>
Type Parameters

T extends undefined

P extends []

Returns

Scope<T, P>

Inherited from

BaseNodeEditor.parentScope

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:61

parentScope(type)
parentScope<T>(type): T
Type Parameters

T

Parameters

type: Type<T>

Returns

T

Inherited from

BaseNodeEditor.parentScope

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:62

removeConnection()
removeConnection(id)
removeConnection(id): Promise<boolean>

Remove a connection

Parameters

id: string

The connection id

Returns

Promise<boolean>

Whether the connection was removed

Throws

If the connection cannot be found

Emits

connectionremove

Emits

connectionremoved

Overrides

BaseNodeEditor.removeConnection

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:282

removeConnection(conn)
removeConnection(conn): Promise<boolean>

Remove a connection

Parameters

conn: Connection<Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>, Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>>

Returns

Promise<boolean>

Whether the connection was removed

Throws

If the connection cannot be found

Emits

connectionremove

Emits

connectionremoved

Overrides

BaseNodeEditor.removeConnection

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:283

removeNode()
removeNode(id)
removeNode(id): Promise<boolean>

Remove a node

Parameters

id: string

The node id

Returns

Promise<boolean>

Whether the node was removed

Throws

If the node cannot be found

Emits

noderemove

Emits

noderemoved

Overrides

BaseNodeEditor.removeNode

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:259

removeNode(node)
removeNode(node): Promise<boolean>

Remove a node

Parameters

node: Node<Record<string, Socket<SocketType, "scalar" | "array">>, object, object, Record<string, unknown>, Record<string, unknown>>

Returns

Promise<boolean>

Whether the node was removed

Throws

If the node cannot be found

Emits

noderemove

Emits

noderemoved

Overrides

BaseNodeEditor.removeNode

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:260

setName()
setName(name): void
Parameters

name: string

Returns

void

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:36

setParent()
setParent(scope): void
Parameters

scope: Scope<undefined, []>

Returns

void

Inherited from

BaseNodeEditor.setParent

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:58

toJSON()
toJSON(): object
Returns

object

comments
comments: object[];
connections
connections: ConnectionSaveData[];
editorName
editorName: string;
graphName
graphName: string;
id
id: undefined | string;
nodes
nodes: NodeSaveData[];
previewedNodes
previewedNodes: string[];
variables
variables: Record<string, Variable> | Variable[];
Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:330

use()
use<S>(scope): object
Type Parameters

S extends Scope<any, any[]>

Parameters

scope: NestedScope<S, [Root<Schemes>]>

Returns

object

debug()
Type Parameters

T extends []

Parameters

_f

Returns

void

Inherited from

BaseNodeEditor.use

Defined in

tmp/graph-editor/node_modules/rete/_types/scope.d.ts:55

Type Aliases

CommentSaveData

type CommentSaveData: object;

Type declaration

id
id: string;
links: string[];
text
text: string;

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:13


NodeEditorSaveData

type NodeEditorSaveData: SaveData<NodeEditor>;

Defined in

tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:19