Class Node

A builder that describes a Node in the Network.

The visual representation of a node can be specified by using instances of IViewBuilder. If this parameter is not specified, the node will show only the NodeId, or the INodeOptions.humanReadable option, if specified.

Example

const n = new ui.Node(
"42" as NodeId,
new ui.Text('Node 42') // This text will be shown inside the node.
).with({
selectable: true, // If `true`, selection events will be emitted for this node.
humanReadable: 'Node 42', // This will be shown in the breadcrumb bar.
});

Hierarchy

Implements

  • IViewBuilder

Constructors

Properties

Methods

Constructors

  • Represents a node in the graph.

    Parameters

    • nodeId: NodeId

      A unique identifier for the node.

    • Rest ...contents: IViewBuilder[]

      A collection of IViewBuilder which will be interspersed with ui.Separator elements. When this collection is empty we resort to the humanReadable description or the node. If humanReadable is also not defined then we show the nodeId.

    Returns Node

Properties

nodeId: NodeId

A unique identifier for the node.

options: INodeOptions

Methods