diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2018-07-12 11:34:43 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2018-12-13 17:09:25 +0100 |
| commit | 74d606bef1d0259fa28dee011db41de1fb236b98 (patch) | |
| tree | a5abff20f00e00fd1186c9169fe4f6787e440c22 /src/ReportService.js | |
| parent | b6a0e90753443e56e90be0c52fd65a7a3df2d2e4 (diff) | |
| download | brokentalents-74d606bef1d0259fa28dee011db41de1fb236b98.tar.gz brokentalents-74d606bef1d0259fa28dee011db41de1fb236b98.zip | |
Add Blitz Points statistics
Diffstat (limited to 'src/ReportService.js')
| -rw-r--r-- | src/ReportService.js | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/ReportService.js b/src/ReportService.js index 3da118a..0ac4239 100644 --- a/src/ReportService.js +++ b/src/ReportService.js @@ -5,7 +5,7 @@ const POPULAR_THRESHOLD = 1.0; // percent const PICKS_THRESHOLD = 300; // picks const VARIANCE_THRESHOLD = 0.25; // % minimum accuracy -const report = require('../data/2d73896c/report.json') +const report = require('../data/5f7773da/report.json') .filter((entry) => entry.Actor != undefined); // bad data from API downtime const reports = new Map(); @@ -19,6 +19,9 @@ const topLegendaryWins = new Map(); const topLowLevel = new Map(); const topScaling = new Map(); const topUnpopularWins = new Map(); +const topKillDeathPoints = new Map(); +const topObjectivePoints = new Map(); +const topBlitzPointsDelta = new Map(); let totalMatches = 0; let actors = []; const modes = metadata.config.api.modes; @@ -80,6 +83,9 @@ for(let mode of modes) { TotalPicks: sum_weights || entry.Count, // NoTalent has no weights TotalWinner: sum_y / sum_weights || entry.Winner, SampleTooSmall: sum_weights < PICKS_THRESHOLD, + KillDeathPoints: maps.killDeathPoints(entry), + ObjectivePoints: maps.objectivePoints(entry), + BlitzPointsDelta: maps.blitzPointsDelta(entry), VarianceTooLarge: rsquare < VARIANCE_THRESHOLD, }); }); @@ -115,6 +121,15 @@ for(let mode of modes) { topScaling.set(mode, reports.get(mode) .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) .sort((entry1, entry2) => entry2.TalentWinrateLevelScaling - entry1.TalentWinrateLevelScaling)[0]); + topKillDeathPoints.set(mode, reports.get(mode) + .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) + .sort((entry1, entry2) => entry2.KillDeathPoints - entry1.KillDeathPoints)[0]); + topObjectivePoints.set(mode, reports.get(mode) + .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) + .sort((entry1, entry2) => entry2.ObjectivePoints - entry1.ObjectivePoints)[0]); + topBlitzPointsDelta.set(mode, reports.get(mode) + .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) + .sort((entry1, entry2) => entry2.BlitzPointsDelta - entry1.BlitzPointsDelta)[0]); if (actors.length == 0) { actors = [...new Set(reports.get(mode).map((entry) => entry.Actor))]; @@ -170,6 +185,18 @@ export default { return topUnpopular.get(mode); }, + getTopKillDeathPoints(mode) { + return topKillDeathPoints.get(mode); + }, + + getTopObjectivePoints(mode) { + return topObjectivePoints.get(mode); + }, + + getTopBlitzPointsDelta(mode) { + return topBlitzPointsDelta.get(mode); + }, + getActors() { return actors; }, |
