From 31d927bbe202d5b1378fce6cea581cfc360ceb54 Mon Sep 17 00:00:00 2001 From: Anthony Mineo Date: Sat, 4 Apr 2020 12:29:04 -0400 Subject: [PATCH] Setup weapon chart --- .../resources/js/Pages/Players/Player.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/webapp/resources/js/Pages/Players/Player.js b/app/webapp/resources/js/Pages/Players/Player.js index 80f0e7c..0132d7a 100644 --- a/app/webapp/resources/js/Pages/Players/Player.js +++ b/app/webapp/resources/js/Pages/Players/Player.js @@ -3,6 +3,33 @@ import React from 'react' import Layout from '@/Shared/Layout' import GameTypesPlayedBoxes from '@/Components/GameTypesPlayedBoxes' +import {Radar, RadarChart, PolarGrid, PolarAngleAxis, PolarRadiusAxis} from 'recharts' + + +const returnWeaponTotals = (statTotals) => { + let totals = [ + { weapon: 'Chaingun', val: statTotals["chainKills"]}, + { weapon: 'Disc', val: statTotals["discKills"] }, + { weapon: 'Grenade Launcher', val: statTotals["grenadeKills"]}, + { weapon: 'Shocklance', val: statTotals["shockLanceKills"]}, + { weapon: 'Laser Rifle', val: statTotals["laserKills"]}, + { weapon: 'Blaster', val: statTotals["blasterKills"]}, + { weapon: 'Plasma Rifle', val: statTotals["plasmaKills"]}, + { weapon: 'Mortar Launcher', val: statTotals["mortarKills"]}, + { weapon: 'Missile Launcher', val: statTotals["missileKills"]}, + { weapon: 'Hand Grenade', val: statTotals["hGrenadeKills"]}, + { weapon: 'Mine', val: statTotals["mineKills"]}, + { weapon: 'Satchel', val: statTotals["satchelChargeKills"]}, + ]; + + // dont return if the val is 0 + return totals.filter(function (el) { + return el.val > 0; + }); +}; + + + @@ -16,6 +43,13 @@ export default function Player(props) { spawnctf={props.playerData.player.total_games_sctfgame} /> + + + + + + +
{JSON.stringify(props.playerData.totals)}
{JSON.stringify(props.playerData.stats)}