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
NodeEditor
<Schemes
>
Constructors
new NodeEditor()
Parameters
• __namedParameters = {}
• __namedParameters.id?: string
Returns
Overrides
BaseNodeEditor<Schemes>.constructor
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:102
Properties
__scope
parents
produces
Inherited from
BaseNodeEditor.__scope
Defined in
tmp/graph-editor/node_modules/rete/_types/scope.d.ts:49
clearing
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:304
connectionsMap
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:80
factory?
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:27
id
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:77
name
Overrides
BaseNodeEditor.name
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:39
nameStore
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:59
nodesMap
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:79
onChangeNameListeners
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:72
parent?
Inherited from
BaseNodeEditor.parent
Defined in
tmp/graph-editor/node_modules/rete/_types/scope.d.ts:48
previewedNodes
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:32
selectedInputs
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:86
selectedOutputs
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:92
signal
Inherited from
BaseNodeEditor.signal
Defined in
tmp/graph-editor/node_modules/rete/_types/scope.d.ts:47
variables
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:31
Accessors
area
Returns
undefined
| AreaPlugin
<Schemes
, AreaExtra
>
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:28
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
>>>[]
Overrides
BaseNodeEditor.connections
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:98
graphId
Parameters
• id: undefined
| string
Returns
string
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:47
graphName
Parameters
• n: string
Returns
string
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:52
nodes
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()
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()
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()
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()
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()
Parameters
• listener
Returns
void
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:73
addPipe()
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 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()
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()
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()
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()
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()
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)
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)
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)
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)
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()
Returns
boolean
Inherited from
BaseNodeEditor.hasParent
Defined in
tmp/graph-editor/node_modules/rete/_types/scope.d.ts:60
parentScope()
parentScope()
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)
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)
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)
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)
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)
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()
Parameters
• name: string
Returns
void
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:36
setParent()
Parameters
• scope: Scope
<undefined
, []>
Returns
void
Inherited from
BaseNodeEditor.setParent
Defined in
tmp/graph-editor/node_modules/rete/_types/scope.d.ts:58
toJSON()
Returns
object
comments
connections
editorName
graphName
id
nodes
previewedNodes
variables
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:330
use()
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 declaration
id
links
text
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:13
NodeEditorSaveData
Defined in
tmp/graph-editor/src/lib/graph-editor/editor/NodeEditor.svelte.ts:19