aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
gum::dot::FactorGraphDotStyle Struct Reference

The style of a factor graph (section factorgraph): layout, nodeBgColor and nodeFgColor are the ones of the variables. More...

#include <dotStyle.h>

Inheritance diagram for gum::dot::FactorGraphDotStyle:
[legend]
Collaboration diagram for gum::dot::FactorGraphDotStyle:
[legend]

Static Public Member Functions

static FactorGraphDotStyle read ()
static DotStyle readCredalNet ()
 the style of the credal networks : the colors of the nodes are the ones of the section credalnet

Public Attributes

std::string factorBgColor
std::string factorFgColor
 the font color of the factors: adaptive against their background
double edgeLength {0.}
 length of the edges
std::string size
 graphviz size of the graph, in inches (5, or 12! for an exact size)
std::string rankDir
 direction of the layout : TB (top-bottom) or LR (left-right)
std::string layout
 graphviz layout engine (dot, neato...)
std::string arcColor
 color of the arcs and edges, and of the border of the nodes
std::string nodeBgColor
 background color of the nodes
std::string nodeFgColor
 font color of the nodes

Detailed Description

The style of a factor graph (section factorgraph): layout, nodeBgColor and nodeFgColor are the ones of the variables.

Definition at line 122 of file dotStyle.h.

Member Function Documentation

◆ read()

FactorGraphDotStyle gum::dot::FactorGraphDotStyle::read ( )
static

Definition at line 120 of file dotStyle.cpp.

120 {
121 FactorGraphDotStyle style;
122 static_cast< DotStyle& >(style) = _notebook_();
123 style.layout = _str_("factorgraph", "graphLayout");
124 style.nodeBgColor = _str_("factorgraph", "nodeBgColor");
125 style.nodeFgColor = configFgColor("factorgraph", "nodeFgColor");
126
127 style.factorBgColor = _str_("factorgraph", "factorBgColor");
128 style.factorFgColor = resolveFgColor(ADAPTIVE_COLOR, style.factorBgColor, style.arcColor);
129 style.edgeLength = _typed_< double >("factorgraph", "edgeLength");
130 return style;
131 }
constexpr std::string_view ADAPTIVE_COLOR
the special value of a font color: black or white, according to the brightness of the background
Definition dotColor.h:68
std::string resolveFgColor(std::string_view fgColor, std::string_view bgColor, std::string_view fallback)
The font color to use on a background, once the special value adaptive is resolved.
Definition dotColor.cpp:280
std::string configFgColor(std::string_view section, std::string_view key)
A font color of the configuration, resolved against the background color which goes with it.
Definition dotStyle.cpp:78

References gum::dot::ADAPTIVE_COLOR, gum::dot::DotStyle::arcColor, gum::dot::configFgColor(), edgeLength, factorBgColor, factorFgColor, gum::dot::DotStyle::layout, gum::dot::DotStyle::nodeBgColor, gum::dot::DotStyle::nodeFgColor, and gum::dot::resolveFgColor().

Referenced by gum::IMarkovRandomField< GUM_SCALAR >::toDotAsFactorGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCredalNet()

DotStyle gum::dot::DotStyle::readCredalNet ( )
staticinherited

the style of the credal networks : the colors of the nodes are the ones of the section credalnet

Definition at line 91 of file dotStyle.cpp.

91 {
92 DotStyle style = _notebook_();
93 style.nodeBgColor = _str_("credalnet", "nodeBgColor");
94 style.nodeFgColor = configFgColor("credalnet", "nodeFgColor");
95 return style;
96 }

References gum::dot::configFgColor(), nodeBgColor, and nodeFgColor.

Referenced by gum::credal::CredalNet< GUM_SCALAR >::toDot().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ arcColor

std::string gum::dot::DotStyle::arcColor
inherited

color of the arcs and edges, and of the border of the nodes

Definition at line 84 of file dotStyle.h.

Referenced by gum::CausalModel< GUM_SCALAR >::_toDot_(), gum::dot::nodeAttributes(), gum::dot::FactorGraphDotStyle::read(), and gum::dot::writePreamble().

◆ edgeLength

double gum::dot::FactorGraphDotStyle::edgeLength {0.}

length of the edges

Definition at line 127 of file dotStyle.h.

Referenced by read().

◆ factorBgColor

std::string gum::dot::FactorGraphDotStyle::factorBgColor

Definition at line 123 of file dotStyle.h.

Referenced by read().

◆ factorFgColor

std::string gum::dot::FactorGraphDotStyle::factorFgColor

the font color of the factors: adaptive against their background

Definition at line 125 of file dotStyle.h.

Referenced by read().

◆ layout

std::string gum::dot::DotStyle::layout
inherited

graphviz layout engine (dot, neato...)

Definition at line 82 of file dotStyle.h.

Referenced by gum::dot::FactorGraphDotStyle::read(), and gum::dot::writePreamble().

◆ nodeBgColor

◆ nodeFgColor

std::string gum::dot::DotStyle::nodeFgColor
inherited

font color of the nodes

Definition at line 88 of file dotStyle.h.

Referenced by gum::dot::CausalDotStyle::read(), gum::dot::FactorGraphDotStyle::read(), readCredalNet(), and gum::dot::writePreamble().

◆ rankDir

std::string gum::dot::DotStyle::rankDir
inherited

direction of the layout : TB (top-bottom) or LR (left-right)

Definition at line 80 of file dotStyle.h.

Referenced by gum::dot::writePreamble().

◆ size

std::string gum::dot::DotStyle::size
inherited

graphviz size of the graph, in inches (5, or 12! for an exact size)

Definition at line 78 of file dotStyle.h.

Referenced by gum::dot::CausalDotStyle::read(), gum::dot::DynamicBNDotStyle::read(), gum::dot::InfluenceDiagramDotStyle::read(), gum::dot::JunctionTreeDotStyle::read(), and gum::dot::writePreamble().


The documentation for this struct was generated from the following files: