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

Function makeSureNodeIsRegistered

devtool/src/graphSerializer.ts:74–97  ·  view source on GitHub ↗
(graph: Dagre.Graph, idTable: IdTable, stream: Stream<any>)

Source from the content-addressed store, hash-verified

72}
73
74function makeSureNodeIsRegistered(graph: Dagre.Graph, idTable: IdTable, stream: Stream<any>) {
75 if (!graph.node(idTable.getId(stream))) {
76 let node: StreamGraphNode;
77 if (stream['_isCycleSource']) {
78 node = {
79 id: idTable.getId(stream),
80 type: 'source',
81 label: (stream as Stream<any> & DevToolEnabledSource)._isCycleSource,
82 stream: stream,
83 width: SOURCE_NODE_SIZE[0],
84 height: SOURCE_NODE_SIZE[1],
85 };
86 } else {
87 node = {
88 id: idTable.getId(stream),
89 type: 'stream',
90 stream: stream,
91 width: COMMON_NODE_SIZE[0],
92 height: COMMON_NODE_SIZE[1],
93 };
94 }
95 graph.setNode(idTable.getId(stream), node);
96 }
97}
98
99function visitOperator(graph: Dagre.Graph, idTable: IdTable, operator: InternalProducer) {
100 const id = idTable.getId(operator);

Callers 2

visitEdgeFunction · 0.85
traverseFunction · 0.85

Calls 1

getIdMethod · 0.80

Tested by

no test coverage detected