Skip to content

Commit

Permalink
Minor Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
nabil6391 committed Apr 29, 2023
1 parent f46f1e1 commit 5d3f6e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions lib/Graph.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
part of graphview;

extension on Node {
Rect toRect() => Rect.fromLTRB(x, y, x + width, y + height);
}

class Graph {
final List<Node> _nodes = [];
final List<Edge> _edges = [];
Expand Down
6 changes: 2 additions & 4 deletions test/sugiyama_algorithm_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:graphview/GraphView.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -284,7 +282,7 @@ void main() {
expect(graph.getNodeAtPosition(122).position, Offset(1850.0, 3252.5));
});

test("Sugiyama child nodes never overlaps", () {
test('Sugiyama child nodes never overlaps', () {
for (final json in exampleTrees) {
final graph = Graph()..inflateWithJson(json);
for (var i = 0; i < graph.nodeCount(); i++) {
Expand All @@ -309,7 +307,7 @@ void main() {
final otherRect = otherNode.toRect();

final overlaps = currentRect.overlaps(otherRect);
expect(false, overlaps, reason: "$currentNode overlaps $otherNode");
expect(false, overlaps, reason: '$currentNode overlaps $otherNode');
}
}
}
Expand Down

0 comments on commit 5d3f6e8

Please sign in to comment.