RelationshipLayout.h header
#include <ew/app/RelationshipLayout.h>
Namespace ew::app
Types
using ew::app::relationship::ForceLayoutParams = ew::app::graph::ForceLayoutParams
Tunables for forceDirectedLayout. The algorithm is shared with every other directed graph the app lays out, so the knobs are too.
using ew::app::relationship::RadialLayoutParams = ew::app::graph::RadialLayoutParams
Tunables for radialLayout. Shared for the same reason as ForceLayoutParams.
Functions
ew::app::graph::DirectedGraph ew::app::relationship::directedGraph(const RelationshipGraph &graph)
The relationship graph as the bare nodes-and-edges a layout needs.
The layouts read only ids and endpoints – never an entity's name, category or a reference field's label – so handing them the whole relationship graph told them things they had no use for and made them unusable by anything that was not a codex.
std::map< ew::core::foundation::ContentId, QPointF > ew::app::relationship::forceDirectedLayout(const RelationshipGraph &graph, const ForceLayoutParams ¶ms={})
Computes a force-directed layout for graph; see ew::app::graph::forceDirectedLayout, including its cost on a large codex.
std::map< ew::core::foundation::ContentId, QPointF > ew::app::relationship::hierarchicalLayout(const RelationshipGraph &graph)
Computes a top-down hierarchical (layered) layout for graph; see ew::app::graph::hierarchicalLayout. Positions are keyed by entity id.
std::map< ew::core::foundation::ContentId, QPointF > ew::app::relationship::radialLayout(const RelationshipGraph &graph, ew::core::foundation::ContentId focusId, const std::map< ew::core::foundation::ContentId, int > &depths, const RadialLayoutParams ¶ms={})
Computes a radial (concentric-by-depth) layout around focusId; see ew::app::graph::radialLayout. depths is the nodeDepths map for focusId.