From 7b1496511f0a07e87419741bb770f7dcb9814432 Mon Sep 17 00:00:00 2001 From: Nick Krecklow Date: Wed, 17 Jun 2020 22:22:29 -0500 Subject: [PATCH] 5.5.5 --- assets/js/scale.js | 8 +++++++- docs/CHANGELOG.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/js/scale.js b/assets/js/scale.js index f3bd304..0ac8a51 100644 --- a/assets/js/scale.js +++ b/assets/js/scale.js @@ -8,7 +8,13 @@ export class RelativeScale { const scale = Math.pow(10, factor) const scaledMin = min - (min % scale) - const scaledMax = max + (max % scale === 0 ? 0 : (scale - (max % scale))) + let scaledMax = max + (max % scale === 0 ? 0 : (scale - (max % scale))) + + // Prevent min/max from being equal (and generating 0 ticks) + // This happens when all data points are products of scale value + if (scaledMin === scaledMax) { + scaledMax += scale + } const ticks = (scaledMax - scaledMin) / scale diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 019387f..cb3356c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,6 @@ +**5.5.5** *(June 17 2020)* +- Fixes servers with constant player counts failing to render graphs due to the min/max values being equal. + **5.5.4** *(June 16 2020)* - Updated uPlot dependency 1.0.8 -> 1.0.11. diff --git a/package-lock.json b/package-lock.json index d4e7781..d1b0ab4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "minetrack", - "version": "5.5.4", + "version": "5.5.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 51216d8..a0c4015 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minetrack", - "version": "5.5.4", + "version": "5.5.5", "description": "A Minecraft server tracker that lets you focus on the basics.", "main": "main.js", "dependencies": {