public sealed class NodeGraphThe nodes, the wires and the groups. No elements, no canvas, no view.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Kept apart from NodeCanvas on purpose, for the reason DockLayout is kept apart from DockingHost: this is what a shader graph is saved as, compiled from and compared against, and a model that could only be read out of a live element tree would make every one of those depend on a document, a stylesheet and a font.
⚠ It refuses a cycle. A shader graph and a VFX graph are both evaluated by walking from the outputs back, and a cycle is not a graph with a mistake in it — it is a walk that does not terminate. Refusing at the moment of connection is the only place the user can be told which wire was the problem.
⚠ The rules are not this type's. The cycle refusal, the cascade a deletion causes and the one-wire-per-input rule are GraphInvariants's, and the document model — Vixen.Editor.NodeGraph.NodeGraphModel — calls the same three methods with the same GraphConnectionError coming back. That is deliberate and it is the only thing keeping two graph types from drifting into two sets of rules. What differs is how a refusal is delivered: see Connect.
Fields and properties (3)
public IReadOnlyList<GraphNode> NodesThe nodes, in the order they were added.
public IReadOnlyList<GraphWire> WiresThe wires.
public IReadOnlyList<GraphGroup> GroupsThe groups.
Events (1)
public Action<NodeGraph>? ChangedRaised after anything structural changes — a node, a wire or a group.
Methods (10)
public GraphNode AddNode(string title, Vector2 position = default(Vector2))Adds a node.
public GraphNode AddNode(GraphNode node)Adds a node that was made elsewhere.
public bool Remove(GraphNode node)Takes a node out, and every wire that touched it.
public GraphGroup AddGroup(string title, params ReadOnlySpan<GraphNode> members)Adds a group.
public bool Remove(GraphGroup group)Takes a group out, leaving its nodes where they are.
public GraphWire? Connect(GraphPort from, GraphPort to)Connects an output to an input.
public GraphWire? TryConnect(GraphPort from, GraphPort to, out GraphConnectionError error)Connects an output to an input, and says why not when it will not.
public bool Disconnect(GraphWire wire)Removes a wire.
public GraphWire? Wire(GraphPort port)The wire ending at an input, if it has one.
public void Touch()Tells the canvas the model changed under it.
Used by (9)
- NodeCanvasVixen.Ui.Controls.Advanced
- NodeCanvasTestsVixen.Ui.Controls.Advanced.Tests
- NodeGraphTestsVixen.Ui.Controls.Advanced.Tests
- NodeMinimapVixen.Ui.Controls.Advanced
- NodeWireLayerVixen.Ui.Controls.Advanced
- ResizeTestsVixen.Ui.Controls.Advanced.Tests
- GraphPairVixen.Editor.NodeGraph.Tests
- NodeGraphViewVixen.Editor.NodeGraph
- ViewTestsVixen.Editor.NodeGraph.Tests