From 8e5ac69af2fba1f52466041e005fc69f45b692b1 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sat, 26 Sep 2020 01:17:35 +0200 Subject: [PATCH] Graph Layouting: Add original const values These seem like magic values to me. --- lib/core/graph.dart | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/core/graph.dart b/lib/core/graph.dart index 8a78caea..a2885ab4 100644 --- a/lib/core/graph.dart +++ b/lib/core/graph.dart @@ -227,12 +227,23 @@ class GraphNodeLayout { // Basic Force Directed Layout // const l = 150.0; // sping rest length -const k_r = 10000.0; // repulsive force constant +const k_r = 1000.0; // repulsive force constant const k_s = 20; // spring constant -const delta_t = 1.0; // time step +const delta_t = 0.5; // time step const MAX_DISPLACEMENT_SQUARED = 16; const min_movement = 1.0; +/* +Original Values from main_graph.dart + +const l = 150.0; // sping rest length +const k_r = 10000.0; // repulsive force constant +const k_s = 20; // spring constant +const delta_t = 0.005; // time step +const MAX_DISPLACEMENT_SQUARED = 16; +const min_movement = 1.0; +*/ + bool _updateGraphPositions(Graph g) { var numNodes = g.nodes.length;