Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added ui components

  • Loading branch information...
commit 6509075d35820c7c2c32830c796041fb0b56457d 1 parent 294f7fa
@jeads jeads authored
View
1  .gitignore
@@ -1,4 +1,5 @@
*.pyc
+*.swp
htmlcov/
datazilla/settings/local.py
docs/_build/
View
71 datazilla/model/metrics.py
@@ -72,6 +72,15 @@ def __init__(self, project=None, metrics=()):
self.mf = MetricsMethodFactory(self.metrics)
+ self.push_value_names = set(['push_date', 'pushlog_id'])
+
+ self.format_float_values = set(
+ ['mean', 'stddev', 'trend_mean', 'trend_stddev', 'p']
+ )
+ self.format_boolean_values = set(
+ ['fdr', 'h0_rejected', 'test_evaluation']
+ )
+
@classmethod
def get_metrics_key(cls, data):
return cls.KEY_DELIMITER.join(
@@ -399,13 +408,6 @@ def get_metrics_data_from_test_run_ids(self, test_run_ids, page_name):
)
key_lookup = {}
- push_value_names = set(['push_date', 'pushlog_id'])
- format_float_values = set(
- ['mean', 'stddev', 'trend_mean', 'trend_stddev', 'p']
- )
- format_boolean_values = set(
- ['fdr', 'h0_rejected', 'test_evaluation']
- )
#Build a page lookup to filter by
page_names = set()
@@ -462,12 +464,9 @@ def get_metrics_data_from_test_run_ids(self, test_run_ids, page_name):
value_name = d['metric_value_name']
value = d['value']
- if value_name in format_float_values:
- value = float( format(value, '.1f') )
- if value_name in format_boolean_values:
- value = bool(value)
+ value = self._format_value(value_name, value)
- if value_name in push_value_names:
+ if value_name in self.push_value_names:
if value:
key_lookup[summary_key]['push_info'][value_name] = value
@@ -569,7 +568,6 @@ def get_metrics_summary(self, test_run_ids):
return summary_data
key_lookup = set()
- push_value_names = set(['push_date', 'pushlog_id'])
#Build summary data structure
for index, d in enumerate(computed_metrics):
@@ -599,15 +597,12 @@ def get_metrics_summary(self, test_run_ids):
tname = d['test_name']
- value_name = d['metric_value_name']
- value = int(d['value'])
-
if tname not in summary_data['tests']:
summary_data['tests'][tname] = {}
if pname not in summary_data['tests'][tname]:
cstruct = self._get_counter_struct()
- cstruct['pages'] = []
+ cstruct['pages'] = {}
cstruct['platform_info'] = {}
summary_data['tests'][tname][pname] = cstruct
@@ -619,10 +614,10 @@ def get_metrics_summary(self, test_run_ids):
summary_data['summary_by_test'][tname] = \
self._get_counter_struct()
- summary_data['summary']['total_tests'] += 1
- summary_data['summary_by_platform'][pname]['total_tests'] += 1
- summary_data['summary_by_test'][tname]['total_tests'] += 1
- summary_data['tests'][tname][pname]['total_tests'] += 1
+ value_name = d['metric_value_name']
+ value = int(d['value'])
+
+ value = self._format_value(value_name, value)
summary_data['tests'][tname][pname]['platform_info'] = {
'operating_system_name':d['operating_system_name'],
@@ -631,6 +626,28 @@ def get_metrics_summary(self, test_run_ids):
'operating_system_version':d['operating_system_version']
}
+ if d['page_name'] not in summary_data['tests'][tname][pname]['pages']:
+ summary_data['tests'][tname][pname]['pages'][ d['page_name'] ] = \
+ {
+ 'test_evaluation':0,
+ 'mean':0,
+ 'stddev':0,
+ 'trend_mean':0,
+ 'trend_stddev':0
+ }
+
+ summary_data['tests'][tname][pname]['pages'][ d['page_name'] ][
+ value_name] = value
+
+ if value_name != 'test_evaluation':
+ continue
+
+ #only count the test_evaluation data
+ summary_data['summary']['total_tests'] += 1
+ summary_data['summary_by_platform'][pname]['total_tests'] += 1
+ summary_data['summary_by_test'][tname]['total_tests'] += 1
+ summary_data['tests'][tname][pname]['total_tests'] += 1
+
if value == 1:
summary_data['summary_by_platform'][pname]['pass']['value'] += 1
summary_data['summary_by_test'][tname]['pass']['value'] += 1
@@ -643,9 +660,6 @@ def get_metrics_summary(self, test_run_ids):
summary_data['tests'][tname][pname]['fail']['value'] += 1
summary_data['summary']['fail']['value'] += 1
- summary_data['tests'][tname][pname]['pages'].append(
- { d['page_name']:bool(value) }
- )
#Calculate percentages
summary_data['summary']['fail']['percent'] = \
@@ -733,6 +747,15 @@ def get_test_run_ids_from_pushlog_ids(self, pushlog_ids=[]):
return test_run_ids
+ def _format_value(self, value_name, value):
+
+ if value_name in self.format_float_values:
+ value = float( format(value, '.1f') )
+ if value_name in self.format_boolean_values:
+ value = bool(value)
+
+ return value
+
def _calculate_percentage(self, value, total):
percentage = 0.00
View
3  datazilla/model/sql/perftest.json
@@ -769,7 +769,8 @@
LEFT JOIN `metric_value` AS mv ON tpm.metric_value_id = mv.id
LEFT JOIN `machine` AS m ON tr.machine_id = m.id
LEFT JOIN `operating_system` AS o ON m.operating_system_id = o.id
- WHERE mv.name = 'test_evaluation' AND tr.id IN (REP0)",
+ WHERE mv.name IN ('test_evaluation', 'mean', 'stddev', 'trend_mean', 'trend_stddev')
+ AND tr.id IN (REP0)",
"host":"read_host"
},
View
132 datazilla/webapp/static/css/summary.css
@@ -1,28 +1,67 @@
+body {
+ font-family: helvetica, arial, sans-serif;
+ font-size: 14px;
+ margin: 0;
+ padding: 0;
+ border-top: 2px solid #676767;
+ min-width: 925px;
+}
div.su-toppanel {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- border: 0 solid #000;
- background: -moz-linear-gradient(-90deg, #74D435, #43AA00);
- background: -webkit-gradient(linear, left top, left bottom, from(#74D435), to(#43AA00));
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ border: 0 solid #000;
+ background: -moz-linear-gradient(-90deg, #74D435, #43AA00);
+ background: -webkit-gradient(linear, left top, left bottom, from(#74D435), to(#43AA00));
- height: 50px;
- width: 95%;
- margin-top: 20px;
- padding-top: 10px;
+ height: 50px;
+ width: 95%;
+ margin-top: 20px;
+ padding-top: 10px;
}
div.su-panel-base {
width: 93%;
+ height: 300px;
margin-left: auto;
margin-right: auto;
+ margin-bottom: 10px;
background: white;
}
-
-div.su-progressbar-contianer {
+div.su-main-gauge {
+ float: left;
+ width: 250px;
+ margin-left:10px;
+}
+div.su-reference-info {
+ margin-left:20px;
+ margin-right:20px;
+}
+div.su-dashboard-panel {
+ float: left;
+ margin-top: 40px;
+}
+div.su-spinner {
+ background: transparent url(/static/images/spinner.gif) no-repeat center center;
+ height:280px;
+}
+.su-scroll-panel {
+ overflow-y: auto;
+ height:200px;
+ width:300px;
+}
+.su-no-data {
+ font-size: 18px !important;
+ text-align: center;
+ margin-top: 130px;
+ opacity: 0.8;
}
+/* Progress bar styles */
+div.su-progressbar-container {
+ width: 275px;
+}
div.su-progressbar-title {
width: 150px;
float: left;
@@ -30,11 +69,80 @@ div.su-progressbar-title {
margin-bottom: 5px;
}
div.su-progressbar {
- width: 50px;
+ width: 70px;
float: left;
margin-left: 10px;
margin-bottom: 5px;
background: #FF7700;
color: #44AA00;
+}
+div.su-progressbar-value {
+ float: right;
+ margin-bottom: 5;
+ margin-left: 5;
+}
+
+.su-light-text {
+ opacity: 0.8;
+}
+.su-light-text2 {
+ opacity: 0.5;
+}
+span.su-pass-color {
+ color: #44AA00;
+}
+span.su-fail-color {
+ color: #FF7700;
+}
+span.su-fail-color {
+
+}
+
+
+/* Grid styles */
+div.su-column-headers {
+
+ -webkit-transform:rotate(270deg);
+ -moz-transform:rotate(270deg);
+ -o-transform: rotate(270deg);
+ white-space:nowrap;
+
+ width: 125px;
+
+ position:absolute;
+ left: 260px;
+ top: 365px;
+}
+div.su-row-headers {
+
+ float: left;
+ width: 150px;
+ margin-top: 15px;
+
+}
+div.su-grid-values {
+ float: left;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ text-align: center;
+ border-top: thin solid;
+ border-left: thin solid;
+}
+div.su-grid-column {
+ width:100px;
+ height:30px;
+}
+div.su-grid-row {
+ float: left;
+ height:30px;
+ width: 150px;
+
+}
+div.su-grid-value {
+ float: left;
+ width: 30px;
+ height: 30px;
+ border-bottom: thin solid;
+ border-right: thin solid;
}
View
11 datazilla/webapp/static/js/data_views/Bases.js
@@ -101,5 +101,16 @@ var View = new Class({
newId = '#' + id + '_' + dviewIndex;
}
return newId;
+ },
+ getAlphabeticalSortKeys: function(sortTarget){
+
+ var key = "";
+ var keys = [];
+ for (key in sortTarget){
+ if (sortTarget.hasOwnProperty(key)){
+ keys.push(key);
+ }
+ }
+ return keys.sort();
}
});
View
294 datazilla/webapp/static/js/metric_summary/MetricDashboardComponent.js
@@ -0,0 +1,294 @@
+/*******
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ * *****/
+var MetricDashboardComponent = new Class({
+
+ Extends: Component,
+
+ jQuery:'MetricDashboardComponent',
+
+ initialize: function(selector, options){
+
+ this.setOptions(options);
+
+ this.parent(options);
+
+ this.metricSummaryDataEvent = 'METRIC_SUMMARY_EV';
+
+ this.view = new MetricDashboardView('#MetricDashboardView',{});
+ this.model = new MetricDashboardModel('#MetricDashboardModel',{});
+
+ this.model.getMetricSummary(
+ this, this.initializeDashboard, this.dataLoadError
+ );
+ },
+ initializeDashboard: function(data){
+
+ //Send data event for any listeners that need
+ //to initialize
+ $(this.view.eventContainerSel).trigger(
+ this.metricSummaryDataEvent, data
+ );
+
+ if(_.isEmpty(data)){
+ this.view.showNoDataMessage();
+ }else{
+
+ this.view.initializeDashboard(data);
+ }
+ },
+ dataLoadError: function(data, textStatus, jqXHR){
+
+ var messageText = 'Ohhh no, something has gone horribly wrong! ';
+
+ messageText += ' HTTP status:' + data.status + ', ' + textStatus +
+ ', ' + data.statusText;
+
+ }
+});
+var MetricDashboardView = new Class({
+
+ Extends:View,
+
+ jQuery:'MetricDashboardView',
+
+ initialize: function(selector, options){
+
+ this.setOptions(options);
+
+ this.parent(options);
+
+ this.progressBars = {};
+
+ this.eventContainerSel = '#su_container';
+
+ this.mainGaugeId = 'su_gauge_1';
+
+ this.spinnerSel = '#su_dashboard_spinner';
+ this.noDataSel = '#su_no_data';
+ this.noDataMessageSel = '#su_no_data_message';
+ this.dashboardSel = '#su_dashboard';
+
+ this.summaryByTestContainerSel = '#su_summary_by_test';
+ this.summaryByPlatformContainerSel = '#su_summary_by_platform';
+
+ this.progressBarTitleSel = '#su_progressbar_title';
+ this.progressBarSel = '#su_progressbar';
+ this.progressBarTitleClassName = 'su-progressbar-title';
+ this.progressBarClassName = 'su-progressbar';
+
+ this.productTestsSel = '#su_product_tested';
+ this.revisionTestedSel = '#su_revision_tested';
+ this.totalCountSel = '#su_total_count';
+ this.passCountSel = '#su_pass_count';
+ this.failCountSel = '#su_fail_count';
+
+ this.dashboardPanelClass = 'su-dashboard-panel';
+ this.referenceInfoPanelClass = 'su-reference-info';
+
+ this.progressbarValueClassSel = '.ui-progressbar-value';
+
+
+ },
+
+ initializeDashboard: function(data){
+
+ //Initialize main gauge
+ this.mainGauge = new JustGage({
+
+ id: this.mainGaugeId,
+ value: data.summary.pass.percent,
+ min: 0,
+ max: 100,
+ title: "Talos Dashboard",
+ label: "Percent Passed",
+
+ showInnerShadow: true,
+ levelColorsGradient: true,
+
+ gaugeColor: MS_PAGE.failColor,
+ levelColors: [MS_PAGE.passColor]
+ });
+
+ //Initialize progress bars
+ this.loadProgressBars(
+ this.summaryByTestContainerSel, data.summary_by_test,
+ this.getAlphabeticalSortKeys(data.summary_by_test)
+ );
+
+ this.loadProgressBars(
+ this.summaryByPlatformContainerSel, data.summary_by_platform,
+ this.getAlphabeticalSortKeys(data.summary_by_platform)
+ );
+
+ //Set reference info
+ this.setReferenceInfo(data);
+
+ this.toggleDashboard(true);
+
+ this.animateProgressBars();
+ },
+ toggleDashboard: function(toggleOn, target){
+
+ $(this.spinnerSel).hide();
+
+ if (toggleOn){
+
+ $('.' + this.dashboardPanelClass).css('display', 'block');
+
+ $(this.dashboardSel).show();
+ $('.' + this.referenceInfoPanelClass).css('display', 'block');
+
+ } else {
+
+ $('.' + this.dashboardPanelClass).css('display', 'none');
+
+ $(this.dashboardSel).hide();
+ $('.' + this.referenceInfoPanelClass).css('display', 'none');
+
+ if (target){
+ $(target).show();
+ }
+ }
+ },
+ showNoDataMessage: function(){
+
+ var message = MS_PAGE.refData.revision + ' ' +
+ MS_PAGE.refData.branch;
+
+ $(this.noDataMessageSel).text(message);
+
+ this.toggleDashboard(false, this.noDataSel);
+
+ },
+ animateProgressBars: function(){
+ for(var title in this.progressBars){
+
+ var percent = this.progressBars[title]['value'];
+
+ //Get the parent element width
+ var parentWidth = parseInt(
+ $(this.progressBars[title]['pb']).css('width')
+ );
+
+ //Calculate the percent width
+ var width = Math.floor( (parseInt(percent)/100)*parentWidth );
+
+ //Run animation
+ var el = $(this.progressBars[title]['pb']).find(
+ this.progressbarValueClassSel
+ );
+
+ $(el).css('display', 'block');
+ $(el).stop().animate(
+ {width:width},
+ {queue:false, duration:1000}
+ );
+ }
+ },
+ setReferenceInfo: function(data){
+
+ var productInfo = data.product_info.name + ' ' +
+ data.product_info.branch + ' ' + data.product_info.version;
+
+ $(this.productTestsSel).text(productInfo);
+
+ $(this.revisionTestedSel).text(
+ data.product_info.revision
+ );
+
+ $(this.totalCountSel).text(data.summary.total_tests);
+
+ $(this.passCountSel).text(data.summary.pass.value + ' passed');
+ $(this.failCountSel).text(data.summary.fail.value + ' failed');
+
+ },
+ loadProgressBars: function(targetContainer, data, order){
+
+ var pbContainer = $('<div class="su-progressbar-container"></div>');
+
+ var title = "";
+ for(var i=0; i<order.length; i++){
+
+ title = order[i];
+
+ if (data.hasOwnProperty(title)){
+
+ container = $('<div></div>');
+ $(container).css('margin-bottom', 10);
+
+ titleDiv = $('<div class="su-light-text">' +
+ title + '</div>');
+
+ titleDiv.addClass(this.progressBarTitleClassName);
+
+ $(container).append(titleDiv);
+
+ pb = $('<div></div>').clone();
+ $(pb).addClass(this.progressBarClassName);
+
+ percent = data[title].pass.percent;
+
+ $(pb).progressbar();
+
+
+ this.progressBars[title] = { pb:pb, value:percent };
+
+ $(container).append(pb);
+
+ valueDiv = $('<div class="su-progressbar-value su-light-text">' +
+ percent + '%</div>');
+
+ $(container).append(valueDiv);
+
+ $(pbContainer).append(container);
+
+ $(targetContainer).append(pbContainer);
+ }
+ }
+ //The inner div in the progress bar gives
+ //the "bar" foreground appearance, color it
+ //by the pass color
+ $('.' + this.progressBarClassName + ' > div').css(
+ 'background', MS_PAGE.passColor
+ );
+
+ $('.' + this.progressBarClassName + ' > div').addClass(
+ this.progressbarValueClassSel
+ );
+ }
+});
+var MetricDashboardModel = new Class({
+
+ Extends:Model,
+
+ jQuery:'MetricDashboardModel',
+
+ initialize: function(options){
+
+ this.setOptions(options);
+
+ this.parent(options);
+
+ },
+
+ getMetricSummary: function(context, fnSuccess, fnError){
+
+ uri = '/' + MS_PAGE.refData.project +
+ '/testdata/metrics/' + MS_PAGE.refData.branch +
+ '/' + MS_PAGE.refData.revision + '/summary';
+
+ jQuery.ajax( uri, {
+ accepts:'application/json',
+ dataType:'json',
+ cache:false,
+ type:'GET',
+ data:data,
+ context:context,
+ error:fnError,
+ success:fnSuccess,
+ });
+ }
+});
View
183 datazilla/webapp/static/js/metric_summary/MetricGaugeComponent.js
@@ -1,183 +0,0 @@
-/*******
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- * *****/
-var MetricGaugeComponent = new Class({
-
- Extends: Component,
-
- jQuery:'MetricGaugeComponent',
-
- initialize: function(selector, options){
-
- this.setOptions(options);
-
- this.parent(options);
-
- this.view = new MetricGaugeView('#MetricGaugeView',{});
- this.model = new MetricGaugeModel('#MetricGaugeModel',{});
-
- this.model.getMetricSummary(
- this, this.initializeGauge, this.dataLoadError
- );
- },
- initializeGauge: function(data){
-
- console.log('data');
- console.log(data);
-
- this.view.initializeGauge(data);
- },
- dataLoadError: function(data, textStatus, jqXHR){
-
- var messageText = 'Ohhh no, something has gone horribly wrong! ';
-
- messageText += ' HTTP status:' + data.status + ', ' + textStatus +
- ', ' + data.statusText;
-
- console.log(messageText);
-
- }
-
-});
-var MetricGaugeView = new Class({
-
- Extends:View,
-
- jQuery:'MetricGaugeView',
-
- initialize: function(selector, options){
-
- this.setOptions(options);
-
- this.parent(options);
-
- this.mainGaugeId = 'su_gauge_1';
-
- this.summaryByTestContainer = '#su_summary_by_test';
- this.summaryByPlatformContainer = '#su_summary_by_platform';
-
- this.progressBarContainerSel = '#su_progressbar_container';
- this.progressBarTitleSel = '#su_progressbar_title';
- this.progressBarSel = '#su_progressbar';
- this.progressBarTitleClassName = 'su-progressbar-title';
- this.progressBarClassName = 'su-progressbar';
-
- this.failColor = '#FF7700';
- this.passColor = '#44AA00';
-
- },
-
- initializeGauge: function(data){
-
- //Initialize main gauge
- this.mainGauge = new JustGage({
-
- id: this.mainGaugeId,
- value: data.summary.pass.percent,
- width: 250,
- min: 0,
- max: 100,
- title: "Talos Summary",
- label: "Percent Pass",
-
- showInnerShadow: true,
- levelColorsGradient: true,
-
- gaugeColor: this.failColor,
- levelColors: [this.passColor]
- });
-
- this.loadProgressBars(
- this.summaryByTestContainer, data.summary_by_test
- );
-
- this.loadProgressBars(
- this.summaryByPlatformContainer, data.summary_by_platform
- );
-
- },
- loadProgressBars: function(targetContainer, data){
-
- pbContainer = $(this.progressBarContainerSel).clone();
-
- $(pbContainer).attr('id', "");
- $(pbContainer).css('width', 275);
-
- for (title in data){
- if (data.hasOwnProperty(title)){
-
- container = $('<div></div>');
- $(container).css('margin-bottom', 10);
-
- titleDiv = $('<div>' + title + '</div>');
- titleDiv.addClass(this.progressBarTitleClassName);
-
- $(container).append(titleDiv);
-
- pb = $('<div></div>').clone();
- $(pb).addClass(this.progressBarClassName);
-
- percent = data[title].pass.percent;
-
- $(pb).progressbar({
- value: percent
- });
-
- $(container).append(pb);
-
-
- valueDiv = $('<div>' + percent + '%</div>');
- $(valueDiv).css('float', 'right');
- $(valueDiv).css('margin-bottom', 5);
- $(valueDiv).css('margin-left', 5);
- $(container).append(valueDiv);
-
- $(pbContainer).append(container);
-
- $(targetContainer).append(pbContainer);
- }
- }
- //The inner div in the progress bar gives
- //the "bar" foreground appearance, collor it
- //by the pass color
- $('.' + this.progressBarClassName + ' > div').css(
- 'background', this.passColor
- );
- }
-});
-var MetricGaugeModel = new Class({
-
- Extends:Model,
-
- jQuery:'MetricGaugeModel',
-
- initialize: function(options){
-
- this.setOptions(options);
-
- this.parent(options);
-
- },
-
- getMetricSummary: function(context, fnSuccess, fnError){
-
- uri = '/' + MS_PAGE.refData.project +
- '/testdata/metrics/' + MS_PAGE.refData.branch +
- '/' + MS_PAGE.refData.revision + '/summary';
-
- console.log(uri);
-
- jQuery.ajax( uri, {
- accepts:'application/json',
- dataType:'json',
- cache:false,
- type:'GET',
- data:data,
- context:context,
- error:fnError,
- success:fnSuccess,
- });
- }
-});
View
10 datazilla/webapp/static/js/metric_summary/MetricSummaryPage.js
@@ -15,6 +15,9 @@ var MetricSummaryPage = new Class( {
initialize: function(selector, options){
this.parent(options);
+
+ this.failColor = '#FF7700';
+ this.passColor = '#44AA00';
},
setRefData: function(){
@@ -34,9 +37,8 @@ $(document).ready(function() {
MS_PAGE.setRefData();
-
- console.log(MS_PAGE.urlObj.data);
-
- MS_PAGE.metricGaugeComponent = new MetricGaugeComponent();
+ MS_PAGE.metricGridComponent = new MetricGridComponent();
+ MS_PAGE.testPagesComponent = new TestPagesComponent();
+ MS_PAGE.metricDashboardComponent = new MetricDashboardComponent();
});
View
111 datazilla/webapp/static/js/metric_summary/TestPagesComponent.js
@@ -0,0 +1,111 @@
+/*******
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ * *****/
+var TestPagesComponent = new Class({
+
+ Extends: Component,
+
+ jQuery:'TestPagesComponent',
+
+ initialize: function(selector, options){
+
+ this.setOptions(options);
+
+ this.parent(options);
+
+ this.view = new TestPagesView('#TestPagesView',{});
+ this.model = new TestPagesModel('#TestPagesModel',{});
+
+ },
+ initializeTestPages: function(ev, data){
+
+ if(_.isEmpty(data)){
+
+ }else{
+ this.view.initializeTestPages(data);
+ }
+ }
+});
+var TestPagesView = new Class({
+
+ Extends:View,
+
+ jQuery:'TestPagesView',
+
+ initialize: function(selector, options){
+
+ this.setOptions(options);
+
+ this.parent(options);
+
+ this.eventContainerSel = '#su_container';
+ this.barChartContainerSel = '#su_test_pages';
+
+ this.gridClickEvent = 'GRID_CLICK_EVENT';
+ this.gridMouseoverEvent = 'GRID_MOUSEOVER_EVENT';
+
+ $(this.eventContainerSel).bind(
+ this.gridMouseoverEvent,
+ _.bind(this.initializeTestPages, this)
+ );
+
+ },
+
+ initializeTestPages: function(event, data){
+
+ console.log(data);
+
+ //var columns = this.getAlphabeticalSortKeys(
+ // data.summary_by_platform
+ // );
+
+ },
+ _updatePlot: function(data){
+
+ if(this.plot){
+ this.plot.shutdown();
+ $(this.barChartContainerSel).unbind('plotclick');
+ $(this.barChartContainerSel).unbind('plothover');
+ }
+ this.plot = $.plot(
+ $(this.barChartContainerSel), data, this.plotOptions
+ );
+
+ this.barChartContainerSel = '#su_test_pages';
+
+ this._setYaxisLabel(this.yAxisLabel);
+
+ $(this.barChartContainerSel).bind(
+ 'plotclick', _.bind(this._clickPlot, this)
+ );
+ $(this.barChartContainerSel).bind(
+ 'plothover', _.bind(this._hoverPlot, this)
+ );
+ },
+ _setYaxisLabel: function(label){
+ /*
+ var labelEl = $('<div class="css-left dv-verticaltext" style="position:absolute;' +
+ ' top:235px; right:' + this.width + 'px;">' + label + '</div>');
+ var yaxisLabelContainer = $(this.selectors.graph_container).find(this.flotLabelClassSel);
+
+ $(yaxisLabelContainer).append(labelEl);
+ */
+ },
+});
+
+var TestPagesModel = new Class({
+
+ Extends:Model,
+
+ jQuery:'TestPagesModel',
+
+ initialize: function(options){
+
+ this.setOptions(options);
+
+ this.parent(options);
+
+ }
+});
Please sign in to comment.
Something went wrong with that request. Please try again.