Programming Usage Stats Visualizer

Usage Stats Visualizer



Description/What it does
This tool is meant to help people track metagame trends at the individual pokemon level based on ladder usage statistics. So if you want to see what's catching on or what threats the ladder is sleeping on, this is the tool for you.

Given specifications like generation, tier, level (thats the 0, 1500, 1630, 1825 marks), and a month range, the program grabs the relevant usage files from the smogon.com/stats directories, scanning them and getting the individual pokemon usage information. Then, given some pokemon that are in those lists, it plots the usage% data by month for the month range given. If a pokemon did not appear in those months (usually due to a ban or a rise to a higher tier), no dots are displayed (see Poliwrath in the picture above) to help distinguish between pokemon who just fell off in usage and pokemon who could not be used.

How to/Example
In the specifications section, select a generation, tier, level, and date range (Try Gen6 PU 1500 from 2015-01 to 2016-12) then click get data. The "Select Pokemon" tab should open, then once the data is loaded should display 3 entry fields. Type in any 3 PU pokemon for example "Machoke", "Throh", and "Gourgeist-Super", and click the Graph button. The graph should display in the place of [graph goes here].

Disclaimers
I formally apologize to anyone who has to look through that javascript code, I was learning it (and jquery) as I went along so there's probably a lot of garbage in there and copy/pasted nonsense code. I plan on going through and cleaning it up when I get time. That got done :D
Another thing is that the frontend/styling is minimal to make sure I could get it to actually work (I spent 2 days writing most of the code and then 2 more days rewriting it to be able to be deployed on heroku). Other known issues/pending improvements are in the issues section of the github repo.

Codebase
Python (flask) for retrieving the .txt data and processing it
JavaScript for responsiveness and dynamic-ness
HTML/CSS for being a pretty-looking website

Website: https://limitless-lowlands-81121.herokuapp.com/
Github repo: https://github.com/aturfah/smogon-usage-stats

Thank you in advance for any feedback/suggestions you may have.
 
Last edited:
Looks interesting from the screenshot.

Unfortunately I can't get it to load anything at first try. I selected "gen7, ou, 1500" and pressed the Get Data button; but nothing changes, it still says "[graph goes here]" on the right.

The javascript console gives no related errors, so I'm not really sure what's going wrong.

--

Note that some formats use different levels from what the site expects (gen7OU currently has 0, 1500, 1695, 1825 instead of the options 0, 1500, 1630, 1760 I can select). Potentially you could pull them from the file list on http://www.smogon.com/stats/2017-08/ and hardcode them into the page to avoid having to pull them on every page load.

--

console:
/favicon.ico Failed to load resource: the server responded with a status of 404 (NOT FOUND)

The page head doesn't have a <link rel="icon"> meta tag, so my browser probably just looks for a favicon on the default location.
 
Sorry I should've explained that better, the process for actually graphing is doing 'get data' with the tier specifications, then in the 'select pokemon' section you pick the pokemon you want to graph. I separated the data loading from the actual graphing because the data loading takes 10-15 seconds whereas once the data is there the graphing can happen relatively quickly. I'ma put that in the OP just for clarity.

The different levels (0-1500-1695 vs 0-1500-1630) are handled in the code, it will should handle those correctly from the tests I've ran. I didn't want to play with those too much because I wasn't super familiar with modifying the html on the fly at the time but I can definitely do that soon. I'll probably just have a "If gen is gen7 and tier is OU then put in 0, 1500, 1695, 1825" function.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top