Skip to content

Commit b507d8e

Browse files
committed
Simplify the download plot by removing daily values
1 parent 7b1cc75 commit b507d8e

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

docs/assets/repositories.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,11 @@ function rolling_average(dates, requests, window = 28) {
162162
sum += requests[j];
163163
count++;
164164
}
165-
const average = count > 0 ? sum / count : 0;
166-
result.push(average);
165+
if (count > 0) {
166+
result.push(30.42 * sum / count);
167+
} else {
168+
result.push(null);
169+
}
167170
}
168171
return result;
169172
}
@@ -195,7 +198,8 @@ function rolling_average(dates, requests, window = 28) {
195198
)
196199
var series = []
197200
sorted_keys.map(function (key) {
198-
color_index = (series.length / 2) % 10
201+
// color_index = (series.length / 2) % 10
202+
color_index = series.length % 10
199203
object = {
200204
x: data[key]["dates"],
201205
y: rolling_average(data[key]["dates"], data[key]["requests"]),
@@ -207,20 +211,20 @@ function rolling_average(dates, requests, window = 28) {
207211
object["visible"] = "legendonly"
208212
}
209213
series.push(object);
210-
object = {
211-
x: data[key]["dates"],
212-
y: data[key]["requests"],
213-
name: key,
214-
mode: "markers",
215-
type: "scatter",
216-
marker: {opacity: 0.1, color: defaultColors[color_index]},
217-
legendgroup: key,
218-
showlegend: false,
219-
}
220-
if (!visible.has(key)) {
221-
object["visible"] = "legendonly"
222-
}
223-
series.push(object);
214+
// object = {
215+
// x: data[key]["dates"],
216+
// y: data[key]["requests"],
217+
// name: key,
218+
// mode: "markers",
219+
// type: "scatter",
220+
// marker: {opacity: 0.1, color: defaultColors[color_index]},
221+
// legendgroup: key,
222+
// showlegend: false,
223+
// }
224+
// if (!visible.has(key)) {
225+
// object["visible"] = "legendonly"
226+
// }
227+
// series.push(object);
224228
return
225229
});
226230
Plotly.plot(
@@ -231,7 +235,7 @@ function rolling_average(dates, requests, window = 28) {
231235
hovermode: 'closest',
232236
"yaxis": {
233237
"range": ["2021-09-01", to_date(new Date())],
234-
"title": "Daily download count"
238+
"title": "Downloads per month"
235239
}
236240
},
237241
);

docs/repositories/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h2>Repository activity</h2>
6060
</ol>
6161
<div class="divider"></div>
6262
<h4>User downloads by package</h4>
63-
<p class="small-text">A chart of 28-day moving average of approximate daily download statistics from Julia's package servers.</p>
63+
<p class="small-text">A chart of 28-day moving average of approximate monthly download statistics from Julia's package servers.</p>
6464
<div id="chart_download_statistics"></div>
6565
<h4>Pull request activity by month</h4>
6666
<p class="small-text">A chart of the number of opened pull requests by month across all of jump-dev.</p>

0 commit comments

Comments
 (0)