| Index: runtime/observatory/lib/src/elements/isolate_summary.dart
|
| diff --git a/runtime/observatory/lib/src/elements/isolate_summary.dart b/runtime/observatory/lib/src/elements/isolate_summary.dart
|
| index b0b2e061b9985877f5518b1fd296c8219194e954..b41befdf38621a9bc06e726b1c3fc8621f660fe8 100644
|
| --- a/runtime/observatory/lib/src/elements/isolate_summary.dart
|
| +++ b/runtime/observatory/lib/src/elements/isolate_summary.dart
|
| @@ -4,10 +4,7 @@
|
|
|
| library isolate_summary_element;
|
|
|
| -import 'dart:html';
|
| import 'observatory_element.dart';
|
| -import 'package:charted/charted.dart';
|
| -import "package:charted/charts/charts.dart";
|
| import 'package:observatory/service.dart';
|
| import 'package:polymer/polymer.dart';
|
|
|
| @@ -31,88 +28,3 @@ class IsolateLocationElement extends ObservatoryElement {
|
|
|
| @published Isolate isolate;
|
| }
|
| -
|
| -@CustomTag('isolate-shared-summary')
|
| -class IsolateSharedSummaryElement extends ObservatoryElement {
|
| - IsolateSharedSummaryElement.created() : super.created();
|
| -
|
| - @published Isolate isolate;
|
| -}
|
| -
|
| -class CounterChart {
|
| - final HtmlElement _wrapper;
|
| - HtmlElement _areaHost;
|
| - HtmlElement _legendHost;
|
| - LayoutArea _area;
|
| - ChartData _data;
|
| - final _columns = [
|
| - new ChartColumnSpec(label: 'Type', type: ChartColumnSpec.TYPE_STRING),
|
| - new ChartColumnSpec(label: 'Percent', formatter: (v) => v.toString())
|
| - ];
|
| -
|
| - CounterChart(this._wrapper) {
|
| - assert(_wrapper != null);
|
| - _areaHost = _wrapper.querySelector('.chart-host');
|
| - assert(_areaHost != null);
|
| - _areaHost.clientWidth;
|
| - _legendHost = _wrapper.querySelector('.chart-legend-host');
|
| - assert(_legendHost != null);
|
| - var series = new ChartSeries("Work", [1], new PieChartRenderer(
|
| - sortDataByValue: false
|
| - ));
|
| - var config = new ChartConfig([series], [0]);
|
| - config.minimumSize = new Rect(200, 200);
|
| - config.legend = new ChartLegend(_legendHost, showValues: true);
|
| - _data = new ChartData(_columns, []);
|
| - _area = new LayoutArea(_areaHost,
|
| - _data,
|
| - config,
|
| - state: new ChartState(),
|
| - autoUpdate: false);
|
| - _area.addChartBehavior(new Hovercard());
|
| - _area.addChartBehavior(new AxisLabelTooltip());
|
| - }
|
| -
|
| - void update(Map counters) {
|
| - var rows = [];
|
| - for (var key in counters.keys) {
|
| - var value = double.parse(counters[key].split('%')[0]);
|
| - rows.add([key, value]);
|
| - }
|
| - _area.data = new ChartData(_columns, rows);
|
| - _area.draw();
|
| - }
|
| -}
|
| -
|
| -@CustomTag('isolate-counter-chart')
|
| -class IsolateCounterChartElement extends ObservatoryElement {
|
| - IsolateCounterChartElement.created() : super.created();
|
| -
|
| - @published ObservableMap counters;
|
| - CounterChart chart;
|
| -
|
| - attached() {
|
| - super.attached();
|
| - chart =
|
| - new CounterChart(shadowRoot.querySelector('#isolate-counter-chart'));
|
| - }
|
| -
|
| - detached() {
|
| - super.detached();
|
| - var host = shadowRoot.querySelector('#isolate-counter-chart-host');
|
| - host.children.clear();
|
| - var legendHost =
|
| - shadowRoot.querySelector('#isolate-counter-chart-legend-host');
|
| - legendHost.children.clear();
|
| - }
|
| -
|
| - void countersChanged(oldValue) {
|
| - if (counters == null) {
|
| - return;
|
| - }
|
| - if (chart == null) {
|
| - return;
|
| - }
|
| - chart.update(counters);
|
| - }
|
| -}
|
|
|