ff14-advanced-market-search / saddlebag-with-pockets

This is the Frontend for the FF14 Marketplace

Home Page:https://saddlebagexchange.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add server_distribution chart to ffxiv history calls

cohenaj194 opened this issue · comments

We have a new chart added into the ffxiv history. This will show the distribution of which servers bought the most items. We need this made into a chart or graph. The graph also has to handle the edgecase where it is just {} and not show the graph. The following will be a new key and value in the /api/history api call results.

"server_distribution": {
        "Famfrit": 17,
        "Brynhildr": 6,
        "Seraph": 6,
        "Adamantoise": 5,
        "Mateus": 4,
        "Siren": 3,
        "Goblin": 3,
        "Zalera": 3,
        "Behemoth": 3,
        "Halicarnassus": 3,
        "Marilith": 3,
        "Midgardsormr": 2,
        "Coeurl": 2,
        "Cactuar": 1,
        "Balmung": 1,
        "Diabolos": 1,
        "Faerie": 0,
        "Gilgamesh": 0,
        "Jenova": 0,
        "Sargatanas": 0,
        "Malboro": 0,
        "Excalibur": 0,
        "Exodus": 0,
        "Hyperion": 0,
        "Lamia": 0,
        "Leviathan": 0,
        "Ultros": 0,
        "Maduin": 0
    }

These are the files to update:

https://github.com/ff14-advanced-market-search/saddlebag-with-pockets/blob/master/app/requests/GetHistory.ts#L34-L45

https://github.com/ff14-advanced-market-search/saddlebag-with-pockets/blob/master/app/components/FFXIVResults/item-history/Results.tsx