mirror of
https://github.com/ershisan99/www.git
synced 2026-02-04 21:12:04 +00:00
don't include ties, again..
This commit is contained in:
@@ -29,9 +29,9 @@ export function WinrateTrendChart({ games }: { games: SelectGames[] }) {
|
|||||||
const [gamesWindow, setGamesWindow] = useState(30)
|
const [gamesWindow, setGamesWindow] = useState(30)
|
||||||
|
|
||||||
// Sort games by date (oldest to newest)
|
// Sort games by date (oldest to newest)
|
||||||
const sortedGames = [...games].sort(
|
const sortedGames = [...games]
|
||||||
(a, b) => a.gameTime.getTime() - b.gameTime.getTime()
|
.sort((a, b) => a.gameTime.getTime() - b.gameTime.getTime())
|
||||||
)
|
.filter((game) => game.result === 'win' || game.result === 'loss')
|
||||||
|
|
||||||
// Calculate rolling winrate
|
// Calculate rolling winrate
|
||||||
const chartData = calculateRollingWinrate(sortedGames, gamesWindow)
|
const chartData = calculateRollingWinrate(sortedGames, gamesWindow)
|
||||||
|
|||||||
Reference in New Issue
Block a user