diff --git a/packages/website/src/components/Performance/Charts/components/BattleDistributionAcrossTiersNivo.tsx b/packages/website/src/components/Performance/Charts/components/BattleDistributionAcrossTiers.tsx similarity index 86% rename from packages/website/src/components/Performance/Charts/components/BattleDistributionAcrossTiersNivo.tsx rename to packages/website/src/components/Performance/Charts/components/BattleDistributionAcrossTiers.tsx index 5a1b196e2..ccbd13c05 100644 --- a/packages/website/src/components/Performance/Charts/components/BattleDistributionAcrossTiersNivo.tsx +++ b/packages/website/src/components/Performance/Charts/components/BattleDistributionAcrossTiers.tsx @@ -8,8 +8,11 @@ import { TIERS, } from '@blitzkit/core'; import strings from '@blitzkit/core/lang/en-US.json'; +import { useStore } from '@nanostores/react'; import { Box, Flex, Heading } from '@radix-ui/themes'; +import { filterTank } from '../../../../core/blitzkit/filterTank'; import { useAveragesExclusionRatio } from '../../../../hooks/useAveragesExclusionRatio'; +import { $tankFilters } from '../../../../stores/tankFilters'; import { TankPerformanceEphemeral } from '../../../../stores/tankPerformanceEphemeral'; import { ThemedBar } from '../../../Nivo/ThemedBar'; @@ -22,6 +25,7 @@ export function BattleDistributionAcrossTiers() { (state) => state.playerCountPeriod, ); const ratio = useAveragesExclusionRatio(); + const filters = useStore($tankFilters); return ( @@ -40,7 +44,13 @@ export function BattleDistributionAcrossTiers() { const id = Number(idString); const tank = tankDefinitions.tanks[id]; - if (tank === undefined || tank.tier !== tier) return; + if ( + tank === undefined || + tank.tier !== tier || + !filterTank(filters, tank) + ) { + return; + } players[tank.class] += entry.samples[playerCountPeriod] * ratio; }); diff --git a/packages/website/src/components/Performance/Charts/index.tsx b/packages/website/src/components/Performance/Charts/index.tsx index a30184d18..a5517a681 100644 --- a/packages/website/src/components/Performance/Charts/index.tsx +++ b/packages/website/src/components/Performance/Charts/index.tsx @@ -1,5 +1,5 @@ import { Flex } from '@radix-ui/themes'; -import { BattleDistributionAcrossTiers } from './components/BattleDistributionAcrossTiersNivo'; +import { BattleDistributionAcrossTiers } from './components/BattleDistributionAcrossTiers'; export function Charts() { return (