Merge pull request #15 from apache/unused

Drop unused variables
diff --git a/README.md b/README.md
index de1168e..2a863a3 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 # ASF Infrastructure Reporting Dashboard
 
-This serves as the basis for the ASF Infrastructure Reporting Dashboard, used to display various statistics and live charts 
+This serves as the basis for the 
+[ASF Infrastructure Reporting Dashboard](https://infra-reports.apache.org/),
+used to display various statistics and live charts 
 on data pertaining to a wide variety of infrastructure aspects at the ASF as a unified dashboard.
 
 WIP.
diff --git a/server/app/endpoints/downloads.py b/server/app/endpoints/downloads.py
index eb599b3..692f920 100644
--- a/server/app/endpoints/downloads.py
+++ b/server/app/endpoints/downloads.py
@@ -100,7 +100,7 @@
     )
     main_bucket.metric("useragents", "terms", field=field_names["useragent"]+".keyword", size=max_ua)
     main_bucket.bucket("per_day", "date_histogram", interval="day", field=field_names["timestamp"]
-                       ).metric(
+    ).metric(
         "bytes_sum", "sum", field=field_names["bytes"]
     ).metric(
         "unique_ips", "cardinality", field="client_ip.keyword"
@@ -108,7 +108,7 @@
         "cca2", "terms", field=field_names["geo_country"] + ".keyword"
     )
 
-    # Bucket sorting by most bytes downloaded (may differ from most downloads top 50!)
+    # Bucket sorting by most bytes downloaded (may differ from most downloads top 60!)
     main_bucket = q.aggs.bucket(
         "most_traffic", elasticsearch_dsl.A("terms", field=f"{field_names['uri']}.keyword", size=max_hits, order={"bytes_sum": "desc"})
     )
@@ -116,7 +116,7 @@
     main_bucket.metric(
         "bytes_sum", "sum", field=field_names["bytes"]
     ).bucket("per_day", "date_histogram", interval="day", field=field_names["timestamp"]
-             ).metric(
+    ).metric(
         "bytes_sum", "sum", field=field_names["bytes"]
     ).metric(
         "unique_ips", "cardinality", field="client_ip.keyword"
diff --git a/static/plugins/downloads.js b/static/plugins/downloads.js
index 31551a8..2221c2c 100644
--- a/static/plugins/downloads.js
+++ b/static/plugins/downloads.js
@@ -139,13 +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];
@@ -154,6 +155,10 @@
                 }
             }
             total_downloads_curated["Other files"].push([day, other_count]);
+            other_count_total += other_count;
+        }
+        if (other_count_total == 0) {
+            delete total_downloads_curated["Other files"];
         }
     }
     for (const uri of uris_top_downloads) {
@@ -200,13 +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];
@@ -215,6 +221,10 @@
                 }
             }
             total_bytes_curated["Other files"].push([day, other_count]);
+            other_count_total += other_count;
+        }
+        if (other_count_total == 0) {
+            delete total_bytes_curated["Other files"];
         }
     }
     for (const uri of uris_top_bytes) {
@@ -298,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);