Tesserae

NodeView

Description

The NodeView component renders interactive node-based flows. It is used to define and display nodes with customizable inputs and outputs to build flow-based interfaces. Use NodeView when you need to visually represent and interact with configurable node graphs.

Usage

Instantiate a NodeView using the static helper method from the Tesserae.UI class. Once instantiated, you can define nodes using methods like DefineNode for static nodes or DefineDynamicNode for nodes that update their outputs based on inputs. Additionally, you can monitor changes in the node graph through the OnChange method.

Below is a simple example that creates a node with a text input and a text output:

API reference

class

NodeView

public class NodeView : IComponent

A NodeView component that provides a visual node-based editor (based on BaklavaJS).

Constructors

Constructor
NodeView
public NodeView(Action<IViewSettings> settings = null)

Initializes a new instance of the NodeView class.

Methods

Method
NodeView.OnChange
public NodeView OnChange(Action<NodeView> onChange)

Adds a change event handler to the node view.

Parameters

onChange
The event handler.

Returns

The current instance of the type.

Method
NodeView.Register<T>
public NodeView Register<T>() where T : INodeView, new()

Registers a new node type (static or dynamic) based on the provided class type that implements INodeView.

Type Parameters

T
The node type.

Returns

The current instance of the type.

Method
NodeView.DefineNode
public NodeView DefineNode(string nodeTypeName, Action<InterfaceBuilder> buildNode)

Defines a new static node type.

Parameters

nodeTypeName
The name of the node type.
buildNode
An action to build the node interface.

Returns

The current instance of the type.

Method
NodeView.DefineDynamicNode
public NodeView DefineDynamicNode(string nodeTypeName, Action<InterfaceBuilder> buildBaseNode, Action<InputsState, OutputsState, InterfaceBuilder> onUpdate)

Defines a new dynamic node type.

Parameters

nodeTypeName
The name of the node type.
buildBaseNode
An action to build the base node interface.
onUpdate
An action to perform when the node needs updating.

Returns

The current instance of the type.

Method
NodeView.Render
public HTMLElement Render()

Renders the node view.

Returns

The rendered HTMLElement.

Method
NodeView.GetState
public NodeViewGraphState GetState()

Gets the current state of the node graph.

Returns

The graph state.

Method
NodeView.GetJsonState
public string GetJsonState(bool formated = false)

Gets the current state of the node graph as a JSON string.

Parameters

formated
Whether to format the JSON string.

Returns

The JSON string.

Method
NodeView.SetState
public void SetState(string stateJson)

Sets the state of the node graph from a JSON string.

Parameters

stateJson
The JSON string representing the graph state.
Method
NodeView.SetState
public void SetState(NodeViewGraphState state)

Sets the state of the node graph.

Parameters

state
The graph state.
interface

INodeView

public interface INodeView
interface

INodeInput

public interface INodeInput
interface

INodeOutput

public interface INodeOutput
interface

INodeInput<T>

public interface INodeInput<T> : INodeInput
interface

INodeOutput<T>

public interface INodeOutput<T> : INodeOutput

Samples

NodeView Sample Usage

The sample below demonstrates how to create a NodeView with multiple nodes, including a dynamic node whose outputs are generated based on an input value. It also shows how to attach a change listener that updates a text area with the current state in JSON format.

See also

  • Toast – For displaying information messages triggered by node actions.
  • TextArea – Used in conjunction with NodeView for state editing and display.
© 2026 Tesserae. All rights reserved.