X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=www%2Fjs%2Fppastats.js;fp=www%2Fjs%2Fppastats.js;h=0000000000000000000000000000000000000000;hb=677d2bfc3beae998b73f48a4be3036f09d6848ff;hp=8217d55e12fdc23b205d332efa6e4ea9b0520139;hpb=87f9e3fc5960cb9abfd918d7214c848bb988c91d;p=ppastats.git diff --git a/www/js/ppastats.js b/www/js/ppastats.js deleted file mode 100644 index 8217d55..0000000 --- a/www/js/ppastats.js +++ /dev/null @@ -1,158 +0,0 @@ -function ppastats_chart(ddts) { - var data_chart = []; - var max_date = null; - var min_date = null; - - $.each(ddts, function(i, item) { - var tm = item["time"]; - var d = new Date(tm[0], tm[1]-1, tm[2]); - var entry = [d, item["value"]]; - data_chart.push(entry); - - if (max_date == null || max_date < d) { - max_date = d; - } - - if (min_date == null || min_date > d) { - min_date = d; - } - }); - - var plot1 = $.jqplot ('chart', [data_chart], { - title: 'Daily Download Count', - axes: { - xaxis: { - renderer:$.jqplot.DateAxisRenderer, - tickOptions:{formatString:'%Y/%m/%d'}, - min: min_date, - max: max_date - }, - yaxis: { - min: 0 - } - }, - series: [{lineWidth:1,showMarker:false}] - }); -} - -function ppastats_distros(distros) { - var data_chart = []; - var max_date = null; - var min_date = null; - var series_opt = []; - - $.each(distros, function(i, distro) { - var arr = []; - - $.each(distro["ddts"], function(j, item) { - var tm = item["time"]; - var d = new Date(tm[0], tm[1]-1, tm[2]); - var entry = [d, item["value"]]; - arr.push(entry); - - if (max_date == null || max_date < d) { - max_date = d; - } - - if (min_date == null || min_date > d) { - min_date = d; - } - }); - data_chart[i] = arr; - series_opt[i] = {label: distro["name"]}; - }); - - var plot1 = $.jqplot ('chart_distro', data_chart, { - title: 'Daily Download Count by Ubuntu Distribution', - axes: { - xaxis: { - renderer:$.jqplot.DateAxisRenderer, - tickOptions:{formatString:'%Y/%m/%d'}, - min: min_date, - max: max_date - }, - yaxis: { - min: 0 - } - }, - seriesDefaults: { - lineWidth:1, - showMarker:false - }, - legend: { - show: true - }, - series: series_opt - }); -} - - -function ppastats_pkg(json_url) { - $(document).ready(function() { - $.getJSON(json_url, function(data) { - $("#ppa_owner").html(data["ppa_owner"]); - $("#ppa_name").html(data["ppa_name"]); - $("#pkg_name").html(data["name"]); - - $("#versions").append("