Merge pull request #16 from apache/no-other
Don't show Other in listing if it is empty
diff --git a/static/plugins/downloads.js b/static/plugins/downloads.js
index baf8252..4d568a5 100644
--- a/static/plugins/downloads.js
+++ b/static/plugins/downloads.js
@@ -139,14 +139,14 @@
}
uris.sort((a,b) => total_downloads_sum[b] - total_downloads_sum[a]);
- const uris_top_downloads = uris.slice(0, 30);
+ const uris_top_downloads = uris.slice(0, 30); // Only include some of the top URIs in the graph
if (!target_uri) {
total_downloads_curated["Other files"] = [];
let other_count_total = 0;
for (const day of all_days) {
let other_count = 0;
for (const [uri, entry] of Object.entries(total_downloads_histogram)) {
- if (!uris_top_downloads.includes(uri)) { // Don't include top 10
+ if (!uris_top_downloads.includes(uri)) { // Not included in graph
for (const el of entry) {
if (el[0] === day) {
other_count += el[1];
@@ -205,14 +205,14 @@
uris.sort((a,b) => total_bytes_sum[b] - total_bytes_sum[a]);
- const uris_top_bytes = uris.slice(0, 30);
+ const uris_top_bytes = uris.slice(0, 30); // Only include some of the top URIs in the graph
if (!target_uri) {
total_bytes_curated["Other files"] = [];
let other_count_total = 0;
for (const day of all_days) {
let other_count = 0;
for (const [uri, entry] of Object.entries(total_bytes_histogram)) {
- if (!uris_top_bytes.includes(uri)) { // Don't include top 10
+ if (!uris_top_bytes.includes(uri)) { // Not included in graph
for (const el of entry) {
if (el[0] === day) {
other_count += el[1];
@@ -308,11 +308,11 @@
// Downloads by browser and operating system
outer_chart_area.appendChild(document.createElement('hr'));
- const donut_os = chart_pie("Downloads by Operating System", "This chart shows the distribution of downloads based on the users' operating systems as reported by the browser. The chart only reflects the top 50 most downloaded artifacts.", dict_to_pie(total_by_system), {width: "720px", height: "400px"}, donut=true);
+ const donut_os = chart_pie("Downloads by Operating System", "This shows the distribution of downloads based on the users' browser clients as reported by them, for the top 60 files (or single file if one is selected).", dict_to_pie(total_by_system), {width: "720px", height: "400px"}, donut=true);
donut_os.style.maxWidth = "600px";
donut_os.style.height = "460px";
outer_chart_area.appendChild(donut_os);
- const donut_browser = chart_pie("Downloads by Browser", "This chart shows the distribution of downloads based on the users' browser clients as reported by the browser. The chart only reflects the top 50 most downloaded artifacts.", dict_to_pie(total_by_browser), {width: "720px", height: "400px"}, donut=true);
+ const donut_browser = chart_pie("Downloads by Browser", "This shows the distribution of downloads based on the users' browser clients as reported by them, for the top 60 files (or single file if one is selected).", dict_to_pie(total_by_browser), {width: "720px", height: "400px"}, donut=true);
donut_browser.style.maxWidth = "600px";
donut_browser.style.height = "460px";
outer_chart_area.appendChild(donut_browser);