class

ConstructionKit::GraphData

Inherits JSON::Serializable < Reference < Object

The graph data structure (nodes + edges), used at every scope level

Constructors

new(nodes : Array(ConstructionKit::Node) = [] of Node, edges : Array(ConstructionKit::Edge) = [] of Edge)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

edges
Source
edges=(edges : Array(Edge))
Source
edges_from(node_id : Int32, port_id : String) : Array(Edge)

Find all edges coming from a specific node+port

Source
edges_to(node_id : Int32, port_id : String) : Array(Edge)

Find all edges going into a specific node+port

Source
find_node(id : Int32) : Node | Nil
Source
nodes
Source
nodes=(nodes : Array(Node))
Source
sources_for(node_id : Int32, port_id : String) : Array(Node)

Find all source nodes connected to a given input port

Source