Skip to content

Commit

Permalink
Fix histogram scaling
Browse files Browse the repository at this point in the history
Unscored user bin was accidentally included in calculating the maximum bin count
  • Loading branch information
shiruken committed Aug 10, 2024
1 parent 5fb001f commit 2d7a027
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion devvit.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name: user-scorer
version: 1.2.1
version: 1.2.2
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "user-scorer",
"version": "1.2.1",
"version": "1.2.2",
"license": "BSD-3-Clause",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export async function generateReport(_event: MenuItemOnPressEvent, context: Cont
}

// Generate the histogram visualization
const bin_max = Math.max(...histogram.bins.map(bin => bin.count));
const bin_max = Math.max(...(histogram.bins.slice(1)).map(bin => bin.count));
let chart = "";
if (bin_max > 0) {
histogram.bins.slice(1).forEach(bin => {
Expand Down

0 comments on commit 2d7a027

Please sign in to comment.