mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
Graph Layouting: Add original const values
These seem like magic values to me.
This commit is contained in:
@ -227,12 +227,23 @@ class GraphNodeLayout {
|
|||||||
// Basic Force Directed Layout
|
// Basic Force Directed Layout
|
||||||
//
|
//
|
||||||
const l = 150.0; // sping rest length
|
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 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 MAX_DISPLACEMENT_SQUARED = 16;
|
||||||
const min_movement = 1.0;
|
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) {
|
bool _updateGraphPositions(Graph g) {
|
||||||
var numNodes = g.nodes.length;
|
var numNodes = g.nodes.length;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user