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

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

Issue 2213693002: Updated charted DEP to 0.4.X (Closed) Base URL: https://github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 4 years, 4 months 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
Index: packages/charted/lib/layout/src/treemap_layout.dart
diff --git a/packages/charted/lib/layout/src/treemap_layout.dart b/packages/charted/lib/layout/src/treemap_layout.dart
index 601d0d48c1661a4127c7a75d7ac4fd355b51e684..39e82a5a7d8dac22a035b5e88102ed1bb6a80e9e 100644
--- a/packages/charted/lib/layout/src/treemap_layout.dart
+++ b/packages/charted/lib/layout/src/treemap_layout.dart
@@ -15,7 +15,7 @@ typedef List PaddingFunction(TreeMapNode node);
* Utility layout class which recursively subdivides area into rectangles which
* can be used to quickly visualize the size of any node in the tree.
*/
-class TreeMapLayout extends HierarchyLayout {
+class TreeMapLayout extends HierarchyLayout<TreeMapNode> {
/// Rectangular subdivision; squareness controlled via the target ratio.
static const TREEMAP_LAYOUT_SQUARIFY = 0;
@@ -163,7 +163,7 @@ class TreeMapLayout extends HierarchyLayout {
var rect = _treeMapPad(node, paddingFunction(node));
List<TreeMapNode> nodes = [];
var area = 0;
- var remaining = new List.from(children);
+ var remaining = new List<TreeMapNode>.from(children);
var score,
n,
best = double.INFINITY,
@@ -203,6 +203,8 @@ class TreeMapLayout extends HierarchyLayout {
}
class TreeMapNode extends HierarchyNode {
+ final List<TreeMapNode> children = <TreeMapNode>[];
+
/// The minimum x-coordinate of the node position.
num x = 0;
« no previous file with comments | « packages/charted/lib/layout/src/pie_layout.dart ('k') | packages/charted/lib/locale/format/number_format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698