From: David Read Date: Thu, 14 Feb 2013 15:19:26 +0000 Subject: [162] Force browers to refresh JS and CSS with revamp. X-Git-Url: http://maxious.lambdacomplex.org/git/?p=ckanext-ga-report.git&a=commitdiff&h=61133f0414fb56083cfd85cb580ea201f7145801 --- [162] Force browers to refresh JS and CSS with revamp. --- --- a/ckanext/ga_report/controller.py +++ b/ckanext/ga_report/controller.py @@ -417,14 +417,11 @@ # Create a consistent x-axis between all series num_points = [ len(series['data']) for series in data ] ideal_index = num_points.index( max(num_points) ) - x_axis = [] - for series in data: - for point in series['data']: - x_axis.append(point['x']) - x_axis = sorted( list( set(x_axis) ) ) - # Zero pad any missing values + x_axis = [ point['x'] for point in data[ideal_index]['data'] ] for series in data: xs = [ point['x'] for point in series['data'] ] + assert set(xs).issubset( set(x_axis) ), (xs, x_axis) + # Zero pad any missing values for x in set(x_axis).difference(set(xs)): series['data'].append( {'x':x, 'y':0} ) if percentageMode: @@ -433,6 +430,9 @@ for series in series_list: for point in series['data']: totals[point['x']] = totals.get(point['x'],0) + point['y'] + lengths = [ len(series['data']) for series in series_list ] + assert len(set(lengths))==1 + assert lengths[0] == len(totals) return totals # Transform data into percentage stacks totals = get_totals(data) --- a/ckanext/ga_report/public/css/ga_report.css +++ b/ckanext/ga_report/public/css/ga_report.css @@ -18,7 +18,6 @@ .rickshaw_legend { background: transparent; width: 100%; - padding-top: 4px; } .rickshaw_y_axis { position: absolute; @@ -30,10 +29,6 @@ background: transparent !important; color: #000000 !important; font-weight: normal !important; -} -.rickshaw_legend .instructions { - color: #000; - margin-bottom: 6px; } .rickshaw_legend .line .action { @@ -49,9 +44,6 @@ float: left; width: 200px; } -.rickshaw_legend .line .label:hover { - text-decoration: underline; -} .ga-reports-table .td-numeric { text-align: center; --- a/ckanext/ga_report/public/scripts/ckanext_ga_reports.js +++ b/ckanext/ga_report/public/scripts/ckanext_ga_reports.js @@ -45,7 +45,6 @@ graph: graph, legend: legend } ); - myLegend.prepend('
Click on a series below to isolate its graph:
'); graph.render(); }; @@ -95,7 +94,6 @@ } legend_name = '#legend_'+legend_name; $('#graph-legend-container > *').hide(); - $('#graph-legend-container .instructions').show(); $(legend_name).show(); } ); --- a/ckanext/ga_report/templates/ga_report/publisher/index.html +++ b/ckanext/ga_report/templates/ga_report/publisher/index.html @@ -24,8 +24,8 @@ - - + + --- a/ckanext/ga_report/templates/ga_report/publisher/read.html +++ b/ckanext/ga_report/templates/ga_report/publisher/read.html @@ -9,8 +9,8 @@ - - + + --- a/ckanext/ga_report/templates/ga_report/site/index.html +++ b/ckanext/ga_report/templates/ga_report/site/index.html @@ -9,8 +9,8 @@ - - + +