diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/AuctionPriceScatterplot.svelte | 11 | ||||
-rw-r--r-- | src/lib/api.ts | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/AuctionPriceScatterplot.svelte b/src/lib/AuctionPriceScatterplot.svelte index 42fb6f1..d01349c 100644 --- a/src/lib/AuctionPriceScatterplot.svelte +++ b/src/lib/AuctionPriceScatterplot.svelte @@ -12,8 +12,13 @@ let hoursBetween = (currentTimestamp - earliestTimestamp) / (60 * 60) const gridWidth = 100 / hoursBetween - let heightCoinInterval = Math.ceil(Math.pow(10, Math.floor(Math.log10(maxCoins / 2)))) - + // this code is bad but it works + let heightCoinInterval = Math.ceil(Math.pow(10, Math.floor(Math.log10(maxCoins / 5)))) + if (heightCoinInterval < maxCoins / 20) { + heightCoinInterval *= 5 + } else if (heightCoinInterval < maxCoins / 10) { + heightCoinInterval *= 2 + } const gridHeight = 100 / (maxCoins / heightCoinInterval) function getAuctionCoordinates(auction: SimpleAuctionSchema) { @@ -84,7 +89,7 @@ {#each new Array(Math.floor(maxCoins / heightCoinInterval) + 1) as _, intervalIndex} <text x="-1" - y={Math.max(5, 100 - intervalIndex * gridHeight + 2)} + y={Math.min(Math.max(5, 100 - intervalIndex * gridHeight + 2), 100)} fill="var(--theme-darker-text)" font-size="6px" text-anchor="end">{shortenBigNumber(heightCoinInterval * intervalIndex)}</text diff --git a/src/lib/api.ts b/src/lib/api.ts index 77d6334..9152370 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1,4 +1,4 @@ // the trailing slash is required -// export const API_URL = 'https://skyblock-api.matdoes.dev/' +export const API_URL = 'https://skyblock-api.matdoes.dev/' // export const API_URL = 'http://localhost:8080/' -export const API_URL = 'https://8080-skyblocksta-skyblockapi-gef4h4mxokc.ws-us45.gitpod.io/' +// export const API_URL = 'https://8080-skyblocksta-skyblockapi-gef4h4mxokc.ws-us45.gitpod.io/' |