Interactive chart component provides two duplicate API for highlighting points
[WebKit-https.git] / Websites / perf.webkit.org / public / v2 / index.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta charset="utf-8">
5     <title>WebKit Performance Monitor (Beta)</title>
6     <script src="js/jquery.min.js" defer></script>
7     <script src="js/handlebars.js" defer></script>
8     <script src="js/ember.js" defer></script>
9     <script src="js/ember-data.js" defer></script>
10     <script src="js/d3/d3.min.js" defer></script>
11     <script src="js/statistics.js" defer></script>
12     <script src="data.js" defer></script>
13     <script src="app.js" defer></script>
14     <script src="manifest.js" defer></script>
15     <script src="analysis.js" defer></script>
16     <script src="popup.js" defer></script>
17     <script src="interactive-chart.js" defer></script>
18     <script src="commits-viewer.js" defer></script>
19     <link rel="stylesheet" href="app.css">
20     <link rel="stylesheet" href="chart-pane.css">
21
22     <script type="text/x-handlebars" data-template-name="index">
23         <header id="header">
24             {{partial "navbar"}}
25             {{view App.NumberOfDaysControlView tagName="ul" numberOfDays=numberOfDays}}
26             <ul class="controls">
27                 <li>
28                     <a href="#" class="control-button" {{action toggleEditMode}}>
29                         {{#if controller.editMode}}
30                             Finish editing
31                         {{else}}
32                             Edit
33                         {{/if}}
34                     </a>
35                 </li>
36             </ul>
37         </header>
38
39         <table {{bind-attr class=":dashboard editMode:editMode:readonly"}}>
40         <thead>
41             <tr>
42                 <td></td>
43                 {{#each headerColumns}}
44                     {{#if controller.editMode}}
45                         <th>
46                             <a href="#" title="Remove column" {{action "removeColumn" index}}>
47                                 {{partial "close-button"}}
48                             </a>
49                             {{input value=label}}
50                         </th>
51                     {{else}}
52                         <th>{{label}}</th>
53                     {{/if}}
54                 {{/each}}
55                 {{#if controller.editMode}}
56                     <td>{{input value=newColumnHeader action="addColumn" placeholder="Add a column"}}</td>
57                 {{/if}}
58             </tr>
59         </thead>
60         <tbody>
61             {{#each rows}}
62                 <tr>
63                     {{#if controller.editMode}}
64                         <th>
65                             <a href="#" title="Remove row" {{action "removeRow" this}}>
66                                 {{partial "close-button"}}
67                             </a>
68                             {{input value=header}}
69                         </th>
70                     {{else}}
71                         <th><span class="label">{{header}}</span></th>
72                     {{/if}}
73                     {{#each cells}}
74                         <td>
75                             {{#if empty}}
76                                 {{#if controller.editMode}}
77                                     {{view App.PopupView list=pickerData label='Choose'}}
78                                 {{/if}}
79                             {{else}}
80                                 {{#if chartData}}
81                                     {{#link-to 'charts' (query-params paneList=paneList)}}
82                                     {{interactive-chart
83                                         chartData=chartData
84                                         domain=controller.sharedDomain
85                                         enableSelection=false}}
86                                     {{/link-to}}
87                                 {{else}}
88                                     {{#if failure}}
89                                         <div class="failure">{{failure}}</div>
90                                     {{else}}
91                                         <div class="progress">{{partial "spinner"}}</div>
92                                     {{/if}}
93                                 {{/if}}
94                                 {{#if controller.editMode}}
95                                     <a href="#" title="Reset pane" class="reset" {{action "resetPane" this}}>
96                                         {{partial "close-button"}}
97                                     </a>
98                                 {{/if}}
99                             {{/if}}
100                         </td>
101                     {{/each}}
102                     {{#if controller.editMode}}
103                         <td></td>
104                     {{/if}}
105                 </tr>
106             {{/each}}
107             {{#if controller.editMode}}
108                 <tr>
109                     <td>{{input value=newRowHeader action="addRow" placeholder="Add a row"}}</td>
110                     {{#each emptyRow}}
111                         <td></td>
112                     {{/each}}
113                     <td></td>
114                 </tr>
115             {{/if}}
116         </tbody>
117         </table>
118     </script>
119
120     <script type="text/x-handlebars" data-template-name="charts">
121         <header id="header">
122             {{partial "navbar"}}
123             <ul class="controls">
124                 <li>{{view App.PopupView list=platforms label='Add pane'}}</li>
125             </ul>
126             <ul class="controls">
127                 <li>{{view App.StartTimeSliderView startTime=startTime oldestStartTime=oldestStartTime}}</li>
128             </ul>
129         </header>
130
131         {{#each panes itemController="pane"}}
132             <section class="chart-pane" tabindex="0">
133                 <header>
134                     <h1 {{action "toggleDetails"}}>{{metric.fullName}} - {{ platform.name}}</h1>
135                     <a href="#" title="Close" class="close-button" {{action "close"}}>{{partial "close-button"}}</a>
136                     {{#if App.Manifest.bugTrackers}}
137                         <a href="#" title="Analysis" class="bugs-button" {{action "toggleBugsPane"}}>
138                             {{partial "analysis-button"}}
139                         </a>
140                     {{/if}}
141                     {{#if App.Manifest.repositoriesWithReportedCommits}}
142                         <a href="#" title="Search" class="search-button" {{action "toggleSearchPane"}}>{{partial "search-button"}}</a>
143                     {{/if}}
144                 </header>
145
146                 <div class="body">
147                     <div class="svg-container">
148                     {{#if chartData}}
149                         {{interactive-chart
150                             chartData=chartData
151                             ranges=analyticRanges
152                             domain=mainPlotDomain
153                             interactive=true
154                             chartPointRadius=2
155                             currentItem=currentItem
156                             currentTime=sharedTime
157                             selectedItem=selectedItem
158                             highlightedItems=highlightedItems
159                             rangeRoute="analysisTask"
160                             selection=timeRange
161                             selectedPoints=selectedPoints
162                             selectionIsLocked=timeRangeIsLocked
163                             markedPoints=markedPoints
164                             zoom="zoomed"}}
165                     {{else}}
166                         {{#if failure}}
167                             <div class="failure">{{failure}}</div>
168                         {{else}}
169                             <div class="progress">{{partial "spinner"}}</div>
170                         {{/if}}
171                     {{/if}}
172                     </div>
173                     <div class="details">
174                         <div class="overview">
175                         {{#if chartData}}
176                             {{interactive-chart
177                                 chartData=chartData
178                                 showYAxis=false
179                                 domain=overviewDomain
180                                 selection=overviewSelection}}
181                         {{/if}}
182                         </div>
183                         {{#if details}}
184                             {{partial "chart-details"}}
185                         {{/if}}
186                     </div>
187                 </div>
188
189                 <form {{bind-attr class=":search-pane showingSearchPane::hidden"}}>
190                     <span class="repositories">
191                         {{view Ember.Select
192                             content=App.Manifest.repositoriesWithReportedCommits
193                             optionValuePath='content.id'
194                             optionLabelPath='content.name'
195                             selection=commitSearchRepository}}
196                     </span>
197                     {{input action="searchCommit" placeholder="Name or email" value=commitSearchKeyword}}
198                 </form>
199
200                 <div {{bind-attr class=":analysis-pane showingAnalysisPane::hidden"}}>
201                     <table>
202                         <tbody>
203                             <tr>
204                                 <th>
205                                     <label>Name: {{input type=text value=newAnalysisTaskName}}</label>
206                                     <button {{action "createAnalysisTask"}} {{bind-attr disabled=cannotAnalyze}}>Analyze</button>
207                                 </th>
208                             </tr>
209                         </tbody>
210                     </table>
211                 </div>
212
213             </section>
214         {{/each}}
215     </script>
216
217     <script type="text/x-handlebars" data-template-name="components/interactive-chart">
218         {{#if interactive}}
219             <div class="selection-toolbar" style="display: none;">
220                 <a href="#" class="button" {{action "zoom"}}>
221                     <svg class="zoom" viewBox="0 0 100 100">
222                         <g stroke-width="0" stroke="none">
223                             <polygon points="25,25 5,50 25,75"/>
224                             <polygon points="75,25 95,50 75,75"/>
225                         </g>
226                         <line x1="20" y1="50" x2="80" y2="50" stroke-width="10"></line>
227                     </svg>
228                 </a>
229             </div>
230         {{/if}}
231         <div class="rangeBarsContainerInlineStyle">
232             {{#each rangeBars}}
233                 {{#link-to linkRoute linkId title=label}}
234                     <span class="rangeBar" {{bind-attr style=inlineStyle}}></span>
235                 {{/link-to}}
236             {{/each}}
237         </div>
238     </script>
239
240     <script type="text/x-handlebars" data-template-name="chart-details">
241     <div class="details-table-container">
242         <table class="details-table">
243             <tbody class="bugs">
244             {{#each details.bugTrackers}}
245                 {{#if bugs}}
246                     <tr>
247                         <th>{{label}}</th>
248                         <td>
249                             {{#each bugs}}
250                                 <a {{bind-attr href=bugUrl}} target="_blank">{{bugNumber}}</a>
251                             {{/each}}
252                         </td>
253                     </tr>
254                 {{/if}}
255             {{/each}}
256             </tbody>
257             <tr><th>Current</th><td>{{details.currentValue}} {{chartData.unit}}
258             {{#if details.oldValue}}
259                 (from {{details.oldValue}})
260             {{/if}}</td></tr>
261             {{#if details.buildNumber}}
262                 <tr>
263                     <th>Build</th>
264                     <td>
265                         {{#if details.buildURL}}
266                             <a {{bind-attr href=details.buildURL}} target="_blank">{{details.buildNumber}}</a>
267                         {{else}}
268                             {{details.buildNumber}}
269                         {{/if}}
270                         ({{details.buildTime}})
271                     </td>
272                 </tr>
273             {{/if}}
274             {{#each details.revisions}}
275                 <tr>
276                     <th>{{name}}</th>
277                     <td>
278                         {{#if url}}
279                             <a {{bind-attr href=url}} target="_blank">{{label}}</a>
280                         {{else}}
281                             {{label}}
282                         {{/if}}
283                     </td>
284                 </tr>
285                 <tr>
286                     <td colspan="2">{{commits-viewer repository=repository revisionInfo=this}}</td>
287                 </tr>
288             {{/each}}
289         </table>
290     </div>
291     </script>
292
293     <script type="text/x-handlebars" data-template-name="components/commits-viewer">
294     {{#if commits}}
295         <table>
296             <tbody>
297                 {{#each commits}}
298                     <tr>
299                         <td>
300                             {{#if url}}
301                                 <a {{bind-attr href=url}} target="_blank">{{author}}</a>
302                             {{else}}
303                                 {{author}}
304                             {{/if}}
305                         </td>
306                         <td>{{message}}</td>
307                     </tr>
308                 {{/each}}
309             </tbody>
310         </table>
311     {{/if}}
312     </script>
313
314     <script type="text/x-handlebars" data-template-name="close-button">
315         <svg class="close-button icon-button" viewBox="0 0 100 100">
316             <g stroke="black" stroke-width="10">
317                 <circle cx="50" cy="50" r="45" fill="transparent"/>
318                 <polygon points="30,30 70,70" />
319                 <polygon points="30,70 70,30" />
320             </g>
321         </svg>
322     </script>
323
324     <script type="text/x-handlebars" data-template-name="analysis-button">
325         <svg class="analysis-button icon-button" viewBox="0 0 100 100">
326             <g stroke="black" stroke-width="15">
327                 <circle cx="50" cy="50" r="40" fill="transparent"/>
328                 <line x1="50" y1="25" x2="50" y2="55"/>
329                 <circle cx="50" cy="67.5" r="2.5" fill="transparent"/>
330             </g>
331         </svg>
332     </script>
333
334     <script type="text/x-handlebars" data-template-name="search-button">
335         <svg class="search-button icon-button" viewBox="0 0 100 100">
336             <g stroke="black" stroke-width="15">
337                 <circle cx="60" cy="40" r="30" fill="transparent"/>
338                 <line x1="10" y1="90" x2="40" y2="60"/>
339             </g>
340         </svg>
341     </script>
342
343     <script type="text/x-handlebars" data-template-name="spinner">
344         <svg class="spinner" viewBox="0 0 100 100">
345             <line x1="10" y1="50" x2="30" y2="50" stroke="black" stroke-width="10" stroke-linecap="round"/>
346             <line x1="21.72" y1="21.72" x2="35.86" y2="35.86" stroke="black" stroke-width="10" stroke-linecap="round"/>
347             <line x1="50" y1="10" x2="50" y2="30" stroke="black" stroke-width="10" stroke-linecap="round"/>
348             <line x1="78.28" y1="21.72" x2="64.14" y2="35.86" stroke="black" stroke-width="10" stroke-linecap="round"/>
349             <line x1="70" y1="50" x2="90" y2="50" stroke="black" stroke-width="10" stroke-linecap="round"/>
350             <line x1="65.86" y1="65.86" x2="78.28" y2="78.28" stroke="black" stroke-width="10" stroke-linecap="round"/>
351             <line x1="50" y1="70" x2="50" y2="90" stroke="black" stroke-width="10" stroke-linecap="round"/>
352             <line x1="21.72" y1="78.28" x2="35.86" y2="65.86" stroke="black" stroke-width="10" stroke-linecap="round"/>
353         </svg>
354     </script>
355
356     <script type="text/x-handlebars" data-template-name="navbar">
357         <nav id="navigation" role="navigation">
358             <h1><a href="#">WebKit Perf Monitor</a></h1>
359             <ul>
360                 {{#link-to 'index' tagName='li'}}
361                     {{#link-to 'index'}}Dashboard{{/link-to}}
362                 {{/link-to}}
363                 {{#link-to 'charts' tagName='li'}}
364                     {{#link-to 'charts'}}Charts{{/link-to}}
365                 {{/link-to}}
366                 {{#link-to 'analysis' tagName='li'}}
367                     {{#link-to 'analysis'}}Analysis{{/link-to}}
368                 {{/link-to}}
369             </ul>
370         </nav>
371     </script>
372
373     <script type="text/x-handlebars" data-template-name="number-of-days-controls">
374         <li class="numberOfDaysIs1">
375             <a href="#" class="control-button" {{action "setNumberOfDays" 1}}>1D</a>
376         </li>
377         <li class="numberOfDaysIs7">
378             <a href="#" class="control-button" {{action "setNumberOfDays" 7}}>1W</a>
379         </li>
380         <li class="numberOfDaysIs30">
381             <a href="#" class="control-button" {{action "setNumberOfDays" 30}}>1M</a>
382         </li>
383         <li class="numberOfDaysIs90">
384             <a href="#" class="control-button" {{action "setNumberOfDays" 90}}>3M</a>
385         </li>
386         <li class="numberOfDaysIs183">
387             <a href="#" class="control-button" {{action "setNumberOfDays" 183}}>6M</a>
388         </li>
389         <li class="numberOfDaysIs365">
390             <a href="#" class="control-button" {{action "setNumberOfDays" 365}}>1Y</a>
391         </li>
392     </script>
393
394     <script type="text/x-handlebars" data-template-name="start-time-slider">
395         <label><input type="range"> <span class="numberOfDays">X</span> days</label>
396     </script>
397
398     <script type="text/x-handlebars" data-template-name="popup">
399         <span class="label">{{view App.PopupButtonView tagName="a" label=view.label }}</span>
400         {{view view.popupListContainerView viewName="popupListContainerViewInstance"}}
401     </script>
402
403     <script type="text/x-handlebars" data-template-name="popup-list">
404         {{#each view.list}}
405             {{#if isSeparator}}
406                 <li><hr></li>
407             {{else }} {{#if children}}
408                 <li>{{view App.PopupView list=children label=label}}</li>
409             {{else}}
410                 <li>
411                     {{#if actionName}}
412                         <a href="#" class="label" {{action actionName actionArgument}}>{{label}}</a>
413                     {{else}}
414                         <a class="label">{{label}}</a>
415                     {{/if}}
416                 </li>
417             {{/if}} {{/if}}
418         {{/each}}
419     </script>
420
421     <script type="text/x-handlebars" data-template-name="analysis">
422         <header id="header">
423             {{partial "navbar"}}
424         </header>
425
426         <table id="analysis-tasks">
427             <thead>
428                 <tr>
429                     <td>ID</td>
430                     <td>Name</td>
431                     <td>Created at</td>
432                 </tr>
433             </thead>
434             <tbody>
435                 {{#each model.tasks}}
436                     <tr>
437                         <td>{{#link-to 'analysisTask' id}}{{id}}{{/link-to}}</td>
438                         <td>{{name}}</td>
439                         <td>{{createdAt}}</td>
440                     </tr>
441                 {{/each}}
442             </tbody>
443         </table>
444     </script>
445
446     <script type="text/x-handlebars" data-template-name="analysisTask">
447         <header id="header">
448             {{partial "navbar"}}
449         </header>
450
451         <h2 id="analysis-task-title">{{label}}</h2>
452         {{#if platform.label}}
453             <h3 id="analysis-task-testname">{{metric.fullName}} - {{platform.label}}</h3>
454         {{/if}}
455
456         {{#if chartData}}
457             <section class="analysis-chart-pane chart-pane">
458                 <div class="svg-container">
459                     {{interactive-chart
460                         chartData=chartData
461                         enableSelection=false
462                         chartPointRadius=2
463                         domain=chartDomain
464                         highlightedItems=highlightedItems}}
465                 </div>
466                 <div class="details">
467                     <table class="analysis-bugs">
468                         <tbody>
469                             {{#each bugTrackers}}
470                                 <tr>
471                                     <th>{{label}}</th>
472                                     <td>
473                                         <form {{action "associateBug" this editedBugNumber on="submit"}}>
474                                             {{input type=text value=editedBugNumber}}
475                                         </form>
476                                     </td>
477                                 </tr>
478                             {{/each}}
479                         </tbody>
480                     </table>
481                     <table>
482                         <tbody>
483                             {{#each analysisPoints}}
484                                 <tr><td>{{label}}</td><td>{{value}}</td></tr>
485                             {{/each}}
486                         </tbody>
487                     </table>
488                 </div>
489             </section>
490             {{#each testGroups}}
491                 <section class="analysis-group">
492                     <table>
493                         <caption>{{name}}</caption>
494                         <thead>
495                             <tr>
496                                 <td>Order</td>
497                                 <td>Configuration</td>
498                                 <td>Status</td>
499                                 <td>Build</td>
500                                 <td>{{../metric.fullName}}</td>
501                             </tr>
502                         </thead>
503                         <tbody>
504                             {{#each buildRequests}}
505                                 <tr>
506                                     <td>{{orderLabel}}</td>
507                                     <td>{{config}}</td>
508                                     <td>{{#if url}}{{#link-to url}}{{statusLabel}}{{/link-to}}{{else}}{{statusLabel}}{{/if}}</td>
509                                     <td>{{build}}</td>
510                                     <td>{{mean}}</td>
511                                 </tr>
512                             {{/each}}
513                         </tbody>
514                     </table>
515                 </section>
516             {{/each}}
517
518             {{#if roots}}
519             <form method="POST" {{action "createTestGroup" newTestGroupName repetitionCount on="submit"}} class="analysis-group">
520                 <table>
521                     <caption>{{input name="name" value=newTestGroupName placeholder="Test group name" required=true type="text"}}</caption>
522                     <thead>
523                         <tr>
524                             <th>Root</th>
525                             {{#each testSets}}
526                                 <th>
527                                     {{name}}
528                                     {{view Ember.Select
529                                         content=options
530                                         optionValuePath="content.value"
531                                         optionLabelPath="content.label"
532                                         selection=selection}}
533                                 </th>
534                             {{/each}}
535                         </tr>
536                     </thead>
537                     <tbody>
538                         {{#each roots}}
539                             <tr>
540                                 <th>{{name}}</th>
541                                 {{#each sets}}
542                                     <td>{{view Ember.Select name=name content=revisions disabled=true
543                                         optionValuePath="content.value" optionLabelPath="content.label"
544                                         selection=selection}}</td>
545                                 {{/each}}
546                             </tr>
547                         {{/each}}
548                     </tbody>
549                     <tbody>
550                         <tr>
551                             <th>Number of runs</th>
552                             <td colspan=2>
553                                 {{view Ember.Select content=possibleRepetitionCounts value=repetitionCount}}
554                             </td>
555                         </tr>
556                     </tbody>
557                 </table>
558
559                 <button type="submit">Start A/B testing</button>
560             </form>
561             {{/if}}
562         {{/if}}
563     </script>
564
565 </head>
566 <body>
567 </body>
568 </html>