diff options
author | mat <github@matdoes.dev> | 2022-05-17 23:20:35 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-05-17 23:20:35 -0500 |
commit | ce97f7eec03a44dd653512656546ade2eb8fa01b (patch) | |
tree | fe6c2599e86072760b6bcbc6862f9cb015cf0e1c /src | |
parent | 506e78c5eeecca48d77524d0160fd30a773296e4 (diff) | |
download | skyblock-stats-ce97f7eec03a44dd653512656546ade2eb8fa01b.tar.gz skyblock-stats-ce97f7eec03a44dd653512656546ade2eb8fa01b.tar.bz2 skyblock-stats-ce97f7eec03a44dd653512656546ade2eb8fa01b.zip |
Show auctions sold frequency
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/AuctionPriceScatterplot.svelte | 2 | ||||
-rw-r--r-- | src/routes/auctionprices.svelte | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/AuctionPriceScatterplot.svelte b/src/lib/AuctionPriceScatterplot.svelte index cfdbe9b..defadcd 100644 --- a/src/lib/AuctionPriceScatterplot.svelte +++ b/src/lib/AuctionPriceScatterplot.svelte @@ -75,7 +75,7 @@ bind:this={svgEl} /> - {#each item.auctions as auction} + {#each item.auctions as auction (auction.id)} {@const [x, y] = getAuctionCoordinates(auction)} <circle cx={x} diff --git a/src/routes/auctionprices.svelte b/src/routes/auctionprices.svelte index 68ce00e..e778330 100644 --- a/src/routes/auctionprices.svelte +++ b/src/routes/auctionprices.svelte @@ -97,6 +97,19 @@ </b> </p> {/if} + {#if item.auctions.length >= 2} + <p> + Frequency: + <b> + {parseFloat( + ( + (24 * 60 * 60) / + ((Date.now() / 1000 - item.auctions[0].ts) / item.auctions.length) + ).toPrecision(2) + ).toLocaleString()}/day + </b> + </p> + {/if} </div> <div class="item-scatterplot"> <AuctionPriceScatterplot {item} bind:currentlyPreviewedAuction /> |