private static void AppendFunctionPipe( IGraphNodeWithOutput functionPipe, NodeMetadata metadata, List <string> result) { var inputs = functionPipe.Parents.Select(GetPredecessorOutput) .Select(metadata.GetQuotedUniqueName) .ToArray(); var function = metadata.GetQuotedUniqueName(functionPipe); var output = metadata.GetQuotedUniqueName(functionPipe.Output); var collectorNode = functionPipe.Collector; if (collectorNode != null) { var collectorUniqueName = metadata.GetQuotedUniqueName(collectorNode); output = $"{{{output}, {collectorUniqueName}}}"; } if (inputs.Count() == 1) { result.Add($"{inputs.Single()} -> {function} -> {output}\n"); } else { result.Add($"{{{string.Join(", ", inputs)}}} -> {function} -> {output}\n"); } }
private static void ProcessChildRanking( IGraphNode node, IGraphNode listener, NodeMetadata metadata, List <string> result) { if (listener.GetType().GetGenericTypeDefinition() == typeof(CollectorPipe <>)) { var listenerUniqueName = metadata.GetQuotedUniqueName(listener); result.Add($"{{ rank=same; {metadata.GetQuotedUniqueName(node)}, {listenerUniqueName}}}\n"); } }
private static void AppendFunctionPipeFormatting(IGraphNode node, NodeMetadata metadata, StringBuilder result) { var output = ((IGraphNodeWithOutput)node).Output; var label = metadata.GetCount(output) == 0 ? "" : $"label={metadata.GetQuotedDisplayName(output)}, "; var outputUniqueName = metadata.GetQuotedUniqueName(output); AppendFormat(outputUniqueName, $@"{label}color=""#9fbff4""", result); var functionLabel = metadata.GetCount(node) == 0 ? "" : $"label={metadata.GetQuotedDisplayName(node)}, "; var functionUniqueName = metadata.GetQuotedUniqueName(node); AppendFormat(functionUniqueName, $@"{functionLabel}shape=invhouse", result); }
private static void AppendJoinedPipesFormatting(IGraphNode node, NodeMetadata metadata, List <string> result) { var output = ((IGraphNodeWithOutput)node).Output; var label = metadata.GetCount(output) == 0 ? "" : $"label={metadata.GetQuotedDisplayName(output)}, "; var outputUniqueName = metadata.GetQuotedUniqueName(output); AppendFormat(outputUniqueName, $@"{label}color=""#9fbff4""", result); var functionLabel = metadata.GetCount(node) == 0 ? "" : $"label={metadata.GetQuotedDisplayName(node)}, "; var functionUniqueName = metadata.GetQuotedUniqueName(node); AppendFormat(functionUniqueName, $@"{functionLabel}color=pink", result); }
private static void AppendCollectorPipeFormatting(IGraphNode node, NodeMetadata metadata, StringBuilder result) { var label = metadata.GetCount(node) == 0 ? "" : "label=Collector, "; var uniqueName = metadata.GetQuotedUniqueName(node); AppendFormat(uniqueName, $@"{label}color = ""#c361f4""", result); }
private static void AppendInputPipeFormatting(IGraphNode node, NodeMetadata metadata, StringBuilder result) { var uniqueName = metadata.GetQuotedUniqueName(node); AppendFormat(uniqueName, @"color=green", result); }