makeGraph function

Graph makeGraph(
  1. ReactiveFramework framework,
  2. TestConfig config,
  3. Counter counter
)

Implementation

Graph makeGraph(
  ReactiveFramework framework,
  TestConfig config,
  Counter counter,
) {
  final TestConfig(:width, :totalLayers, :staticFraction, :nSources) = config;

  return framework.withBuild(() {
    final sources = List.generate(width, (i) => framework.signal(i));
    final rows = _makeDependentRows(
      sources,
      totalLayers - 1,
      counter,
      staticFraction,
      nSources,
      framework,
    );

    return Graph(sources: sources, layers: rows);
  });
}