histogram width divide by mode, not total #2

Merged
christofsteel merged 47 commits from honigle into main 2022-02-02 13:59:36 +01:00
Showing only changes of commit 280a36825e - Show all commits

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)}
/>
))}