From ce97f7eec03a44dd653512656546ade2eb8fa01b Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 17 May 2022 23:20:35 -0500 Subject: Show auctions sold frequency --- src/lib/AuctionPriceScatterplot.svelte | 2 +- src/routes/auctionprices.svelte | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') 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)}

{/if} + {#if item.auctions.length >= 2} +

+ Frequency: + + {parseFloat( + ( + (24 * 60 * 60) / + ((Date.now() / 1000 - item.auctions[0].ts) / item.auctions.length) + ).toPrecision(2) + ).toLocaleString()}/day + +

+ {/if}
-- cgit