dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Dot.hpp
1// SPDX-FileCopyrightText: 2025-2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Standard includes
12#include <string>
13#include <unordered_map>
14
15// Project includes
16#include <dfx-core/Endpoint.hpp>
17#include <dfx-core/ports/Kind.hpp>
18
19namespace dfx::Graph
20{
21class Controller;
22} // !namespace dfx::Graph
23
25{
39class Dot
40{
41public:
43 struct Style
44 {
46 std::string defaultNodeColor;
48 std::unordered_map<Core::Endpoint::Location, std::string> nodeLocationColor;
49
51 std::string defaultEdgeStyle;
53 std::string defaultEdgeColor;
55 std::unordered_map<Core::Kind, std::string> kindToEdgeStyle;
67 std::unordered_map<std::string, std::string> schemeToEdgeColor;
68 };
69
70public:
75 explicit Dot(Controller const & graph, Style style = defaultStyle());
76
86 std::string process() const;
87
88public:
91
92private:
93 Controller const & _graph;
94 Style _style;
95};
96} // !namespace dfx::Graph::Exporter
In-memory graph builder and mutation controller (nodes + channels) with optional connection verificat...
Definition Controller.hpp:63
static Style defaultStyle()
Returns the default dot format style.
std::string process() const
Generate the DOT representation of the graph.
Dot(Controller const &graph, Style style=defaultStyle())
Construct a DOT exporter for a given graph controller.
Definition Dot.hpp:25
Definition Node.hpp:43
Style used when generating a graph in dot format.
Definition Dot.hpp:44
std::unordered_map< Core::Kind, std::string > kindToEdgeStyle
Edge style specialization depending on the port kind (default: Data=solid, Control=dashed)
Definition Dot.hpp:55
std::unordered_map< Core::Endpoint::Location, std::string > nodeLocationColor
Node color specialization per location (default: Local= <span style="display:inline-block; width:12p...
Definition Dot.hpp:48
std::string defaultNodeColor
The default node color (default: <span style="display:inline-block; width:12px; height:12px; backgro...
Definition Dot.hpp:46
std::unordered_map< std::string, std::string > schemeToEdgeColor
Edge color specialization depending on the scheme.
Definition Dot.hpp:67
std::string defaultEdgeStyle
The default edge style (default: solid)
Definition Dot.hpp:51
std::string defaultEdgeColor
The default edge color (default: <span style="display:inline-block; width:12px; height:12px; backgro...
Definition Dot.hpp:53