From 16897e2f63735731ea247526e891dbf3f0ade8db Mon Sep 17 00:00:00 2001 From: hasecilu Date: Tue, 10 Sep 2024 11:46:13 -0600 Subject: [PATCH] DependencyGraph: Tweak `dot` flags to prevent overlaped edges - `-Granksep=2` lets increase the separation between groups (nodes), ideally should depend on graph size - `-Goutputorder=edgesfirst` lets place the edges first to allocate more space for them - `-Gsplines=ortho` changes the edges from curves to straight, orthogonal lines Fix #10207 --- src/Gui/GraphvizView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Gui/GraphvizView.cpp b/src/Gui/GraphvizView.cpp index d6dde26003..fa51ccdf5b 100644 --- a/src/Gui/GraphvizView.cpp +++ b/src/Gui/GraphvizView.cpp @@ -280,7 +280,10 @@ void GraphvizView::updateSvgItem(const App::Document &doc) QProcess * dotProc = thread->dotProcess(); QProcess * flatProc = thread->unflattenProcess(); QStringList args, flatArgs; - args << QLatin1String("-Tsvg"); + // TODO: Make -Granksep flag value variable depending on number of edges, + // the downside is that the value affects all subgraphs + args << QLatin1String("-Granksep=2") << QLatin1String("-Goutputorder=edgesfirst") + << QLatin1String("-Gsplines=ortho") << QLatin1String("-Tsvg"); flatArgs << QLatin1String("-c2 -l2"); auto dot = QString::fromLatin1("dot"); auto unflatten = QString::fromLatin1("unflatten");