From 7fdbbb13b8891e500562b3c2e2b97095bb78fdac Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Wed, 18 May 2022 23:02:51 -0500
Subject: Make sure heightCoinInterval is always at least 1

---
 src/lib/AuctionPriceScatterplot.svelte | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/lib/AuctionPriceScatterplot.svelte')

diff --git a/src/lib/AuctionPriceScatterplot.svelte b/src/lib/AuctionPriceScatterplot.svelte
index d8946fe..da1aed2 100644
--- a/src/lib/AuctionPriceScatterplot.svelte
+++ b/src/lib/AuctionPriceScatterplot.svelte
@@ -15,7 +15,10 @@
 	const gridWidth = 100 / hoursBetween
 
 	// this code is bad but it works
-	let heightCoinInterval = Math.ceil(Math.pow(10, Math.floor(Math.log10(maxCoins / 5))))
+	let heightCoinInterval = Math.max(
+		1,
+		Math.ceil(Math.pow(10, Math.floor(Math.log10(maxCoins / 5))))
+	)
 	if (heightCoinInterval < maxCoins / 20) {
 		heightCoinInterval *= 5
 	} else if (heightCoinInterval < maxCoins / 10) {
-- 
cgit 

