OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/color_scheme.html"> | 8 <link rel="import" href="/tracing/base/color_scheme.html"> |
9 <link rel="import" href="/tracing/ui/base/chart_legend_key.html"> | 9 <link rel="import" href="/tracing/ui/base/chart_legend_key.html"> |
10 <link rel="import" href="/tracing/ui/base/d3.html"> | 10 <link rel="import" href="/tracing/ui/base/d3.html"> |
11 <link rel="import" href="/tracing/ui/base/ui.html"> | 11 <link rel="import" href="/tracing/ui/base/ui.html"> |
12 | 12 |
13 <style> | |
14 * /deep/ .chart-base { | |
15 -webkit-user-select: none; | |
16 cursor: default; | |
17 } | |
18 | |
19 * /deep/ .chart-base .axis path, | |
20 * /deep/ .chart-base .axis line { | |
21 fill: none; | |
22 shape-rendering: crispEdges; | |
23 stroke: #000; | |
24 } | |
25 </style> | |
26 | |
27 <template id="chart-base-template"> | 13 <template id="chart-base-template"> |
28 <svg> <!-- svg tag is dropped by ChartBase.decorate. --> | 14 <svg> <!-- svg tag is dropped by ChartBase.decorate. --> |
29 <g xmlns="http://www.w3.org/2000/svg" id="chart-area"> | 15 <g xmlns="http://www.w3.org/2000/svg" id="chart-area"> |
30 <g class="x axis"></g> | 16 <g class="x axis"></g> |
31 <g class="y axis"></g> | 17 <g class="y axis"></g> |
32 <text id="title"></text> | 18 <text id="title"></text> |
33 </g> | 19 </g> |
34 </svg> | 20 </svg> |
35 </template> | 21 </template> |
36 | 22 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 156 |
171 getDataSeries(key) { | 157 getDataSeries(key) { |
172 if (!this.seriesByKey_.has(key)) { | 158 if (!this.seriesByKey_.has(key)) { |
173 this.seriesByKey_.set(key, new DataSeries(key)); | 159 this.seriesByKey_.set(key, new DataSeries(key)); |
174 } | 160 } |
175 return this.seriesByKey_.get(key); | 161 return this.seriesByKey_.get(key); |
176 }, | 162 }, |
177 | 163 |
178 decorate() { | 164 decorate() { |
179 Polymer.dom(this).classList.add('chart-base'); | 165 Polymer.dom(this).classList.add('chart-base'); |
| 166 this.setAttribute('style', 'cursor: default; userSelect: none;'); |
180 this.chartTitle_ = undefined; | 167 this.chartTitle_ = undefined; |
181 this.seriesByKey_ = new Map(); | 168 this.seriesByKey_ = new Map(); |
182 this.graphWidth_ = undefined; | 169 this.graphWidth_ = undefined; |
183 this.graphHeight_ = undefined; | 170 this.graphHeight_ = undefined; |
184 this.margin = { | 171 this.margin = { |
185 top: 0, | 172 top: 0, |
186 right: 0, | 173 right: 0, |
187 bottom: 0, | 174 bottom: 0, |
188 left: 0, | 175 left: 0, |
189 }; | 176 }; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 }; | 404 }; |
418 | 405 |
419 return { | 406 return { |
420 ChartBase, | 407 ChartBase, |
421 DataSeriesEnableChangeEventType, | 408 DataSeriesEnableChangeEventType, |
422 getColorOfKey, | 409 getColorOfKey, |
423 getSVGTextSize, | 410 getSVGTextSize, |
424 }; | 411 }; |
425 }); | 412 }); |
426 </script> | 413 </script> |
OLD | NEW |