GraphBasic constructor

GraphBasic({
  1. required List<NodeInput> list,
  2. required bool centred,
})

Implementation

GraphBasic({required List<NodeInput> list, required bool centred}) {
  this.centred = centred;
  this.list = list;
  this.nodesMap = this.list.fold(Map(), (m, node) {
    if (m.containsKey(node.id)) {
      throw 'Duplicate node ${node.id}';
    }
    m[node.id] = node;
    return m;
  });

  this.detectIncomesAndOutcomes();
}