diff --git a/figures/interactive/top_recommendations.html b/figures/interactive/top_recommendations.html index bbd2528..66f8232 100644 --- a/figures/interactive/top_recommendations.html +++ b/figures/interactive/top_recommendations.html @@ -66,8 +66,7 @@ display: inline-block; width: 15px; height: 15px; - margin-right: 2px; - margin-top: 2px; + margin: 2px 2px 0; } .swatch.period1921::before { background-color:#1f77b4; @@ -132,27 +131,15 @@

Top Recommendations

- - Subscription period: + @@ -300,11 +287,11 @@

Collaborative Filtering Methods

currentCF = currentCF.filter((x) => selectedIds.includes(x.item_id)); } - const selectedSubs = Array.from(periodInput).filter((elem) => elem.checked).map((elem) => elem.value); - // TODO: what about no selection? - if (selectedSubs.length == 1) { - currentLenskit = currentLenskit.filter((x) => x.period.startsWith(selectedSubs[0])); - currentCF = currentCF.filter((x) => x.period.startsWith(selectedSubs[0])); + // optionally filter by subscription time period + const selectedSubs = document.querySelector('input[name="subscription"]:checked').value; + if (selectedSubs != "both") { + currentLenskit = currentLenskit.filter((x) => x.period.startsWith(selectedSubs)); + currentCF = currentCF.filter((x) => x.period.startsWith(selectedSubs)); } plotLenskitData(currentLenskit);