pub enum GraphOp {
Show 61 variants
AddNode {
id: NodeId,
node: Node,
},
RemoveNode {
id: NodeId,
node: Node,
ports: Vec<(PortId, Port)>,
edges: Vec<(EdgeId, Edge)>,
bindings: Vec<(BindingId, Binding)>,
},
SetNodePos {
id: NodeId,
from: CanvasPoint,
to: CanvasPoint,
},
SetNodeOrigin {
id: NodeId,
from: Option<NodeOrigin>,
to: Option<NodeOrigin>,
},
SetNodeKind {
id: NodeId,
from: NodeKindKey,
to: NodeKindKey,
},
SetNodeKindVersion {
id: NodeId,
from: u32,
to: u32,
},
SetNodeSelectable {
id: NodeId,
from: Option<bool>,
to: Option<bool>,
},
SetNodeFocusable {
id: NodeId,
from: Option<bool>,
to: Option<bool>,
},
SetNodeDraggable {
id: NodeId,
from: Option<bool>,
to: Option<bool>,
},
SetNodeConnectable {
id: NodeId,
from: Option<bool>,
to: Option<bool>,
},
SetNodeDeletable {
id: NodeId,
from: Option<bool>,
to: Option<bool>,
},
SetNodeParent {
id: NodeId,
from: Option<GroupId>,
to: Option<GroupId>,
},
SetNodeExtent {
id: NodeId,
from: Option<NodeExtent>,
to: Option<NodeExtent>,
},
SetNodeExpandParent {
id: NodeId,
from: Option<bool>,
to: Option<bool>,
},
SetNodeSize {
id: NodeId,
from: Option<CanvasSize>,
to: Option<CanvasSize>,
},
SetNodeHidden {
id: NodeId,
from: bool,
to: bool,
},
SetNodeCollapsed {
id: NodeId,
from: bool,
to: bool,
},
SetNodePorts {
id: NodeId,
from: Vec<PortId>,
to: Vec<PortId>,
},
SetNodeData {
id: NodeId,
from: Value,
to: Value,
},
AddPort {
id: PortId,
port: Port,
},
RemovePort {
id: PortId,
port: Port,
edges: Vec<(EdgeId, Edge)>,
bindings: Vec<(BindingId, Binding)>,
},
SetPortConnectable {
id: PortId,
from: Option<bool>,
to: Option<bool>,
},
SetPortConnectableStart {
id: PortId,
from: Option<bool>,
to: Option<bool>,
},
SetPortConnectableEnd {
id: PortId,
from: Option<bool>,
to: Option<bool>,
},
SetPortType {
id: PortId,
from: Option<TypeDesc>,
to: Option<TypeDesc>,
},
SetPortData {
id: PortId,
from: Value,
to: Value,
},
AddEdge {
id: EdgeId,
edge: Edge,
},
RemoveEdge {
id: EdgeId,
edge: Edge,
bindings: Vec<(BindingId, Binding)>,
},
SetEdgeKind {
id: EdgeId,
from: EdgeKind,
to: EdgeKind,
},
SetEdgeSelectable {
id: EdgeId,
from: Option<bool>,
to: Option<bool>,
},
SetEdgeFocusable {
id: EdgeId,
from: Option<bool>,
to: Option<bool>,
},
SetEdgeHidden {
id: EdgeId,
from: bool,
to: bool,
},
SetEdgeInteractionWidth {
id: EdgeId,
from: Option<f32>,
to: Option<f32>,
},
SetEdgeDeletable {
id: EdgeId,
from: Option<bool>,
to: Option<bool>,
},
SetEdgeReconnectable {
id: EdgeId,
from: Option<EdgeReconnectable>,
to: Option<EdgeReconnectable>,
},
SetEdgeEndpoints {
id: EdgeId,
from: EdgeEndpoints,
to: EdgeEndpoints,
},
AddImport {
id: GraphId,
import: GraphImport,
},
RemoveImport {
id: GraphId,
import: GraphImport,
},
SetImportAlias {
id: GraphId,
from: Option<String>,
to: Option<String>,
},
AddSymbol {
id: SymbolId,
symbol: Symbol,
},
RemoveSymbol {
id: SymbolId,
symbol: Symbol,
},
SetSymbolName {
id: SymbolId,
from: String,
to: String,
},
SetSymbolType {
id: SymbolId,
from: Option<TypeDesc>,
to: Option<TypeDesc>,
},
SetSymbolDefaultValue {
id: SymbolId,
from: Option<Value>,
to: Option<Value>,
},
SetSymbolMeta {
id: SymbolId,
from: Value,
to: Value,
},
AddGroup {
id: GroupId,
group: Group,
},
RemoveGroup {
id: GroupId,
group: Group,
detached: Vec<(NodeId, Option<GroupId>)>,
bindings: Vec<(BindingId, Binding)>,
},
SetGroupRect {
id: GroupId,
from: CanvasRect,
to: CanvasRect,
},
SetGroupTitle {
id: GroupId,
from: String,
to: String,
},
SetGroupColor {
id: GroupId,
from: Option<String>,
to: Option<String>,
},
AddStickyNote {
id: StickyNoteId,
note: StickyNote,
},
RemoveStickyNote {
id: StickyNoteId,
note: StickyNote,
bindings: Vec<(BindingId, Binding)>,
},
SetStickyNoteText {
id: StickyNoteId,
from: String,
to: String,
},
SetStickyNoteRect {
id: StickyNoteId,
from: CanvasRect,
to: CanvasRect,
},
SetStickyNoteColor {
id: StickyNoteId,
from: Option<String>,
to: Option<String>,
},
AddBinding {
id: BindingId,
binding: Binding,
},
RemoveBinding {
id: BindingId,
binding: Binding,
},
SetBindingSubject {
id: BindingId,
from: BindingEndpoint,
to: BindingEndpoint,
},
SetBindingTarget {
id: BindingId,
from: BindingEndpoint,
to: BindingEndpoint,
},
SetBindingKind {
id: BindingId,
from: Option<String>,
to: Option<String>,
},
SetBindingMeta {
id: BindingId,
from: Value,
to: Value,
},
}Expand description
A reversible edit operation.
Destructive variants carry the removed data so the operation can be inverted for undo/redo. Higher-level tools should batch multiple ops into a single transaction.
Variants§
AddNode
Adds a node.
RemoveNode
Removes a node.
This operation is expected to remove associated ports and edges as well.
Fields
SetNodePos
Sets a node position.
SetNodeOrigin
Sets a node origin override.
SetNodeKind
Sets a node kind identifier.
SetNodeKindVersion
Sets a node kind version (for per-kind migrations).
SetNodeSelectable
Sets a node selectable override.
SetNodeFocusable
Sets a node focusable override.
SetNodeDraggable
Sets a node draggable override.
SetNodeConnectable
Sets a node connectable override.
SetNodeDeletable
Sets a node deletable override.
SetNodeParent
Sets a node parent container (group frame).
SetNodeExtent
Sets a node extent override.
SetNodeExpandParent
Sets a node expand-parent override.
SetNodeSize
Sets a node explicit size.
SetNodeHidden
Sets a node hidden state.
SetNodeCollapsed
Sets a node collapsed state.
SetNodePorts
Sets a node’s port ordering.
SetNodeData
Sets a node’s domain-owned data payload.
This is the primary edit op for node parameters and is intentionally untyped at the model layer: typing and validation live in profiles/rules.
AddPort
Adds a port.
RemovePort
Removes a port.
This operation is expected to remove associated edges as well.
SetPortConnectable
Sets a port connectable override.
SetPortConnectableStart
Sets a port start-connectable override.
SetPortConnectableEnd
Sets a port end-connectable override.
SetPortType
Sets a port type descriptor.
SetPortData
Sets a port domain-owned data payload.
AddEdge
Adds an edge.
RemoveEdge
Removes an edge.
SetEdgeKind
Sets an edge kind.
SetEdgeSelectable
Sets an edge selectable override.
SetEdgeFocusable
Sets an edge focusable override.
SetEdgeHidden
Sets an edge hidden flag.
SetEdgeInteractionWidth
Sets an edge hit-test interaction width override.
SetEdgeDeletable
Sets an edge deletable override.
SetEdgeReconnectable
Sets an edge reconnectable override.
SetEdgeEndpoints
Sets an edge’s endpoints (preserving edge identity for reconnection workflows).
AddImport
Adds a graph import reference.
RemoveImport
Removes a graph import reference.
SetImportAlias
Sets an import alias.
AddSymbol
Adds a symbol.
RemoveSymbol
Removes a symbol.
SetSymbolName
Sets a symbol name.
SetSymbolType
Sets a symbol type descriptor.
SetSymbolDefaultValue
Sets a symbol default value.
SetSymbolMeta
Updates a symbol metadata payload (domain-owned).
AddGroup
Adds a group.
RemoveGroup
Removes a group.
This operation is expected to detach nodes that were parented to the group.
Fields
SetGroupRect
Sets a group’s bounds.
SetGroupTitle
Sets a group’s title.
SetGroupColor
Sets a group color override.
AddStickyNote
Adds a sticky note.
RemoveStickyNote
Removes a sticky note.
SetStickyNoteText
Sets a sticky note text body.
SetStickyNoteRect
Sets a sticky note bounds.
SetStickyNoteColor
Sets a sticky note color override.
AddBinding
Adds a knowledge-canvas binding.
RemoveBinding
Removes a knowledge-canvas binding.
SetBindingSubject
Sets a binding subject endpoint.
SetBindingTarget
Sets a binding target endpoint.
SetBindingKind
Sets a binding relationship label.
SetBindingMeta
Updates a binding metadata payload (domain-owned).