diff --git a/src/users.md b/src/users.md index c8f6598..d257ca8 100644 --- a/src/users.md +++ b/src/users.md @@ -87,6 +87,11 @@ const careerStageColor = Plot.scale({ unknown: 'var(--theme-foreground-muted)', }, }) + +const usersWithAtLeast1ReviewPublished = d3.sum(reviewsByAuthor, d => (d[1] >= 1 ? 1 : 0)) +const usersWith1ReviewPublished = d3.sum(reviewsByAuthor, d => (d[1] === 1 ? 1 : 0)) +const usersWithMoreThan1ReviewsPublished = d3.sum(reviewsByAuthor, d => (d[1] > 1 ? 1 : 0)) +const usersWithMoreThan3ReviewsPublished = d3.sum(reviewsByAuthor, d => (d[1] > 3 ? 1 : 0)) ```
At least 1 | -${d3.sum(reviewsByAuthor, d => d[1] >= 1 ? 1 : 0).toLocaleString('en-US')} | +${usersWithAtLeast1ReviewPublished.toLocaleString('en-US')} | +|
---|---|---|---|
Only 1 | -${d3.sum(reviewsByAuthor, d => d[1] === 1 ? 1 : 0).toLocaleString('en-US')} | +${usersWith1ReviewPublished.toLocaleString('en-US')} | +${d3.format(".1%")(usersWith1ReviewPublished / usersWithAtLeast1ReviewPublished)} |
More than 1 | -${d3.sum(reviewsByAuthor, d => d[1] > 1 ? 1 : 0).toLocaleString('en-US')} | +${usersWithMoreThan1ReviewsPublished.toLocaleString('en-US')} | +${d3.format(".1%")(usersWithMoreThan1ReviewsPublished / usersWithAtLeast1ReviewPublished)} |
More than 3 | -${d3.sum(reviewsByAuthor, d => d[1] > 3 ? 1 : 0).toLocaleString('en-US')} | +${usersWithMoreThan3ReviewsPublished.toLocaleString('en-US')} | +${d3.format(".1%")(usersWithMoreThan3ReviewsPublished / usersWithAtLeast1ReviewPublished)} |