aboutsummaryrefslogtreecommitdiff
path: root/src/lib/AuctionPriceScatterplot.svelte
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-18 23:02:51 -0500
committermat <github@matdoes.dev>2022-05-18 23:02:51 -0500
commit7fdbbb13b8891e500562b3c2e2b97095bb78fdac (patch)
tree9c10c17023afde6b81eb511a7ba4b3224ef0a195 /src/lib/AuctionPriceScatterplot.svelte
parent48c48ecd6c349f0e0d7649b7b606b994875d1acf (diff)
downloadskyblock-stats-7fdbbb13b8891e500562b3c2e2b97095bb78fdac.tar.gz
skyblock-stats-7fdbbb13b8891e500562b3c2e2b97095bb78fdac.tar.bz2
skyblock-stats-7fdbbb13b8891e500562b3c2e2b97095bb78fdac.zip
Make sure heightCoinInterval is always at least 1
Diffstat (limited to 'src/lib/AuctionPriceScatterplot.svelte')
-rw-r--r--src/lib/AuctionPriceScatterplot.svelte5
1 files changed, 4 insertions, 1 deletions
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) {