(graph: dataform.ICompiledGraph, interactive: boolean)
| 528 | } |
| 529 | |
| 530 | export function dotRepresentation(graph: dataform.ICompiledGraph, interactive: boolean): string { |
| 531 | const nodes: string[] = []; |
| 532 | const edges: string[] = []; |
| 533 | |
| 534 | const formatTarget = interactive ? targetString : plainTargetString; |
| 535 | |
| 536 | graph.tables?.forEach(table => { |
| 537 | const nodeName = `${formatTarget(table.target)}`; |
| 538 | nodes.push(`"${nodeName}" [label="${formatTarget(table.target)} [${tableTypeEnumToString(table.enumType)}]"]`); |
| 539 | table.dependencyTargets?.forEach(dependencyTarget => { |
| 540 | edges.push(`"${formatTarget(dependencyTarget)}" -> "${nodeName}"`); |
| 541 | }); |
| 542 | }); |
| 543 | |
| 544 | graph.assertions?.forEach(assertion => { |
| 545 | const nodeName = `${formatTarget(assertion.target)}`; |
| 546 | nodes.push(`"${nodeName}" [label="${formatTarget(assertion.target)}"]`); |
| 547 | assertion.dependencyTargets?.forEach(dependencyTarget => { |
| 548 | edges.push(`"${formatTarget(dependencyTarget)}" -> "${nodeName}"`); |
| 549 | }); |
| 550 | }); |
| 551 | |
| 552 | graph.operations?.forEach(operation => { |
| 553 | const nodeName = `${formatTarget(operation.target)}`; |
| 554 | nodes.push(`"${nodeName}" [label="${formatTarget(operation.target)}"`); |
| 555 | operation.dependencyTargets?.forEach(dependencyTarget => { |
| 556 | edges.push(`"${formatTarget(dependencyTarget)}" -> "${nodeName}"`); |
| 557 | }); |
| 558 | }); |
| 559 | |
| 560 | return `digraph {\n${nodes.join(";\n")};\n${edges.join(";\n")};\n}`; |
| 561 | } |
| 562 | |
| 563 | function printExecutedActionErrors( |
| 564 | executedAction: dataform.IActionResult, |
no test coverage detected