diff --git a/html/js/melpa.js b/html/js/melpa.js index af688368..17beca31 100644 --- a/html/js/melpa.js +++ b/html/js/melpa.js @@ -117,6 +117,8 @@ $scope.allPackages = pkgs; $scope.pkg = pkgs[packageName]; $scope.reverseDependencies = packageService.dependenciesOn(packageName); + var downloadCounts = _.pluck(pkgs, 'downloads'); + $scope.downloadsPercentile = _.filter(downloadCounts, function(d) { return d < $scope.pkg.downloads; }).length * 100.0 / downloadCounts.length; }); $scope.readme = $http.get("/packages/" + packageName + "-readme.txt").then(function(r) { return r.data; }); $scope.havePackage = function(pkgName) { diff --git a/html/partials/package.html b/html/partials/package.html index 028c0b8a..378b9153 100644 --- a/html/partials/package.html +++ b/html/partials/package.html @@ -12,7 +12,7 @@
Downloads
-
{{pkg.downloads}} (all versions)
+
{{pkg.downloads}} (all versions), percentile: {{downloadsPercentile | number:2}}
Source
{{pkg.source}}