Skip to content

Commit

Permalink
Fix playoff stats
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed May 10, 2024
1 parent 1bc0313 commit c50699a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
7 changes: 3 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
team graphs https://old.reddit.com/r/BasketballGM/comments/1bsp3ji/monthly_suggestions_thread/kxm3at5/
- stuff from power rankings: team rating (current/healthy), playoff rating (current/healthy), rating/position ranks
- challengeNoRatings
- challengeNoRatings for power rankings stuff
- test all sports
- baseball fielding stats
- when to hide for missing data? maybe only if both are playoffs, for teams with no playoff games. or if both disabled
- test playoffs
- stats
- how to handle upcoming playoffs during regular season
- team ratings (basketball only)
- addPowerRankingsStuffToTeams input should be non-playoff teams stats object
- does playoffs dropdown make sense for any of these except stats? not really
Expand All @@ -29,6 +26,8 @@ drag and drop
- manage confs page
- maybe same as customize page, but with some option to prevent deleting/adding teams

on trading block, if salary cap is disabled, hide the Payroll and Cap columns since they are not relevant

support importing players from league file with non-augmented player objects https://discord.com/channels/@me/361954501365858304/1237815968147701760
- need to do all of augmentPartialPlayer, not just name. cause we need ovr/pot too
- should run augmentPartialPlayer after reading file in LeagueFileUpload but before showing in UI for ImportPlayers
Expand Down
4 changes: 4 additions & 0 deletions src/ui/views/PlayerGraphs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ const GraphCreation = ({
});
}

if (data.length === 0) {
return <div>No data for the selected options.</div>;
}

const titleX = getStatsWithLabels([stat[0]], statType[0])[0];
const titleY = getStatsWithLabels([stat[1]], statType[1])[0];
const descShort: [string, string] = [titleX.title, titleY.title];
Expand Down
7 changes: 7 additions & 0 deletions src/ui/views/TeamGraphs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ const GraphCreation = <Team extends ViewProps["teamsX"][number]>({
const data: TooltipData[] = [];
for (const t of teams[0]) {
const t2 = teamsYByTid[t.tid];
if (!t2) {
continue;
}

data.push({
x: getStatFromTeam(t, stat[0], statType[0]),
Expand All @@ -231,6 +234,10 @@ const GraphCreation = <Team extends ViewProps["teamsX"][number]>({
});
}

if (data.length === 0) {
return <div>No data for the selected options.</div>;
}

const titleX = getStatsWithLabels([stat[0]], statType[0], true)[0];
const titleY = getStatsWithLabels([stat[1]], statType[1], true)[0];
const descShort: [string, string] = [titleX.title, titleY.title];
Expand Down
1 change: 1 addition & 0 deletions src/worker/views/teamGraphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ const updateTeams = async (
? inputStat
: random.choice(statForAxis.stats);

console.log(axis, statForAxis.teams);
return {
[season]: inputs[season],
[statType]: statForAxis.statType,
Expand Down

0 comments on commit c50699a

Please sign in to comment.