Use SugiyamaAlgorithm instead of BuchheimWalkerAlgorithm for skill tree

This commit is contained in:
hunteraraujo
2023-09-22 16:20:04 -07:00
parent bb627442d4
commit 45819e68d0
2 changed files with 4 additions and 9 deletions

View File

@@ -38,8 +38,8 @@ class SkillTreeViewModel extends ChangeNotifier {
SkillTreeNode? get selectedNode => _selectedNode;
List<SkillTreeNode>? get selectedNodeHierarchy => _selectedNodeHierarchy;
final Graph graph = Graph()..isTree = true;
BuchheimWalkerConfiguration builder = BuchheimWalkerConfiguration();
final Graph graph = Graph();
SugiyamaConfiguration builder = SugiyamaConfiguration();
SkillTreeViewModel(this.benchmarkService, this.leaderboardService);
@@ -66,11 +66,7 @@ class SkillTreeViewModel extends ChangeNotifier {
_skillTreeEdges.add(edge);
}
builder
..siblingSeparation = (50)
..levelSeparation = (50)
..subtreeSeparation = (50)
..orientation = (BuchheimWalkerConfiguration.ORIENTATION_LEFT_RIGHT);
builder.orientation = (SugiyamaConfiguration.ORIENTATION_LEFT_RIGHT);
notifyListeners();

View File

@@ -65,8 +65,7 @@ class _SkillTreeViewState extends State<SkillTreeView> {
maxScale: 5.6,
child: GraphView(
graph: widget.viewModel.graph,
algorithm: BuchheimWalkerAlgorithm(widget.viewModel.builder,
TreeEdgeRenderer(widget.viewModel.builder)),
algorithm: SugiyamaAlgorithm(widget.viewModel.builder),
paint: Paint()
..color = Colors.green
..strokeWidth = 1