(cfg)
| 363 | return { id, is_block: node.is_block, ports }; |
| 364 | }; |
| 365 | let splitGraph = (cfg) => { |
| 366 | if (!cfg) return undefined; |
| 367 | let ids = []; |
| 368 | let inputs = (pair) => cfg.link.inputs[pair[0]].map((id, i)=> { |
| 369 | ids.push(id); |
| 370 | let node = findNodeById(config, cfg.ty, id); |
| 371 | let tag = cfg.link.inputs_tag[pair[0]][i]; |
| 372 | return { id: `${id}#${tag}`, descp: `${node.name}:${tag}`, data: { size: pair[1][0], qps: pair[1][1] } } |
| 373 | }); |
| 374 | let outputs = (pair) => cfg.link.outputs[pair[0]].map((id, i)=> { |
| 375 | let node = findNodeById(config, cfg.ty, id); |
| 376 | let tag = cfg.link.outputs_tag[pair[0]][i]; |
| 377 | return { id: `${id}#${tag}`, descp: `${node.name}:${tag}`, data: { size: pair[1][0], qps: pair[1][1] } } |
| 378 | }); |
| 379 | let ports = Object.entries(node.qps).map(pair=>{ |
| 380 | return inputs(pair).concat(outputs(pair)) |
| 381 | }).flat(); |
| 382 | return { ids, is_block: node.is_block, ports }; |
| 383 | }; |
| 384 | if (node.name in config.g_nodes) { |
| 385 | let cfg = config.nodes[node.name]; |
| 386 | return splitNode(cfg); |
no test coverage detected