ui: switch Graph to bucket grid layouting
This change introduces bucket grid layouting, which sorts the nodes into buckets based on how they are connected. Each bucket is then layouted individually before they are arranged next to each other. Edges go from left to right, except for inheritance edges that go from bottom to top.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "component/controller/helper/DummyEdge.h"
|
||||
#include "component/controller/helper/DummyNode.h"
|
||||
#include "component/controller/helper/GraphLayouter.h"
|
||||
#include "component/controller/helper/GraphPostprocessor.h"
|
||||
#include "component/view/GraphView.h"
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
@@ -88,8 +89,7 @@ void GraphController::handleMessage(MessageGraphNodeBundleSplit* message)
|
||||
setActiveAndVisibility(utility::concat(m_activeNodeIds, m_activeEdgeIds));
|
||||
|
||||
layoutNesting();
|
||||
GraphLayouter::layoutSpectralPrototype(m_dummyNodes, m_dummyEdges);
|
||||
GraphPostprocessor::doPostprocessing(m_dummyNodes);
|
||||
layoutGraph();
|
||||
|
||||
buildGraph(message);
|
||||
}
|
||||
@@ -102,9 +102,9 @@ void GraphController::handleMessage(MessageGraphNodeExpand* message)
|
||||
node->expanded = message->expand;
|
||||
|
||||
setActiveAndVisibility(utility::concat(m_activeNodeIds, m_activeEdgeIds));
|
||||
layoutNesting();
|
||||
|
||||
GraphPostprocessor::doPostprocessing(m_dummyNodes);
|
||||
layoutNesting();
|
||||
layoutGraph();
|
||||
|
||||
buildGraph(message);
|
||||
}
|
||||
@@ -179,8 +179,7 @@ void GraphController::createDummyGraphForTokenIds(const std::vector<Id>& tokenId
|
||||
bundleNodes();
|
||||
|
||||
layoutNesting();
|
||||
GraphLayouter::layoutSpectralPrototype(m_dummyNodes, m_dummyEdges);
|
||||
GraphPostprocessor::doPostprocessing(m_dummyNodes);
|
||||
layoutGraph();
|
||||
|
||||
m_graph = graph;
|
||||
}
|
||||
@@ -867,6 +866,14 @@ void GraphController::layoutToGrid(DummyNode& node) const
|
||||
}
|
||||
}
|
||||
|
||||
void GraphController::layoutGraph()
|
||||
{
|
||||
// GraphLayouter::layoutSpectralPrototype(m_dummyNodes, m_dummyEdges);
|
||||
// GraphPostprocessor::doPostprocessing(m_dummyNodes);
|
||||
|
||||
GraphLayouter::layoutBucket(m_dummyNodes, m_dummyEdges, getView()->getViewSize());
|
||||
}
|
||||
|
||||
DummyNode* GraphController::findDummyNodeRecursive(std::vector<DummyNode>& nodes, Id tokenId) const
|
||||
{
|
||||
for (DummyNode& node : nodes)
|
||||
|
||||
Reference in New Issue
Block a user