OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. |
| 5 --> |
| 6 |
| 7 |
| 8 <polymer-element name="ct-cycle-time-card" attributes="group"> |
| 9 <template> |
| 10 <style> |
| 11 #failure { |
| 12 flex: 1; |
| 13 margin-left: 10px; |
| 14 } |
| 15 |
| 16 #details { |
| 17 color: red; |
| 18 font-weight: bold; |
| 19 } |
| 20 |
| 21 .snoozed { |
| 22 opacity: 0.5; |
| 23 } |
| 24 </style> |
| 25 <div id="failure" class="{{ { snoozed: group.isSnoozed } | tokenList }}"> |
| 26 <div id="details"> |
| 27 {{ group.tree }}: {{ group.data.details }} |
| 28 </div> |
| 29 <div id='chart'></div> |
| 30 <div><a href="{{ group.data.url }}">link</a> |
| 31 </div> |
| 32 </template> |
| 33 <script> |
| 34 Polymer('ct-cycle-time-card', { |
| 35 group: null, |
| 36 commits: null, |
| 37 _commits: function() { |
| 38 if (!this.group) |
| 39 return undefined; |
| 40 return this.group.commitList(this.commits); |
| 41 }, |
| 42 ready: function() { |
| 43 |
| 44 function fromPercent(v) { |
| 45 return Number(v.substring(0, v.length - 1)); |
| 46 } |
| 47 |
| 48 var dataTable = google.visualization.arrayToDataTable([ |
| 49 ['', 'Median', 'Max'], |
| 50 ['percent of builds', fromPercent(this.group.data.percent_over_media
n_slo), fromPercent(this.group.data.percent_over_max_slo)] |
| 51 ]); |
| 52 |
| 53 var options = { |
| 54 title: 'cycle times over SLO', |
| 55 vAxis: {minValue: 0}, |
| 56 series: [{color: 'orange'}, {color: 'red'}] |
| 57 }; |
| 58 |
| 59 var chart = new google.visualization.ColumnChart(this.$.chart); |
| 60 chart.draw(dataTable, options); |
| 61 }, |
| 62 }); |
| 63 </script> |
| 64 </polymer-element> |
| 65 |
| 66 |
OLD | NEW |