From e257912a90e96bb4b097f61b67e94e546b640eb9 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Sat, 4 Jun 2022 23:12:39 -0400 Subject: [PATCH] add chart for num installations over time #7 --- js/year.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/year.js b/js/year.js index a34cf33..e195692 100644 --- a/js/year.js +++ b/js/year.js @@ -24,6 +24,17 @@ fetch(url).then(function(response) { } div.innerHTML += `${key} ` + stars + ` ${value.length}` + '\n'; } + div.innerHTML += '\n'; + div.innerHTML += 'Dataverse Installations by Over Time\n'; + let runningTotal = 0; + for (const [year, installations] of Object.entries(byYear)) { + runningTotal += installations.length; + let stars = ''; + for (let i = 0; i < runningTotal; i++) { + stars += '*'; + } + div.innerHTML += `${year} ${stars} ${runningTotal}\n`; + } if (byYear['????'].length > 0) { div.innerHTML += '\nInstallations with Unknown Launch Year\n'; for (const unknown of byYear['????']) {