mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 18:03:14 +08:00
Graph: Remove all debug print statements
Too much noise. I'll remove them later when I cleanup the code.
This commit is contained in:
@ -51,10 +51,10 @@ class Graph extends ChangeNotifier {
|
|||||||
Graph.fromFolder(NotesFolder folder) {
|
Graph.fromFolder(NotesFolder folder) {
|
||||||
initLayouter = GraphNodeLayout(maxHeight: 2000, maxWidth: 2000);
|
initLayouter = GraphNodeLayout(maxHeight: 2000, maxWidth: 2000);
|
||||||
|
|
||||||
print("Building graph .... ");
|
// print("Building graph .... ");
|
||||||
_addFolder(folder).then((_) {
|
_addFolder(folder).then((_) {
|
||||||
print("Done Building graph");
|
// print("Done Building graph");
|
||||||
print("Starting layouting ...");
|
// print("Starting layouting ...");
|
||||||
|
|
||||||
//startLayout();
|
//startLayout();
|
||||||
});
|
});
|
||||||
@ -80,12 +80,10 @@ class Graph extends ChangeNotifier {
|
|||||||
for (var l in links) {
|
for (var l in links) {
|
||||||
var noteB = linkResolver.resolveLink(l);
|
var noteB = linkResolver.resolveLink(l);
|
||||||
if (noteB == null) {
|
if (noteB == null) {
|
||||||
print("not found $l");
|
// print("not found $l");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Adding edge ..");
|
|
||||||
|
|
||||||
var edge = Edge(node, _getNode(noteB));
|
var edge = Edge(node, _getNode(noteB));
|
||||||
edges.add(edge);
|
edges.add(edge);
|
||||||
}
|
}
|
||||||
@ -174,7 +172,7 @@ class Graph extends ChangeNotifier {
|
|||||||
const interval = Duration(milliseconds: 25);
|
const interval = Duration(milliseconds: 25);
|
||||||
layoutTimer = Timer.periodic(interval, (Timer t) {
|
layoutTimer = Timer.periodic(interval, (Timer t) {
|
||||||
bool shouldStop = _updateGraphPositions(this);
|
bool shouldStop = _updateGraphPositions(this);
|
||||||
print("shouldStop $shouldStop");
|
// print("shouldStop $shouldStop");
|
||||||
if (shouldStop) {
|
if (shouldStop) {
|
||||||
layoutTimer.cancel();
|
layoutTimer.cancel();
|
||||||
layoutTimer = null;
|
layoutTimer = null;
|
||||||
@ -213,8 +211,6 @@ class GraphNodeLayout {
|
|||||||
node.x = x;
|
node.x = x;
|
||||||
node.y = y;
|
node.y = y;
|
||||||
|
|
||||||
print('INIT ${node.label} -> ${node.x} ${node.y}');
|
|
||||||
|
|
||||||
x += gap;
|
x += gap;
|
||||||
if (x + nodeSize >= maxWidth) {
|
if (x + nodeSize >= maxWidth) {
|
||||||
x = startX;
|
x = startX;
|
||||||
@ -330,7 +326,7 @@ bool _updateGraphPositions(Graph g) {
|
|||||||
dy *= s;
|
dy *= s;
|
||||||
}
|
}
|
||||||
|
|
||||||
print('${node.label} $dx $dy');
|
// print('${node.label} $dx $dy');
|
||||||
if (node.x - dx <= g.nodeSize / 2) {
|
if (node.x - dx <= g.nodeSize / 2) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -345,7 +341,7 @@ bool _updateGraphPositions(Graph g) {
|
|||||||
allBelowThreshold = false;
|
allBelowThreshold = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print('------------------');
|
// print('------------------');
|
||||||
|
|
||||||
g.notify();
|
g.notify();
|
||||||
return allBelowThreshold;
|
return allBelowThreshold;
|
||||||
|
@ -82,10 +82,10 @@ class _GraphViewState extends State<GraphView> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
widget.graph.notify();
|
widget.graph.notify();
|
||||||
print("Pan start ${node.label} $pos");
|
// print("Pan start ${node.label} $pos");
|
||||||
},
|
},
|
||||||
onPanEnd: (DragEndDetails details) {
|
onPanEnd: (DragEndDetails details) {
|
||||||
print("Pan end ${node.label} $details");
|
// print("Pan end ${node.label} $details");
|
||||||
node.pressed = false;
|
node.pressed = false;
|
||||||
widget.graph.notify();
|
widget.graph.notify();
|
||||||
},
|
},
|
||||||
@ -102,7 +102,7 @@ class _GraphViewState extends State<GraphView> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
widget.graph.notify();
|
widget.graph.notify();
|
||||||
print("Pan update ${node.label} $pos");
|
// print("Pan update ${node.label} $pos");
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
left: node.x - (nodeSize / 2),
|
left: node.x - (nodeSize / 2),
|
||||||
|
Reference in New Issue
Block a user