MCPcopy Create free account
hub / github.com/cyclejs/cyclejs / buildGraph

Function buildGraph

devtool/src/graphSerializer.ts:144–164  ·  view source on GitHub ↗
(sinks: Object)

Source from the content-addressed store, hash-verified

142}
143
144function buildGraph(sinks: Object): Dagre.Graph {
145 const idTable = new IdTable();
146 const graph = new dagre.graphlib.Graph();
147 graph.setGraph({nodesep: 60, ranksep: 20});
148 for (let key in sinks) {
149 if (sinks.hasOwnProperty(key)) {
150 const node: StreamGraphNode = {
151 id: idTable.getId(sinks[key]),
152 label: key,
153 type: 'sink',
154 stream: sinks[key],
155 width: SINK_NODE_SIZE[0],
156 height: SINK_NODE_SIZE[1],
157 };
158 graph.setNode(idTable.getId(sinks[key]), node);
159 traverse(graph, idTable, sinks[key]);
160 }
161 }
162 dagre.layout(graph);
163 return graph;
164}
165
166interface Diagram {
167 graph: Dagre.Graph;

Callers

nothing calls this directly

Calls 2

getIdMethod · 0.95
traverseFunction · 0.85

Tested by

no test coverage detected