Merge pull request #62 from postylem/patch-1

histogram width divide by mode, not total
This commit is contained in:
Hannah Park 2022-01-26 16:59:38 -05:00 committed by GitHub
commit 280a36825e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,8 @@ type Props = {
}
export const Histogram = ({ gameStats }: Props) => {
const { totalGames, winDistribution } = gameStats
const winDistribution = gameStats.winDistribution
const maxValue = Math.max(...winDistribution)
return (
<div className="columns-1 justify-left m-2 text-sm">
@ -14,7 +15,7 @@ export const Histogram = ({ gameStats }: Props) => {
<Progress
key={i}
index={i}
size={95 * (value / totalGames)}
size={90 * (value / maxValue)}
label={String(value)}
/>
))}