mirror of
https://github.com/correl/melpa.git
synced 2025-01-03 11:07:31 +00:00
Show percentiles for download counts on individual package pages
This commit is contained in:
parent
e2768ed591
commit
67514ea5cb
2 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="well">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Downloads</dt>
|
||||
<dd>{{pkg.downloads}} <span class="muted">(all versions)</span></dd>
|
||||
<dd>{{pkg.downloads}} <span class="muted">(all versions)</span>, percentile: {{downloadsPercentile | number:2}}</dd>
|
||||
<dt>Source</dt>
|
||||
<dd>
|
||||
<a ng-show="pkg.sourceURL" href="{{pkg.sourceURL}}">{{pkg.source}}</a>
|
||||
|
|
Loading…
Reference in a new issue