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

Side by Side Diff: runtime/observatory/lib/src/elements/metric/graph.dart

Issue 2942493002: Removed unnecessary string concatenations (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:html'; 5 import 'dart:html';
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:observatory/models.dart' as M; 7 import 'package:observatory/models.dart' as M;
8 import 'package:charted/charted.dart'; 8 import 'package:charted/charted.dart';
9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; 9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
10 import 'package:observatory/src/elements/helpers/tag.dart'; 10 import 'package:observatory/src/elements/helpers/tag.dart';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 final min = _metrics.getMinValue(_isolate, _metric); 64 final min = _metrics.getMinValue(_isolate, _metric);
65 final max = _metrics.getMaxValue(_isolate, _metric); 65 final max = _metrics.getMaxValue(_isolate, _metric);
66 final rows = _metrics 66 final rows = _metrics
67 .getSamples(_isolate, _metric) 67 .getSamples(_isolate, _metric)
68 .map((s) => [s.time.millisecondsSinceEpoch, s.value]) 68 .map((s) => [s.time.millisecondsSinceEpoch, s.value])
69 .toList(); 69 .toList();
70 final current = rows.last.last; 70 final current = rows.last.last;
71 71
72 var message = 'current: $current'; 72 var message = 'current: $current';
73 if (min != null) { 73 if (min != null) {
74 message = 'min: $min, ' + message; 74 message = 'min: $min, $message';
75 } 75 }
76 if (max != null) { 76 if (max != null) {
77 message = message + ', max: $max'; 77 message = message + ', max: $max';
78 } 78 }
79 79
80 final host = new DivElement(); 80 final host = new DivElement();
81 children = [ 81 children = [
82 new DivElement() 82 new DivElement()
83 ..classes = ['memberList'] 83 ..classes = ['memberList']
84 ..children = [ 84 ..children = [
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return; 125 return;
126 } 126 }
127 final rect = host.getBoundingClientRect(); 127 final rect = host.getBoundingClientRect();
128 var series = new ChartSeries("one", [1], new LineChartRenderer()); 128 var series = new ChartSeries("one", [1], new LineChartRenderer());
129 var config = new ChartConfig([series], [0]); 129 var config = new ChartConfig([series], [0]);
130 config.minimumSize = new Rect(rect.width, rect.height); 130 config.minimumSize = new Rect(rect.width, rect.height);
131 final data = new ChartData(_columns, rows); 131 final data = new ChartData(_columns, rows);
132 new CartesianArea(host, data, config, state: new ChartState()).draw(); 132 new CartesianArea(host, data, config, state: new ChartState()).draw();
133 } 133 }
134 } 134 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698