aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
dotElements.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2026 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2026 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
48#ifndef GUM_DOT_ELEMENTS_H
49#define GUM_DOT_ELEMENTS_H
50
51#include <agrum/agrum.h>
52
55
56#include <string_view>
57
58namespace gum::dot {
59
75 GUM_SHARED_PUBLIC void writePreamble(DotWriter& writer,
76 const DotStyle& style,
77 const DotOptions& options,
78 std::string_view defaultLabel = "");
79
93 GUM_SHARED_PUBLIC DotAttributes nodeAttributes(const DotStyle& style,
94 const DotNodeOptions* options,
95 std::string_view defaultLabel = "",
96 std::string_view defaultTooltip = "");
97
102 GUM_SHARED_PUBLIC DotAttributes arcAttributes(const DotArcOptions* options);
103
108 GUM_SHARED_PUBLIC void
109 addDefaultAttribute(DotAttributes& attributes, std::string_view key, std::string_view value);
110
111} // namespace gum::dot
112
113#endif // GUM_DOT_ELEMENTS_H
The options given to a toDot(const DotOptions&).
Definition dotOptions.h:110
Writes a graph in the dot language, statement after statement, in the order of the calls.
Definition dotWriter.h:100
What the caller gives to a toDot() beyond the configuration: sizes, labels, colors of some nodes and ...
Look of the graphs drawn with graphviz, read from the configuration.
std::vector< DotAttribute > DotAttributes
a list of attributes
Definition dotWriter.h:74
DotAttributes nodeAttributes(const DotStyle &style, const DotNodeOptions *options, std::string_view defaultLabel, std::string_view defaultTooltip)
The attributes of a node : its label and tooltip, and its colors if the options give some.
void writePreamble(DotWriter &writer, const DotStyle &style, const DotOptions &options, std::string_view defaultLabel)
Writes the beginning of a graph, as pyAgrum displays it.
void addDefaultAttribute(DotAttributes &attributes, std::string_view key, std::string_view value)
Adds an attribute at the beginning of the list, unless the list already gives a value for this key : ...
DotAttributes arcAttributes(const DotArcOptions *options)
The attributes of an arc or an edge given by the options : color, penwidth, label,...
the options of an arc or an edge : an empty text (no value for the width) means "not given"
Definition dotOptions.h:79
the options of a node : an empty text means "not given", so that the value of the configuration is us...
Definition dotOptions.h:65
The look shared by all the graphs: size, direction, layout, colors of the arcs and of the nodes.
Definition dotStyle.h:76