Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Unified Diff: packages/charted/lib/layout/src/hierarchy_layout.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/charted/lib/core/utils/rect.dart ('k') | packages/charted/lib/layout/src/pie_layout.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/charted/lib/layout/src/hierarchy_layout.dart
diff --git a/packages/charted/lib/layout/src/hierarchy_layout.dart b/packages/charted/lib/layout/src/hierarchy_layout.dart
index 81cbcbc959bd51148cfdf9121ab4e8eee74dbf9e..9997ab06ca9e518dec603d1e9bc78a5ccf691a4a 100644
--- a/packages/charted/lib/layout/src/hierarchy_layout.dart
+++ b/packages/charted/lib/layout/src/hierarchy_layout.dart
@@ -26,8 +26,8 @@ abstract class HierarchyLayout<T extends HierarchyNode> {
/// parentColumn and valueColumn which is used to construct the hierarchy.
/// The returned list of nodes contains the hierarchy with root being the
/// first element its children in depth first order.
- List<T> layout(List rows, int parentColumn, int labelColumn,
- int valueColumn) {
+ List<T> layout(
+ List rows, int parentColumn, int labelColumn, int valueColumn) {
List<HierarchyNode> nodeList = [];
for (var row in rows) {
nodeList.add(createNode(row[labelColumn], row[valueColumn], 0));
@@ -38,8 +38,9 @@ abstract class HierarchyLayout<T extends HierarchyNode> {
if (parentRow == ROOT_ROW_INDEX) continue;
var currentNode = nodeList[i];
var parentNode = nodeList[parentRow];
- (parentNode.children.isEmpty) ? parentNode.children = [currentNode] :
- parentNode.children.add(currentNode);
+ (parentNode.children.isEmpty)
+ ? parentNode.children = [currentNode]
+ : parentNode.children.add(currentNode);
currentNode.parent = parentNode;
currentNode.depth = parentNode.depth + 1;
for (var child in currentNode.children) {
@@ -72,7 +73,6 @@ abstract class HierarchyLayout<T extends HierarchyNode> {
/// Default sorting method for comparing node a and b.
static int hierarchySort(HierarchyNode a, HierarchyNode b) =>
b.value - a.value;
-
}
abstract class HierarchyNode {
« no previous file with comments | « packages/charted/lib/core/utils/rect.dart ('k') | packages/charted/lib/layout/src/pie_layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698